-
Notifications
You must be signed in to change notification settings - Fork 298
/
PlanarMechanicsForTesting.Examples.FreeBody.mos
35 lines (31 loc) · 2.12 KB
/
PlanarMechanicsForTesting.Examples.FreeBody.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
// name: PlanarMechanicsForTesting.Examples.FreeBody.mos [simulation checking]
// keywords: simulation PlanarMechanicsForTesting.Examples
// status: correct
// teardown_command: rm -rf _PlanarMechanicsForTesting.Examples.FreeBody.* PlanarMechanicsForTesting.Examples.FreeBody_* PlanarMechanicsForTesting.Examples.FreeBody PlanarMechanicsForTesting.Examples.FreeBody.exe PlanarMechanicsForTesting.Examples.FreeBody.cpp PlanarMechanicsForTesting.Examples.FreeBody.makefile PlanarMechanicsForTesting.Examples.FreeBody.libs PlanarMechanicsForTesting.Examples.FreeBody.log PlanarMechanicsForTesting.Examples.FreeBody.c PlanarMechanicsForTesting.Examples.FreeBody.o output.log
//
// Simulation Results
// Modelica Standard Library
//
loadModel(Modelica,{"3.1"}); getErrorString();
loadFile("PlanarMechanicsForTesting.mo"); getErrorString();
// adrpo: stopTime=3 is got from the experiment annotation in the model
simulate(PlanarMechanicsForTesting.Examples.FreeBody); getErrorString();
res := OpenModelica.Scripting.compareSimulationResults("PlanarMechanicsForTesting.Examples.FreeBody_res.mat",
getEnvironmentVar("REFERENCEFILES")+"/PlanarMechanics//FreeBody.mat","PlanarMechanicsForTesting.Examples.FreeBody_diff.csv",0.01,0.00001,
{"body.r[1]", "body.r[2]", "body.v[2]"});
// Result:
// true
// ""
// true
// ""
// record SimulationResult
// resultFile = "PlanarMechanicsForTesting.Examples.FreeBody_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 3.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'PlanarMechanicsForTesting.Examples.FreeBody', 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!"}
// endResult