@@ -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