Skip to content

Commit

Permalink
- BackendDAEOptimize.mo
Browse files Browse the repository at this point in the history
  - use not "a = der(b), a not state" case for simpleEquation because this leads to problems in the removed equations
Example model Modelica.Mechanics.Translational.Examples.Damper :
5 : $DER.mass1.v := $DER.$DER.mass1.s
6 : mass1.a := $DER.mass1.v
- update test because of this

- ExpressionSimplify.mo
  - add case for asub with more than one subscribt, simplify the expression from ASUB
- simulate-msl31-examples.mos
  - update comments from some models, now all models generates compileable code, only EnginveV6 should is not testes because compiling of 107 MB files are very time intensive


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@7344 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Jens Frenkel committed Dec 10, 2010
1 parent 08a52f8 commit b77bf00
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 0 additions & 7 deletions Compiler/BackendDAEOptimize.mo
Expand Up @@ -606,13 +606,6 @@ algorithm
true = RTOpts.eliminationLevel() > 1;
true = Expression.isConst(e);
then (e1,DAE.UNARY(DAE.UMINUS_ARR(t),e),src);

// a = der(b), a not state;
case (BackendDAE.EQUATION(e1 as DAE.CREF(componentRef = _),e2 as DAE.CALL(path = Absyn.IDENT(name = "der"),expLst={DAE.CREF(componentRef = _)}),src),swap)
equation
true = RTOpts.eliminationLevel() > 0;
true = RTOpts.eliminationLevel() <> 3;
then (e1,e2,src);
end matchcontinue;
end simpleEquation;

Expand Down
7 changes: 7 additions & 0 deletions Compiler/ExpressionSimplify.mo
Expand Up @@ -221,6 +221,13 @@ algorithm
e = simplifyAsub(e, sub) "For arbitrary vector operations, e.g (a+b-c)[1] => a[1]+b[1]-c[1]" ;
then
e;

// all other asubs
case DAE.ASUB(exp = e,sub = exps)
equation
e1 = simplify1(e);
then
DAE.ASUB(e1,exps);

// unary operations
case ((exp as DAE.UNARY(operator = op,exp = e1)))
Expand Down

0 comments on commit b77bf00

Please sign in to comment.