Skip to content

Commit

Permalink
- fix r19111
Browse files Browse the repository at this point in the history
  - get ./simulation/libraries/3rdParty/ThermoSysPro/ThermoSysPro.Examples.SimpleExamples.TestJunctions4.mos working again


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@19123 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
lochel committed Feb 14, 2014
1 parent a862e2f commit 84ce633
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Compiler/FrontEnd/ExpressionSimplify.mo
Expand Up @@ -3998,14 +3998,15 @@ algorithm
false = Expression.isZero(e2);
then res;

case(_,DAE.DIV(ty= tp), e1, DAE.RCONST(real = r1),_,_)
// exp / r = exp * (1/r)
case(_, DAE.DIV(ty=tp), e1, DAE.RCONST(real=r1), _, _)
equation
true = r1 <. 1e12 and r1 >. 1e-20;
true = r1 <. 1e6 and r1 >. 1e-20;
r = 1.0 /. r1;
r1 = 1e6 *. r;
0.0 = realMod(r1, 1.0);
e3 = DAE.BINARY(e1,DAE.MUL(tp),DAE.RCONST(r));
then e3;
then e3;

// -a / -b = a / b
case (_,DAE.DIV(ty = ty),DAE.UNARY(operator = DAE.UMINUS(ty = ty1),exp = e1),DAE.UNARY(operator = DAE.UMINUS(ty = ty2),exp = e2),_,_)
Expand Down

0 comments on commit 84ce633

Please sign in to comment.