-
Notifications
You must be signed in to change notification settings - Fork 298
/
UnitCheck9.mos
51 lines (48 loc) · 1.04 KB
/
UnitCheck9.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
// name: UnitCheck9
// keywords: initialization
// status: correct
loadString("
package unitCheckTests
model UnitCheck9
Real V(unit = \"m2/s2\");
Real A;
Real S(unit = \"m/s\");
Real C = 1;
Real E = 1;
equation
A = 5.0;
V = 8.0;
V = E*C + S*(-A);
end UnitCheck9;
end unitCheckTests;
"); getErrorString();
setCommandLineOptions("--unitChecking -d=dumpUnits,newInst"); getErrorString();
instantiateModel(unitCheckTests.UnitCheck9); getErrorString();
// Result:
// true
// ""
// true
// ""
// HashTable:
// {V,{1.0 * m^(2) * s^(-2)}}
// {A,{1.0 * m^(1) * s^(-1)}}
// {S,{1.0 * m^(1) * s^(-1)}}
// {C,{MASTER(C)}}
// {E,{MASTER(E)}}
// {jhagemann,{MASTER()}}
// ######## UnitCheck COMPLETED ########
// "class unitCheckTests.UnitCheck9
// Real V(unit = \"m2/s2\");
// Real A(unit = \"m/s\");
// Real S(unit = \"m/s\");
// Real C = 1.0;
// Real E = 1.0;
// equation
// A = 5.0;
// V = 8.0;
// V = E * C + S * (-A);
// end unitCheckTests.UnitCheck9;
// "
// "Notification: \"A\" has the Unit \"m/s\"
// "
// endResult