-
Notifications
You must be signed in to change notification settings - Fork 298
/
HelloWorld.mos
39 lines (39 loc) · 1.46 KB
/
HelloWorld.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
// name: HelloWorld
// keywords: equation
// status: correct
// teardown_command: rm -rf HelloWorld_* HelloWorld HelloWorld.exe HelloWorld.cpp HelloWorld.makefile HelloWorld.libs HelloWorld.log output.log
//
// Equation handling
// Drmodelica: 2.1 Hello World (p. 19)
//
loadFile("HelloWorld.mo");
simulate(HelloWorld, startTime=0.0, stopTime=1.0, numberOfIntervals=2, tolerance=1e-5);
val(x,0.0);getErrorString();
val(x,0.5);getErrorString();
val(x,1.0);getErrorString();
val(der(x),0.0);getErrorString();
val(der(x),0.5);getErrorString();
val(der(x),1.0);getErrorString();
// Result:
// true
// record SimulationResult
// resultFile = "HelloWorld_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 2, tolerance = 1e-05, method = 'dassl', fileNamePrefix = 'HelloWorld', 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;
// 1.0
// "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\").
// "
// 0.6065402534538799
// ""
// 0.3678855304779522
// ""
// -1.0
// ""
// -0.6065402534538799
// ""
// -0.3678855304779522
// ""
// endResult