@@ -2123,6 +2123,8 @@ algorithm
21232123 BackendDAE . EqSystem syst;
21242124 BackendDAE . EqSystems systs;
21252125 BackendDAE . Shared shared ;
2126+ BackendDAE . EquationArray removedEqs;
2127+ array< DAE . Algorithm > algs;
21262128
21272129 case (functionTree,dlow,class_,filenamePrefix,fileDir,functions,externalFunctionIncludes,includeDirs,libs,simSettingsOpt,recordDecls,literals)
21282130 equation
@@ -2131,7 +2133,7 @@ algorithm
21312133 cname = Absyn . pathStringNoQual(class_);
21322134
21332135 (helpVarInfo,dlow2,sampleEqns) = generateHelpVarInfo(dlow);
2134- (dlow2 as BackendDAE . DAE (systs,shared )) = BackendDAEUtil . checkInitialSystem(dlow2,functionTree);
2136+ (dlow2 as BackendDAE . DAE (systs,shared as BackendDAE . SHARED (removedEqs = removedEqs,algorithms = algs) )) = BackendDAEUtil . checkInitialSystem(dlow2,functionTree);
21352137
21362138 residualEquations = createResidualEquations(dlow2);
21372139 nres = listLength(residualEquations);
@@ -2154,6 +2156,8 @@ algorithm
21542156 initialEquations = BackendDAEUtil . foldEqSystem(dlow2,createInitialEquations,{});
21552157 parameterEquations = BackendDAEUtil . foldEqSystem(dlow2,createParameterEquations,{});
21562158 removedEquations = BackendDAEUtil . foldEqSystem(dlow2,createRemovedEquations,{});
2159+ ((removedEquations,_)) = BackendEquation . traverseBackendDAEEqns(removedEqs,traversedlowEqToSimEqSystem,(removedEquations,algs));
2160+
21572161 algorithmAndEquationAsserts = BackendDAEUtil . foldEqSystem(dlow2,createAlgorithmAndEquationAsserts,{});
21582162 discreteModelVars = BackendDAEUtil . foldEqSystem(dlow2,extractDiscreteModelVars,{});
21592163 makefileParams = createMakefileParams(externalFunctionIncludes,libs);
@@ -3324,14 +3328,12 @@ algorithm
33243328
33253329 case (BackendDAE . EQSYSTEM (orderedVars = vars), BackendDAE . SHARED (removedEqs= r,algorithms= algs), acc)
33263330 equation
3327- ((removedEquations,_)) = BackendEquation . traverseBackendDAEEqns(r,traversedlowEqToSimEqSystem,({},algs));
3328-
33293331 // get minmax and nominal asserts
33303332 varasserts = BackendVariable . traverseBackendDAEVars(vars,createVarMinMaxAssert,{});
33313333 simvarasserts = List . map(varasserts,dlowAlgToSimEqSystem);
3332- removedEquations = listAppend(removedEquations, simvarasserts);
3334+ removedEquations = listAppend(simvarasserts,acc );
33333335
3334- then listAppend( removedEquations,acc) ;
3336+ then removedEquations;
33353337 else
33363338 equation
33373339 Error . addMessage(Error . INTERNAL_ERROR ,{"createRemovedEquations failed" });
0 commit comments