-
Notifications
You must be signed in to change notification settings - Fork 298
/
bug2718.mos
59 lines (56 loc) · 1.56 KB
/
bug2718.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
// name: bug2718
// keywords: event, not
// status: correct
// cflags:
// teardown_command: rm -rf eventTests.bug2718* output.log
//
//
loadString("
package eventTests
model bug2718
Real x,y,z(start=-0.002);
Boolean b, b1;
algorithm
b := not z > pre(x);
when b then
x := z+0.001;
end when;
equation
b1 = not z > pre(y);
when b1 then
y = z-0.001;
end when;
der(z) = 0.1*sin(50*time);
end bug2718;
end eventTests;
"); getErrorString();
simulate(eventTests.bug2718, stopTime=0.3); getErrorString();
val(x, 0.0);
val(x, 0.1);
val(x, 0.2);
val(x, 0.3);
val(y, 0.0);
val(y, 0.1);
val(y, 0.2);
val(y, 0.3);
// Result:
// true
// ""
// record SimulationResult
// resultFile = "eventTests.bug2718_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 0.3, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'eventTests.bug2718', 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.0009999998999998816
// 0.0009999998999998816
// 0.001999999799899718
// 0.0
// -0.001000000100000118
// -0.002000000200100132
// -0.003000000300300141
// endResult