-
Notifications
You must be signed in to change notification settings - Fork 298
/
whenTest1.mos
43 lines (40 loc) · 1.29 KB
/
whenTest1.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
// name: whenTest1
// keywords: event, when
// status: correct
// cflags:
// teardown_command: rm -rf eventTests.whenTest1* _eventTests.whenTest1* output.log
//
// case for a never active when equation
//
loadString("
within ;
package eventTests
model whenTest1
Real x;
equation
when time > -1.0 then
x = 1;
end when;
end whenTest1;
end eventTests;
"); getErrorString();
simulate(eventTests.whenTest1); getErrorString();
val(x, 0.0);
val(x, 0.5);
val(x, 1.0);
// Result:
// true
// ""
// record SimulationResult
// resultFile = "eventTests.whenTest1_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'eventTests.whenTest1', 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\").
// "
// 0.0
// 0.0
// 0.0
// endResult