Skip to content

Commit

Permalink
actived solveSimpleEquations for simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
vruge authored and OpenModelica-Hudson committed Mar 20, 2016
1 parent c6caa77 commit 473cb9c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Compiler/BackEnd/BackendDAEUtil.mo
Expand Up @@ -7165,6 +7165,7 @@ protected function allPostOptimizationModules
(BackendDAEOptimize.addedScaledVars_inputs, "addScaledVars_inputs"),
(RemoveSimpleEquations.removeSimpleEquations, "removeSimpleEquations"),
(BackendDAEOptimize.simplifyComplexFunction, "simplifyComplexFunction"),
(ExpressionSolve.solveSimpleEquations, "solveSimpleEquations"),
(BackendDAEOptimize.symEuler, "symEuler"),
(ResolveLoops.reshuffling_post, "reshufflePost"),
(DynamicOptimization.reduceDynamicOptimization, "reduceDynamicOptimization"), // before tearing
Expand All @@ -7182,7 +7183,6 @@ protected function allPostOptimizationModules
(SymbolicJacobian.generateSymbolicJacobianPast, "generateSymbolicJacobian"),
(SymbolicJacobian.generateSymbolicLinearizationPast, "generateSymbolicLinearization"),
(BackendDAEOptimize.removeConstants, "removeConstants"),
(ExpressionSolve.solveSimpleEquations, "solveSimpleEquations"),
(BackendDAEOptimize.simplifyTimeIndepFuncCalls, "simplifyTimeIndepFuncCalls"),
(BackendDAEOptimize.simplifyAllExpressions, "simplifyAllExpressions"),
(BackendDAEOptimize.hets, "hets"),
Expand Down
13 changes: 6 additions & 7 deletions Compiler/BackEnd/ExpressionSolve.mo
Expand Up @@ -1065,7 +1065,6 @@ end preprocessingSolve5;
protected function unifyFunCalls
"
e.g.
smooth() -> if
semiLinear() -> if
author: Vitalij Ruge
"
Expand All @@ -1089,15 +1088,15 @@ protected function unifyFunCallsWork
local
DAE.Exp e, e1,e2,e3, X;
DAE.Type tp;

/*
case(DAE.CALL(path = Absyn.IDENT(name = "smooth"), expLst = {_, e}),X)
guard expHasCref(e, X)
then (e, true, iT);
case(DAE.CALL(path = Absyn.IDENT(name = "noEvent"), expLst = {e}),X)
guard expHasCref(e, X)
then (e, true, iT);

*/
case(DAE.CALL(path = Absyn.IDENT(name = "semiLinear"),expLst = {e1, e2, e3}),_)
guard not Expression.isZero(e1)
equation
Expand Down Expand Up @@ -1247,11 +1246,11 @@ algorithm
case (DAE.CALL(path = Absyn.IDENT(name = "semiLinear"),expLst = {DAE.RCONST(real = 0.0), e1, e2}),DAE.RCONST(real = 0.0),_)
then (e1,e2,true);
// smooth(i,f(a)) = rhs -> f(a) = rhs
case (DAE.CALL(path = Absyn.IDENT(name = "smooth"),expLst = {_, e2}),_,_)
then (e2, inExp2, true);
//case (DAE.CALL(path = Absyn.IDENT(name = "smooth"),expLst = {_, e2}),_,_)
// then (e2, inExp2, true);
// noEvent(f(a)) = rhs -> f(a) = rhs
case (DAE.CALL(path = Absyn.IDENT(name = "noEvent"),expLst = {e2}),_,_)
then (e2, inExp2, true);
//case (DAE.CALL(path = Absyn.IDENT(name = "noEvent"),expLst = {e2}),_,_)
// then (e2, inExp2, true);

else (inExp1, inExp2, false);
end matchcontinue;
Expand Down
5 changes: 3 additions & 2 deletions Compiler/BackEnd/SymbolicJacobian.mo
Expand Up @@ -1795,13 +1795,14 @@ algorithm
"evalFunc"},
NONE(),
NONE(),
{"wrapFunctionCalls",
{
"wrapFunctionCalls",
"inlineArrayEqn",
"constantLinearSystem",
"solveSimpleEquations",
"tearingSystem",
"calculateStrongComponentJacobians",
"removeConstants",
"solveSimpleEquations",
"simplifyTimeIndepFuncCalls"});
_ = Flags.set(Flags.EXEC_STAT, b);
if Flags.isSet(Flags.JAC_DUMP) then
Expand Down
1 change: 1 addition & 0 deletions Compiler/Util/Flags.mo
Expand Up @@ -803,6 +803,7 @@ constant ConfigFlag POST_OPT_MODULES = CONFIG_FLAG(16, "postOptModules",
"simplifysemiLinear",
"removeSimpleEquations",
"simplifyComplexFunction",
"solveSimpleEquations",
"tearingSystem",
"inputDerivativesUsed",
"calculateStrongComponentJacobians",
Expand Down

0 comments on commit 473cb9c

Please sign in to comment.