Changeset 3ad7933b in OpenModelica


Ignore:
Timestamp:
2016-04-02T22:51:03+02:00 (8 years ago)
Author:
hudson <openmodelica@…>
Branches:
Added-citation-metadata, maintenance/v1.14, maintenance/v1.15, maintenance/v1.16, maintenance/v1.17, maintenance/v1.18, maintenance/v1.19, maintenance/v1.20, maintenance/v1.21, maintenance/v1.22, master, omlib-staging
Children:
2ddae713
Parents:
28678f06
git-author:
vruge <vruge@…> (04/02/16 22:51:03)
git-committer:
hudson <openmodelica@…> (04/02/16 22:51:03)
Message:

improved solveSimpleEquation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Compiler/BackEnd/ExpressionSolve.mo

    r392b6e6 r3ad7933b  
    121121  BackendDAE.EquationAttributes attr;
    122122  DAE.ElementSource source;
    123   Boolean isContinuousIntegration = BackendDAEUtil.isSimulationDAE(shared);
     123  //Boolean isContinuousIntegration = BackendDAEUtil.isSimulationDAE(shared);
    124124algorithm
    125125  BackendDAE.EQUATION(exp=e1, scalar=e2, source=source,attr=attr) := eqn;
     
    132132
    133133  if (Types.isIntegerOrRealOrSubTypeOfEither(Expression.typeof(e1)) and Types.isIntegerOrRealOrSubTypeOfEither(Expression.typeof(e2))) then
    134     (e1, e2) := preprocessingSolve(e1, e2, varexp, SOME(shared.functionTree), NONE(), 0, false);
     134    (e1, e2) := preprocessingSolve(e1, e2, varexp, SOME(shared.functionTree), NONE(), 0,  false);
    135135  end if;
     136
    136137  try
    137138    e := solve2(e1, e2, varexp, SOME(shared.functionTree), NONE());
     
    466467"
    467468
    468   input DAE.Exp inExp1 "lhs";
    469   input DAE.Exp inExp2 "rhs";
     469  input output DAE.Exp x "lhs";
     470  input output DAE.Exp y "rhs";
    470471  input DAE.Exp inExp3 "DAE.CREF or 'der(DAE.CREF())'";
    471472  input Option<DAE.FunctionTree> functions;
     
    473474  input Integer idepth;
    474475  input Boolean doInline;
    475   output DAE.Exp x;
    476   output DAE.Exp y;
    477476  output list<BackendDAE.Equation> eqnForNewVars = {} "eqn for tmp vars";
    478477  output list<DAE.ComponentRef> newVarsCrefs = {};
     
    490489
    491490 algorithm
    492    (x, _) := ExpressionSimplify.simplify(inExp1);
    493    (y, _) := ExpressionSimplify.simplify(inExp2);
    494    res := Expression.expSub(x, y);
    495491
    496492   // split and sort
    497    (lhsX, lhsY) := preprocessingSolve5(inExp1, inExp3,true);
    498    (rhsX, rhsY) := preprocessingSolve5(inExp2, inExp3,true);
     493   (lhsX, lhsY) := preprocessingSolve5(x, inExp3,true);
     494   (rhsX, rhsY) := preprocessingSolve5(y, inExp3,true);
    499495   x := Expression.expSub(lhsX, rhsX);
    500496   y := Expression.expSub(rhsY, lhsY);
     
    562558   end while;
    563559
    564    (y,_) := ExpressionSimplify.simplify1(y);
     560   y := ExpressionSimplify.simplify1(y);
    565561
    566562/*
Note: See TracChangeset for help on using the changeset viewer.