Skip to content

Commit e647134

Browse files
kabdelhakadrpo
authored andcommitted
[SimCode] update linearize
- linearizing a system provides information about states, inputs and outputs - ticket #5927 [testsuite] update
1 parent 97aec02 commit e647134

26 files changed

+217
-50
lines changed

OMCompiler/Compiler/SimCode/SimCode.mo

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,9 @@ uniontype ModelInfo "Container for metadata about a Modelica model."
211211
record MODELINFO
212212
Absyn.Path name;
213213
String description;
214+
String stateInfo;
215+
String inputInfo;
216+
String outputInfo;
214217
String directory;
215218
VarInfo varInfo;
216219
SimCodeVar.SimVars vars;

OMCompiler/Compiler/SimCode/SimCodeUtil.mo

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7211,7 +7211,7 @@ public function createModelInfo
72117211
input list<SimCodeVar.SimVar> tempVars;
72127212
output SimCode.ModelInfo modelInfo;
72137213
protected
7214-
String description, directory;
7214+
String description, directory, stateInfo = "", inputInfo = "", outputInfo = "";
72157215
SimCode.VarInfo varInfo;
72167216
SimCodeVar.SimVars vars;
72177217
Integer nx, ny, ndy, np, na, next, numOutVars, numInVars, ny_int, np_int, na_int, ny_bool, np_bool, dim_1, dim_2, numOptimizeConstraints, numOptimizeFinalConstraints;
@@ -7226,6 +7226,13 @@ algorithm
72267226
directory := System.trim(fileDir, "\"");
72277227
vars := createVars(dlow, inInitDAE, tempVars);
72287228

