-
Notifications
You must be signed in to change notification settings - Fork 298
/
problem2-impeuler.mos
76 lines (71 loc) · 2.17 KB
/
problem2-impeuler.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// name: problem2-radau1
// status: correct
// teardown_command: rm -f testSolver.problem2* output.log
stopTime := 321.8122;
loadFile("testSolverPackage.mo"); getErrorString();
simulate(testSolver.problem2, stopTime=stopTime, numberOfIntervals=12000, method="impeuler"); getErrorString();
res := OpenModelica.Scripting.compareSimulationResults("testSolver.problem2_res.mat",
getEnvironmentVar("REFERENCEFILES")+"/solver/testSolver.problem2.mat",
"testSolver.problem2_diff.csv",0.1,0.1,
{
"y[1]",
"y[2]",
"y[3]",
"y[4]",
"y[5]",
"y[6]",
"y[7]",
"y[8]",
"der(y[1])",
"der(y[2])",
"der(y[3])",
"der(y[4])",
"der(y[5])",
"der(y[6])",
"der(y[7])",
"der(y[8])"
});
getErrorString();
val(y[1], stopTime);
val(y[2], stopTime);
val(y[3], stopTime);
val(y[4], stopTime);
val(y[5], stopTime);
val(y[6], stopTime);
val(y[7], stopTime);
val(y[8], stopTime);
/*
val(der(y[1]), stopTime);
val(der(y[2]), stopTime);
val(der(y[3]), stopTime);
val(der(y[4]), stopTime);
val(der(y[5]), stopTime);
val(der(y[6]), stopTime);
val(der(y[7]), stopTime);
val(der(y[8]), stopTime);
*/
// Result:
// 321.8122
// true
// ""
// record SimulationResult
// resultFile = "testSolver.problem2_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 321.8122, numberOfIntervals = 12000, tolerance = 1e-06, method = 'impeuler', fileNamePrefix = 'testSolver.problem2', 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.
// "
// 0.0007368273600530499
// 0.0001441886650318589
// 5.883073028969187e-05
// 0.0011750850478804
// 0.0023772358606737
// 0.006210365748304785
// 0.002843579526195892
// 0.002856420473879454
// endResult