Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit bf562e7

Browse files
Willi BraunOpenModelica-Hudson
authored andcommitted
[DAEmode] don't not put JacobianEqns into json
- makes json file parseable Belonging to [master]: - #2256
1 parent ad854a6 commit bf562e7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Compiler/SimCode/SimCodeMain.mo

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,7 +1153,6 @@ algorithm
11531153
(uniqueEqIndex, parameterEquations, _) := SimCodeUtil.createParameterEquations(uniqueEqIndex, parameterEquations, inBackendDAE.shared.globalKnownVars);
11541154
if debug then ExecStat.execStat("simCode: createParameterEquations"); end if;
11551155

1156-
(uniqueEqIndex, removedEquations) := BackendEquation.traverseEquationArray(BackendDAEUtil.collapseRemovedEqs(inBackendDAE), SimCodeUtil.traversedlowEqToSimEqSystem, (uniqueEqIndex, {}));
11571156
discreteModelVars := BackendDAEUtil.foldEqSystem(inBackendDAE, SimCodeUtil.extractDiscreteModelVars, {});
11581157

11591158
//prepare DAEmode stuff
@@ -1164,6 +1163,8 @@ algorithm
11641163
// create SimCode residual equation
11651164
(daeEquations, uniqueEqIndex, tempVars) := SimCodeUtil.createEquationsfromList(listReverse(eqnsLst), varsLst, false, uniqueEqIndex, tempVars, inBackendDAE.shared.info);
11661165

1166+
(uniqueEqIndex, removedEquations) := BackendEquation.traverseEquationArray(BackendDAEUtil.collapseRemovedEqs(inBackendDAE), SimCodeUtil.traversedlowEqToSimEqSystem, (uniqueEqIndex, {}));
1167+
daeEquations := listAppend(daeEquations, removedEquations);
11671168
// state set stuff
11681169
(_, stateSets, uniqueEqIndex, tempVars, numStateSets) := SimCodeUtil.createStateSets(inBackendDAE, {}, uniqueEqIndex, tempVars);
11691170
if debug then ExecStat.execStat("simCode: createStateSets"); end if;
@@ -1239,7 +1240,7 @@ algorithm
12391240
daeModeData := SOME(SimCode.DAEMODEDATA({daeEquations}, daeModeSP, residualVars, algebraicStateVars, auxiliaryVars, daeModeConf));
12401241

12411242
/* This is a *much* better estimate than the guessed number of equations */
1242-
modelInfo := SimCodeUtil.addNumEqns(modelInfo, uniqueEqIndex);
1243+
modelInfo := SimCodeUtil.addNumEqns(modelInfo, uniqueEqIndex-listLength(jacobianEquations));
12431244

12441245
// update hash table
12451246
crefToSimVarHT := SimCodeUtil.createCrefToSimVarHT(modelInfo);
@@ -1264,7 +1265,7 @@ algorithm
12641265
removedEquations,
12651266
{},
12661267
{},
1267-
jacobianEquations,
1268+
{},
12681269
stateSets,
12691270
{},
12701271
{},

0 commit comments

Comments
 (0)