Skip to content

Commit

Permalink
- fixes for symbolic jacobians
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@18309 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Willi Braun committed Nov 26, 2013
1 parent 0ebd1f9 commit 4f92095
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
8 changes: 5 additions & 3 deletions Compiler/BackEnd/BackendDAEOptimize.mo
Expand Up @@ -3460,9 +3460,11 @@ algorithm
comref_diffvars = List.map(diffVars, BackendVariable.varCref);
assLst = arrayList(ass2);
diffData = BackendDAE.DIFFINPUTDATA(SOME(diffVarsArr), SOME(diffedVars), SOME(knownVars), SOME(orderedVars), SOME({}), SOME(comref_diffvars), SOME(matrixName));
eqns = BackendEquation.equationList(orderedEqs);
(derivedEquations, functions) = deriveAll(BackendEquation.equationList(orderedEqs), arrayList(ass2), x, diffData, {}, functions);
//derivedEquations = List.flatten(derivedEquationslst);
eqns = BackendEquation.equationList(orderedEqs);
(derivedEquations, functions) = deriveAll(eqns, arrayList(ass2), x, diffData, {}, functions);

// replace all der(x), since ExpressionSolve can't handle der(x) proper
derivedEquations = BackendDAETransform.replaceDerOpInEquationList(derivedEquations);
Debug.fcall(Flags.JAC_DUMP2, print, "*** analytical Jacobians -> created all derived equation time: " +& realString(clock()) +& "\n");

// create BackendDAE.DAE with derivied vars and equations
Expand Down
2 changes: 1 addition & 1 deletion Compiler/BackEnd/BackendDAETransform.mo
Expand Up @@ -593,7 +593,7 @@ algorithm
end match;
end transformXToXd;

protected function replaceDerOpInEquationList
public function replaceDerOpInEquationList
"Replaces all der(cref) with $DER.cref in a list of equations."
input list<BackendDAE.Equation> inEqns;
output list<BackendDAE.Equation> outEqns;
Expand Down
4 changes: 3 additions & 1 deletion Compiler/BackEnd/SimCodeUtil.mo
Expand Up @@ -5177,11 +5177,13 @@ algorithm
vars = BackendVariable.listVar1(diffedVars);
columnVars = creatallDiffedVars(alldiffedVars, x, vars, 0, (name, false), {});

/*
knvars = BackendVariable.daeKnVars(shared);
empty = BackendVariable.emptyVars();
((columnVarsKn, _)) = BackendVariable.traverseBackendDAEVars(knvars, traversingdlowvarToSimvar, ({}, empty));
columnVars = listAppend(columnVars, columnVarsKn);
columnVars = List.unique(columnVars, columnVarsKn);
columnVars = listReverse(columnVars);
*/

Debug.fcall(Flags.JAC_DUMP2, print, "analytical Jacobians -> create all SimCode vars for Matrix " +& name +& " time: " +& realString(clock()) +& "\n");

Expand Down

0 comments on commit 4f92095

Please sign in to comment.