Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit 33b800d

Browse files
vrugeOpenModelica-Hudson
authored andcommitted
[BE] fixes for inStream
see: https://trac.openmodelica.org/OpenModelica/ticket/5104#comment:6 Belonging to [master]: - #2626
1 parent 67189f3 commit 33b800d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Compiler/BackEnd/BackendDAEOptimize.mo

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,14 @@ protected function simplifyInStreamWork
140140
output list<BackendDAE.Variables> outVars = inVars;
141141
algorithm
142142
outExp := Expression.traverseExpBottomUp(inExp, simplifyInStreamWork2, outVars);
143+
144+
// with #5104 we remove max(x, eps)
145+
// so in case max(x,eps)*y/max(x,eps) => x*y/x
146+
// now x can be equal 0, so we need simplify x*y/x = y
147+
// it's seem no other models silplyfied it
148+
if not Expression.expEqual(outExp, inExp) then
149+
outExp := ExpressionSimplify.simplify(outExp);
150+
end if;
143151
end simplifyInStreamWork;
144152

145153
protected function simplifyInStreamWork2

0 commit comments

Comments
 (0)