Skip to content

Commit

Permalink
remove initial algorithms from initial equations (they are called in…
Browse files Browse the repository at this point in the history
… bound parameter equations), I have no clue what the reason is but is was done before also, maybe Lennart know the reason

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@13668 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Jens Frenkel committed Oct 28, 2012
1 parent 4f42fb0 commit e32c64f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Compiler/BackEnd/BackendEquation.mo
Expand Up @@ -2208,4 +2208,14 @@ algorithm
end match;
end isArrayEquation;

public function isNotAlgorithm
input BackendDAE.Equation inEqn;
output Boolean b;
algorithm
b := match(inEqn)
case BackendDAE.ALGORITHM(source=_) then false;
else then true;
end match;
end isNotAlgorithm;

end BackendEquation;
5 changes: 4 additions & 1 deletion Compiler/BackEnd/SimCodeUtil.mo
Expand Up @@ -6307,8 +6307,11 @@ algorithm
case(BackendDAE.DAE(eqs=eqs, shared=BackendDAE.SHARED(initialEqs=initialEqs)),_,_)
equation
// initial_equation
numberOfInitialEquations = BackendDAEUtil.equationSize(initialEqs);
//numberOfInitialEquations = BackendDAEUtil.equationSize(initialEqs);
initialEqs_lst = BackendDAEUtil.equationList(initialEqs);
// remove algorithms, I have no clue what the reason is but is was done before also
initialEqs_lst = List.select(initialEqs_lst,BackendEquation.isNotAlgorithm);
numberOfInitialEquations = BackendEquation.equationLstSize(initialEqs_lst);
(residual_equations,uniqueEqIndex,tempvars) = createNonlinearResidualEquations(initialEqs_lst, iuniqueEqIndex, itempvars);

// [orderedVars] with start-values and fixed=true
Expand Down

0 comments on commit e32c64f

Please sign in to comment.