-
Notifications
You must be signed in to change notification settings - Fork 298
/
UnitCheck15.mos
52 lines (47 loc) · 2.08 KB
/
UnitCheck15.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
// name: UnitCheck15
// status: correct
loadString("
package unitCheckTests
model UnitCheck15
package Units
type AmountOfSubstance = Real(final quantity = \"AmountOfSubstance\", final unit = \"mmol\", min = 0);
type XXUnit = Real(final quantity = \"XXUnit\", final unit = \"mmol-1\", min = 0);
type MolarFlowRate = Real(final quantity = \"MolarFlowRate\", final unit = \"mmol/min\");
end Units;
parameter Units.MolarFlowRate v_18f = 1.0;
parameter Units.MolarFlowRate v_18r = 1.0;
parameter Units.AmountOfSubstance K_18ICIT = 1.0;
parameter Real K_18eq(unit = \"1\") = 1.0;
Units.AmountOfSubstance ICIT = 2, alphaKG = 3;
Units.MolarFlowRate v = v_18f * v_18r * (ICIT - alphaKG / K_18eq) / (K_18ICIT * v_18r + v_18r * ICIT + v_18f * alphaKG / K_18eq);
end UnitCheck15;
end unitCheckTests;
"); getErrorString();
setCommandLineOptions("--unitChecking -d=dumpUnits,newInst"); getErrorString();
instantiateModel(unitCheckTests.UnitCheck15); getErrorString();
// Result:
// true
// ""
// true
// ""
// HashTable:
// {v_18f,{1.666666666666667e-05 * mol^(1) * s^(-1)}}
// {v_18r,{1.666666666666667e-05 * mol^(1) * s^(-1)}}
// {K_18ICIT,{0.001 * mol^(1)}}
// {K_18eq,{1.0 * 1}}
// {ICIT,{0.001 * mol^(1)}}
// {alphaKG,{0.001 * mol^(1)}}
// {v,{1.666666666666667e-05 * mol^(1) * s^(-1)}}
// ######## UnitCheck COMPLETED ########
// "class unitCheckTests.UnitCheck15
// parameter Real v_18f(quantity = \"MolarFlowRate\", unit = \"mmol/min\") = 1.0;
// parameter Real v_18r(quantity = \"MolarFlowRate\", unit = \"mmol/min\") = 1.0;
// parameter Real K_18ICIT(quantity = \"AmountOfSubstance\", unit = \"mmol\", min = 0.0) = 1.0;
// parameter Real K_18eq(unit = \"1\") = 1.0;
// Real ICIT(quantity = \"AmountOfSubstance\", unit = \"mmol\", min = 0.0) = 2.0;
// Real alphaKG(quantity = \"AmountOfSubstance\", unit = \"mmol\", min = 0.0) = 3.0;
// Real v(quantity = \"MolarFlowRate\", unit = \"mmol/min\") = v_18f * v_18r * (ICIT - alphaKG / K_18eq) / (K_18ICIT * v_18r + v_18r * ICIT + v_18f * alphaKG / K_18eq);
// end unitCheckTests.UnitCheck15;
// "
// ""
// endResult