@@ -1553,12 +1553,8 @@ algorithm
1553
1553
sampleZC = getSamples(dlow);
1554
1554
zeroCrossings = Util.if_(ifcpp, listAppend(zeroCrossings, sampleZC), zeroCrossings);
1555
1555
1556
- // state set stuff
1557
- tempvars = {};
1558
- (dlow, stateSets, uniqueEqIndex, tempvars, numStateSets) = createStateSets(dlow, {}, uniqueEqIndex, tempvars);
1559
-
1560
1556
// inline solver stuff
1561
- (inlineEquations, uniqueEqIndex, tempvars) = createInlineSolverEqns(inlineDAE, uniqueEqIndex, tempvars );
1557
+ (inlineEquations, uniqueEqIndex, tempvars) = createInlineSolverEqns(inlineDAE, uniqueEqIndex, {} );
1562
1558
1563
1559
// initialization stuff
1564
1560
(residuals, initialEquations, numberOfInitialEquations, numberOfInitialAlgorithms, uniqueEqIndex, tempvars, useSymbolicInitialization) = createInitialResiduals(dlow, initDAE, uniqueEqIndex, tempvars);
@@ -1573,13 +1569,10 @@ algorithm
1573
1569
functionTree=functionTree,
1574
1570
symjacs=symJacs)) = dlow;
1575
1571
1576
- // Add model info
1577
- modelInfo = createModelInfo(class_, dlow, functions, {}, numberOfInitialEquations, numberOfInitialAlgorithms, numStateSets, fileDir, ifcpp);
1578
1572
1579
1573
// equation generation for euler, dassl2, rungekutta
1580
1574
(uniqueEqIndex, odeEquations, algebraicEquations, allEquations, tempvars, equationSccMapping) = createEquationsForSystems(systs, shared, uniqueEqIndex, {}, {}, {}, tempvars, 1, {});
1581
1575
highestSimEqIndex = uniqueEqIndex;
1582
- modelInfo = addTempVars(tempvars, modelInfo);
1583
1576
1584
1577
((uniqueEqIndex, removedEquations)) = BackendEquation.traverseBackendDAEEqns(removedEqs, traversedlowEqToSimEqSystem, (uniqueEqIndex, {}));
1585
1578
@@ -1600,6 +1593,14 @@ algorithm
1600
1593
algebraicEquations = listAppend(algebraicEquations, removedEquations::{});
1601
1594
allEquations = listAppend(allEquations, removedEquations);
1602
1595
1596
+ // state set stuff
1597
+ (dlow, stateSets, uniqueEqIndex, tempvars, numStateSets) = createStateSets(dlow, {}, uniqueEqIndex, tempvars);
1598
+
1599
+ // create model info
1600
+ modelInfo = createModelInfo(class_, dlow, functions, {}, numberOfInitialEquations, numberOfInitialAlgorithms, numStateSets, fileDir, ifcpp);
1601
+ modelInfo = addTempVars(tempvars, modelInfo);
1602
+
1603
+
1603
1604
// update indexNonLinear in SES_NONLINEAR and count
1604
1605
SymbolicJacs = {};
1605
1606
(initialEquations, numberofLinearSys, numberofNonLinearSys, numberofMixedSys, SymbolicJacsTemp) = countandIndexAlgebraicLoops(initialEquations, 0, 0, 0, {});
@@ -1628,7 +1629,8 @@ algorithm
1628
1629
odeEquations = List.mapList1_1(odeEquations, setSystemIndexMap, systemIndexMap);
1629
1630
algebraicEquations = List.mapList1_1(algebraicEquations, setSystemIndexMap, systemIndexMap);
1630
1631
numberofEqns = uniqueEqIndex; /* This is a *much* better estimate than the guessed number of equations */
1631
-
1632
+
1633
+ // create model info
1632
1634
modelInfo = addNumEqnsandNumofSystems(modelInfo, numberofEqns, numberofLinearSys, numberofNonLinearSys, numberofMixedSys);
1633
1635
1634
1636
// replace div operator with div operator with check of Division by zero
0 commit comments