-
Notifications
You must be signed in to change notification settings - Fork 298
/
05_SingularModel.mos
50 lines (46 loc) · 2.75 KB
/
05_SingularModel.mos
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// name: 05_SingularModel
// status: correct
//
// Simulation Results
// Examples to the Tutorial "Mathematical Aspects of Object-Oriented Modeling and Simulation"
//
loadFile("SingularModel1.mo"); getErrorString();
loadFile("SingularModel2.mo"); getErrorString();
simulate(SingularModel1, stopTime=10); getErrorString();
res := OpenModelica.Scripting.compareSimulationResults("SingularModel1_res.mat",
"ReferenceFiles/SingularModel1.mat",
"SingularModel1_diff.csv", 0.01, 0.0001,
{"x", "y"}); getErrorString();
simulate(SingularModel2, stopTime=10); getErrorString();
// Result:
// true
// ""
// true
// ""
// record SimulationResult
// resultFile = "SingularModel1_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 10.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'SingularModel1', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// messages = "LOG_SUCCESS | info | The initialization finished successfully without homotopy method.
// LOG_SUCCESS | info | The simulation finished successfully.
// "
// end SimulationResult;
// "Warning: The initial conditions are not fully specified. For more information set -d=initialization. In OMEdit Tools->Options->Simulation->OMCFlags, in OMNotebook call setCommandLineOptions(\"-d=initialization\").
// "
// {"Files Equal!"}
// "Warning: 'compareSimulationResults' is deprecated. It is recommended to use 'diffSimulationResults' instead.
// "
// record SimulationResult
// resultFile = "",
// simulationOptions = "startTime = 0.0, stopTime = 10.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'SingularModel2', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// messages = "Simulation execution failed for model: SingularModel2
// stdout | warning | The default linear solver fails, the fallback solver with total pivoting is started at time 0.000000. That might raise performance issues, for more information use -lv LOG_LS.
// stdout | warning | Error solving linear system of equations (no. 7) at time 0.000000.
// stdout | warning | Solving linear system 7 fails at time 0. For more information use -lv LOG_LS.
// assert | debug | Solving linear system 7 failed at time=0.
// | | | | For more information please use -lv LOG_LS.
// assert | info | simulation terminated by an assertion at initialization
// "
// end SimulationResult;
// "Warning: The initial conditions are not fully specified. For more information set -d=initialization. In OMEdit Tools->Options->Simulation->OMCFlags, in OMNotebook call setCommandLineOptions(\"-d=initialization\").
// "
// endResult