7229+
// Somehow this flag is not always active when needed...
7230+
//if Flags.getConfigBool(Flags.GENERATE_SYMBOLIC_LINEARIZATION) then
7231+
stateInfo := createInfoString(vars.stateVars, "states");
7232+
inputInfo := createInfoString(vars.inputVars, "inputs");
7233+
outputInfo := createInfoString(vars.outputVars, "outputs");
7234+
//end if;
7235+
72297236
if debug then execStat("simCode: createVars"); end if;
72307237
BackendDAE.DAE(shared=BackendDAE.SHARED(info=BackendDAE.EXTRA_INFO(description=description))) := dlow;
72317238
nx := getNumScalars(vars.stateVars);
@@ -7254,8 +7261,8 @@ algorithm
72547261
if debug then execStat("simCode: createVarInfo"); end if;
72557262
hasLargeEqSystems := hasLargeEquationSystems(dlow, inInitDAE);
72567263
if debug then execStat("simCode: hasLargeEquationSystems"); end if;
7257-
modelInfo := SimCode.MODELINFO(class_, dlow.shared.info.description, directory, varInfo, vars, functions,
7258-
labels,
7264+
modelInfo := SimCode.MODELINFO(class_, dlow.shared.info.description, stateInfo, inputInfo, outputInfo,
7265+
directory, varInfo, vars, functions, labels,
72597266
if Flags.getConfigBool(Flags.BUILDING_FMU) then getResources(program.classes, dlow, inInitDAE) else {},
72607267
List.sort(program.classes, AbsynUtil.classNameGreater),
72617268
arrayLength(dlow.shared.partitionsInfo.basePartitions),
@@ -8211,7 +8218,6 @@ algorithm
82118218
end match;
82128219
end simVarString;
82138220

8214-
82158221
protected function printVarIndx
82168222
input Option<Integer> i;
82178223
output String s;
@@ -8234,7 +8240,6 @@ algorithm
82348240
end if;
82358241
end dumpVarLst;
82368242

8237-
82388243
public function printVarLstCrefs
82398244
input list<SimCodeVar.SimVar> inVars;
82408245
output String str;
@@ -8249,6 +8254,29 @@ algorithm
82498254
end for;
82508255
end printVarLstCrefs;
82518256

8257+
public function createInfoString
8258+
input list<SimCodeVar.SimVar> inVars;
8259+
input String name;
8260+
output String str = "";
8261+
protected
8262+
SimCodeVar.SimVar var;
8263+
list<SimCodeVar.SimVar> rest;
8264+
DAE.ComponentRef cref;
8265+
algorithm
8266+
str := name + "[" + intString(listLength(inVars))+ "] = [";
8267+
try
8268+
var :: rest := inVars;
8269+
SimCodeVar.SIMVAR(name= cref) := var;
8270+
str := str + ComponentReference.printComponentRefStr(cref);
8271+
for var in rest loop
8272+
SimCodeVar.SIMVAR(name= cref) := var;
8273+
str := str + ", " + ComponentReference.printComponentRefStr(cref);
8274+
end for;
8275+
else
8276+
end try;
8277+
str := str + "]";
8278+
end createInfoString;
8279+
82528280
protected function dumpVariablesString "dumps a list of SimCode.Variables to stdout.
82538281
author: Waurich TUD 2014-09"
82548282
input list<SimCodeFunction.Variable> vars;

OMCompiler/Compiler/Template/CodegenC.tpl

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4619,7 +4619,7 @@ template functionlinearmodel(ModelInfo modelInfo, String modelNamePrefix) "templ
46194619
Generates function in simulation file."
46204620
::=
46214621
match modelInfo
4622-
case MODELINFO(varInfo=VARINFO(__), vars=SIMVARS(__)) then
4622+
case MODELINFO(stateInfo=stateInfo, inputInfo=inputInfo, outputInfo=outputInfo, varInfo=VARINFO(__), vars=SIMVARS(__)) then
46234623
let matrixA = genMatrix("A", "n", "n", varInfo.numStateVars, varInfo.numStateVars)
46244624
let matrixB = genMatrix("B", "n", "p", varInfo.numStateVars, varInfo.numInVars)
46254625
let matrixC = genMatrix("C", "q", "n", varInfo.numOutVars, varInfo.numStateVars)
@@ -4634,7 +4634,12 @@ template functionlinearmodel(ModelInfo modelInfo, String modelNamePrefix) "templ
46344634
<<
46354635
const char *<%symbolName(modelNamePrefix,"linear_model_frame")%>()
46364636
{
4637-
return "model linear_<%underscorePath(name)%>\n parameter Integer n = <%varInfo.numStateVars%> \"number of states\";\n parameter Integer p = <%varInfo.numInVars%> \"number of inputs\";\n parameter Integer q = <%varInfo.numOutVars%> \"number of outputs\";\n"
4637+
return ""
4638+
"model linear_<%underscorePath(name)%> \"\n"
4639+
" <%stateInfo%>\n"
4640+
" <%inputInfo%>\n"
4641+
" <%outputInfo%>\"\n"
4642+
" parameter Integer n = <%varInfo.numStateVars%> \"number of states\";\n parameter Integer p = <%varInfo.numInVars%> \"number of inputs\";\n parameter Integer q = <%varInfo.numOutVars%> \"number of outputs\";\n"
46384643
"\n"
46394644
" parameter Real x0[n] = %s;\n"
46404645
" parameter Real u0[p] = %s;\n"
@@ -4655,7 +4660,12 @@ template functionlinearmodel(ModelInfo modelInfo, String modelNamePrefix) "templ
46554660
}
46564661
const char *<%symbolName(modelNamePrefix,"linear_model_datarecovery_frame")%>()
46574662
{
4658-
return "model linear_<%underscorePath(name)%>\n parameter Integer n = <%varInfo.numStateVars%> \"number of states\";\n parameter Integer p = <%varInfo.numInVars%> \"number of inputs\";\n parameter Integer q = <%varInfo.numOutVars%> \"number of outputs\";\n parameter Integer nz = <%varInfo.numAlgVars%> \"data recovery variables\";\n"
4663+
return ""
4664+
"model linear_<%underscorePath(name)%> \"\n"
4665+
" <%stateInfo%>\n"
4666+
" <%inputInfo%>\n"
4667+
" <%outputInfo%>\"\n"
4668+
" parameter Integer n = <%varInfo.numStateVars%> \"number of states\";\n parameter Integer p = <%varInfo.numInVars%> \"number of inputs\";\n parameter Integer q = <%varInfo.numOutVars%> \"number of outputs\";\n parameter Integer nz = <%varInfo.numAlgVars%> \"data recovery variables\";\n"
46594669
"\n"
46604670
" parameter Real x0[<%varInfo.numStateVars%>] = %s;\n"
46614671
" parameter Real u0[<%varInfo.numInVars%>] = %s;\n"

OMCompiler/Compiler/Template/SimCodeTV.mo

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,9 @@ package SimCode
687687
record MODELINFO
688688
Absyn.Path name;
689689
String description;
690+
String stateInfo;
691+
String inputInfo;
692+
String outputInfo;
690693
String directory;
691694
VarInfo varInfo;
692695
SimCodeVar.SimVars vars;

testsuite/openmodelica/linearization/linmodel.mos

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ readFile("linear_linearmodel.log"); // Check that output log is empty
4747
// "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").
4848
// "
4949
// true
50-
// "model linear_linearmodel
50+
// "model linear_linearmodel \"
51+
// states[4] = [x1, x2, x3, x4]
52+
// inputs[0] = []
53+
// outputs[0] = []\"
5154
// parameter Integer n = 4 \"number of states\";
5255
// parameter Integer p = 0 \"number of inputs\";
5356
// parameter Integer q = 0 \"number of outputs\";
@@ -94,7 +97,10 @@ readFile("linear_linearmodel.log"); // Check that output log is empty
9497
// "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").
9598
// "
9699
// true
97-
// "model linear_linearmodel
100+
// "model linear_linearmodel \"
101+
// states[4] = [x1, x2, x3, x4]
102+
// inputs[0] = []
103+
// outputs[0] = []\"
98104
// parameter Integer n = 4 \"number of states\";
99105
// parameter Integer p = 0 \"number of inputs\";
100106
// parameter Integer q = 0 \"number of outputs\";

testsuite/openmodelica/linearization/simLotkaVolterra.mos

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ readFile("linear_LotkaVolterra.log"); // Check that output log is empty
4747
// "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").
4848
// "
4949
// true
50-
// "model linear_LotkaVolterra
50+
// "model linear_LotkaVolterra \"
51+
// states[2] = [x, y]
52+
// inputs[0] = []
53+
// outputs[0] = []\"
5154
// parameter Integer n = 2 \"number of states\";
5255
// parameter Integer p = 0 \"number of inputs\";
5356
// parameter Integer q = 0 \"number of outputs\";
@@ -92,7 +95,10 @@ readFile("linear_LotkaVolterra.log"); // Check that output log is empty
9295
// "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").
9396
// "
9497
// true
95-
// "model linear_LotkaVolterra
98+
// "model linear_LotkaVolterra \"
99+
// states[2] = [x, y]
100+
// inputs[0] = []
101+
// outputs[0] = []\"
96102
// parameter Integer n = 2 \"number of states\";
97103
// parameter Integer p = 0 \"number of inputs\";
98104
// parameter Integer q = 0 \"number of outputs\";

testsuite/openmodelica/linearization/simNonlinear.mos

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ readFile("linear_p_nonlinsys.log"); // Check that output log is empty
4848
// "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").
4949
// "
5050
// true
51-
// "model linear_p_nonlinsys
51+
// "model linear_p_nonlinsys \"
52+
// states[3] = [b1.x, c1.x1, c1.x2]
53+
// inputs[1] = [u1]
54+
// outputs[2] = [y1, y2]\"
5255
// parameter Integer n = 3 \"number of states\";
5356
// parameter Integer p = 1 \"number of inputs\";
5457
// parameter Integer q = 2 \"number of outputs\";
@@ -97,7 +100,10 @@ readFile("linear_p_nonlinsys.log"); // Check that output log is empty
97100
// "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").
98101
// "
99102
// true
100-
// "model linear_p_nonlinsys
103+
// "model linear_p_nonlinsys \"
104+
// states[3] = [b1.x, c1.x1, c1.x2]
105+
// inputs[1] = [u1]
106+
// outputs[2] = [y1, y2]\"
101107
// parameter Integer n = 3 \"number of states\";
102108
// parameter Integer p = 1 \"number of inputs\";
103109
// parameter Integer q = 2 \"number of outputs\";

testsuite/openmodelica/linearization/simTwoTank.mos

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ readFile("linear_twoflattankmodel.log"); // Check that output log is empty
4848
// "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").
4949
// "
5050
// true
51-
// "model linear_twoflattankmodel
51+
// "model linear_twoflattankmodel \"
52+
// states[2] = [h1, h2]
53+
// inputs[1] = [F]
54+
// outputs[1] = [F2]\"
5255
// parameter Integer n = 2 \"number of states\";
5356
// parameter Integer p = 1 \"number of inputs\";
5457
// parameter Integer q = 1 \"number of outputs\";
@@ -95,7 +98,10 @@ readFile("linear_twoflattankmodel.log"); // Check that output log is empty
9598
// "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").
9699
// "
97100
// true
98-
// "model linear_twoflattankmodel
101+
// "model linear_twoflattankmodel \"
102+
// states[2] = [h1, h2]
103+
// inputs[1] = [F]
104+
// outputs[1] = [F2]\"
99105
// parameter Integer n = 2 \"number of states\";
100106
// parameter Integer p = 1 \"number of inputs\";
101107
// parameter Integer q = 1 \"number of outputs\";

testsuite/openmodelica/linearization/simVanDerPol.mos

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ readFile("linear_VanDerPol.log"); // Check that output log is empty
4242
// "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").
4343
// "
4444
// true
45-
// "model linear_VanDerPol
45+
// "model linear_VanDerPol \"
46+
// states[2] = [x, y]
47+
// inputs[0] = []
48+
// outputs[0] = []\"
4649
// parameter Integer n = 2 \"number of states\";
4750
// parameter Integer p = 0 \"number of inputs\";
4851
// parameter Integer q = 0 \"number of outputs\";
@@ -92,7 +95,10 @@ readFile("linear_VanDerPol.log"); // Check that output log is empty
9295
// "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").
9396
// "
9497
// true
95-
// "model linear_VanDerPol
98+
// "model linear_VanDerPol \"
99+
// states[2] = [x, y]
100+
// inputs[0] = []
101+
// outputs[0] = []\"
96102
// parameter Integer n = 2 \"number of states\";
97103
// parameter Integer p = 0 \"number of inputs\";
98104
// parameter Integer q = 0 \"number of outputs\";

testsuite/openmodelica/linearization/simextfunction.mos

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ readFile("linear_extfunction.log"); // Check that output log is empty
7070
// "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").
7171
// "
7272
// true
73-
// "model linear_extfunction
73+
// "model linear_extfunction \"
74+
// states[2] = [x, y]
75+
// inputs[0] = []
76+
// outputs[0] = []\"
7477
// parameter Integer n = 2 \"number of states\";
7578
// parameter Integer p = 0 \"number of inputs\";
7679
// parameter Integer q = 0 \"number of outputs\";
@@ -123,7 +126,10 @@ readFile("linear_extfunction.log"); // Check that output log is empty
123126
// "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").
124127
// "
125128
// true
126-
// "model linear_extfunction
129+
// "model linear_extfunction \"
130+
// states[2] = [x, y]
131+
// inputs[0] = []
132+
// outputs[0] = []\"
127133
// parameter Integer n = 2 \"number of states\";
128134
// parameter Integer p = 0 \"number of inputs\";
129135
// parameter Integer q = 0 \"number of outputs\";
@@ -176,7 +182,10 @@ readFile("linear_extfunction.log"); // Check that output log is empty
176182
// "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").
177183
// "
178184
// true
179-
// "model linear_extfunction
185+
// "model linear_extfunction \"
186+
// states[2] = [x, y]
187+
// inputs[0] = []
188+
// outputs[0] = []\"
180189
// parameter Integer n = 2 \"number of states\";
181190
// parameter Integer p = 0 \"number of inputs\";
182191
// parameter Integer q = 0 \"number of outputs\";
@@ -221,7 +230,10 @@ readFile("linear_extfunction.log"); // Check that output log is empty
221230
// "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").
222231
// "
223232
// true
224-
// "model linear_extfunction
233+
// "model linear_extfunction \"
234+
// states[2] = [x, y]
235+
// inputs[0] = []
236+
// outputs[0] = []\"
225237
// parameter Integer n = 2 \"number of states\";
226238
// parameter Integer p = 0 \"number of inputs\";
227239
// parameter Integer q = 0 \"number of outputs\";

testsuite/openmodelica/linearization/smallValues.mos

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ readFile("linear_VanDerPolSmallValue.log"); // Check that output log is empty
4747
// "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").
4848
// "
4949
// true
50-
// "model linear_VanDerPolSmallValue
50+
// "model linear_VanDerPolSmallValue \"
51+
// states[2] = [x, y]
52+
// inputs[0] = []
53+
// outputs[0] = []\"
5154
// parameter Integer n = 2 \"number of states\";
5255
// parameter Integer p = 0 \"number of inputs\";
5356
// parameter Integer q = 0 \"number of outputs\";
@@ -92,7 +95,10 @@ readFile("linear_VanDerPolSmallValue.log"); // Check that output log is empty
9295
// "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").
9396
// "
9497
// true
95-
// "model linear_VanDerPolSmallValue
98+
// "model linear_VanDerPolSmallValue \"
99+
// states[2] = [x, y]
100+
// inputs[0] = []
101+
// outputs[0] = []\"
96102
// parameter Integer n = 2 \"number of states\";
97103
// parameter Integer p = 0 \"number of inputs\";
98104
// parameter Integer q = 0 \"number of outputs\";

testsuite/openmodelica/linearization/testArrayAlg.mos

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ getErrorString();
5454
// end SimulationResult;
5555
// ""
5656
// true
57-
// "model linear_ticket4545_Test__vector
57+
// "model linear_ticket4545_Test__vector \"
58+
// states[2] = [x[1], x[2]]
59+
// inputs[0] = []
60+
// outputs[0] = []\"
5861
// parameter Integer n = 2 \"number of states\";
5962
// parameter Integer p = 0 \"number of inputs\";
6063
// parameter Integer q = 0 \"number of outputs\";

testsuite/openmodelica/linearization/testDrumBoiler.mos

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,17 @@ list(linear_testDrumBoilerLin);
3535
// "Warning: The model contains alias variables with conflicting start and/or nominal values. It is recommended to resolve the conflicts, because otherwise the system could be hard to solve. To print the conflicting alias sets and the chosen candidates please use -d=aliasConflicts.
3636
// "
3737
// true
38-
// "model linear_testDrumBoilerLin
38+
// "model linear_testDrumBoilerLin \"
39+
// states[3] = [controller.x, evaporator.V_l, evaporator.p]
40+
// inputs[2] = [Y_Valve, q_F]
41+
// outputs[4] = [T_S, V_l, p_S, qm_S]\"
3942
// parameter Integer n = 3 \"number of states\";
4043
// parameter Integer p = 2 \"number of inputs\";
4144
// parameter Integer q = 4 \"number of outputs\";
4245
// parameter Real x0[n] = {0, 67, 100000};
4346
// parameter Real u0[p] = {0, 0};
4447
// parameter Real A[n, n] = [-0, -0.008333333333333333, -0; 0.01043953430921842, -0.01043953430921842, 0; 0.1178989396709848, -0.1178989396709848, 4.135580766728708e-15];
45-
// parameter Real B[n, p] = [0, 0; -0.001308242749261165, 0.0001170710024614632; -19.14622757506175, 8.475892309753029];
48+
// parameter Real B[n, p] = [0, 0; -0.001308242749261165, 0.0001170710024614629; -19.14622757506173, 8.475892309753018];
4649
// parameter Real C[q, n] = [0, 0, 0.0001439468903880623; 0, 1, 0; 0, 0, 1e-05; 0, 0, 0];
4750
// parameter Real D[q, p] = [0, 0; 0, 0; 0, 0; 1, 0];
4851
// Real x[n](start = x0);

testsuite/openmodelica/linearization/testMathFuncs.mos

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ readFile("linear_mathFuncsTest.log"); // Check that output log is empty
5959
// "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").
6060
// "
6161
// true
62-
// "model linear_mathFuncsTest
62+
// "model linear_mathFuncsTest \"
63+
// states[2] = [x, y]
64+
// inputs[0] = []
65+
// outputs[6] = [r1, r2, r3, r4, r5, r6]\"
6366
// parameter Integer n = 2 \"number of states\";
6467
// parameter Integer p = 0 \"number of inputs\";
6568
// parameter Integer q = 6 \"number of outputs\";
@@ -123,7 +126,10 @@ readFile("linear_mathFuncsTest.log"); // Check that output log is empty
123126
// "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").
124127
// "
125128
// true
126-
// "model linear_mathFuncsTest
129+
// "model linear_mathFuncsTest \"
130+
// states[2] = [x, y]
131+
// inputs[0] = []
132+
// outputs[6] = [r1, r2, r3, r4, r5, r6]\"
127133
// parameter Integer n = 2 \"number of states\";
128134
// parameter Integer p = 0 \"number of inputs\";
129135
// parameter Integer q = 6 \"number of outputs\";

testsuite/openmodelica/linearization/testRecordDiff.mos

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ list(linear_recordDiffTest);
5959
// "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").
6060
// "
6161
// true
62-
// "model linear_recordDiffTest
62+
// "model linear_recordDiffTest \"
63+
// states[1] = [x]
64+
// inputs[0] = []
65+
// outputs[1] = [o]\"
6366
// parameter Integer n = 1 \"number of states\";
6467
// parameter Integer p = 0 \"number of inputs\";
6568
// parameter Integer q = 1 \"number of outputs\";

0 commit comments

Comments
 (0)