Skip to content

Commit

Permalink
- der(record constructur(..)) = record constructur(der(.),der(.))
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@13234 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Jens Frenkel committed Oct 7, 2012
1 parent 34227bd commit 9ec7a52
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Compiler/BackEnd/BackendDAEUtil.mo
Original file line number Diff line number Diff line change
Expand Up @@ -5513,7 +5513,7 @@ algorithm
case(r::rest,_,_,_,_,_,_,_)
equation
// if negatet rowmark then unsolvable
//true = intEq(rowmark[r],-mark);
//true = intEq(rowmark[r],-mark);
then
adjacencyRowEnhanced1(rest,e1,e2,vars,kvars,mark,rowmark,(r,BackendDAE.SOLVABILITY_UNSOLVABLE())::inRow);
end matchcontinue;
Expand Down
9 changes: 8 additions & 1 deletion Compiler/BackEnd/Derive.mo
Original file line number Diff line number Diff line change
Expand Up @@ -1215,7 +1215,7 @@ algorithm
DAE.ComponentRef cr,crx,tv;
DAE.Exp e,e1_1,e2_1,e1,e2,const_one,d_e1,d_e2,exp,e_1,cond,zero,call;
DAE.Type tp;
Absyn.Path a;
Absyn.Path a,path;
Boolean b;
DAE.Operator op;
String e_str,s,s2,str,name;
Expand Down Expand Up @@ -1393,6 +1393,13 @@ algorithm
e_1 = differentiateExp(exp, tv, differentiateIfExp,inFuncs);
then
DAE.BINARY(e_1,DAE.DIV(DAE.T_REAL_DEFAULT),DAE.BINARY(DAE.RCONST(1.0),DAE.ADD(DAE.T_REAL_DEFAULT),DAE.BINARY(e,DAE.MUL(DAE.T_REAL_DEFAULT),e)));

// der(record constructur(..)) = record constructur(der(.),der(.))
case (DAE.CALL(path=a,expLst=expl,attr=attr as DAE.CALL_ATTR(ty= DAE.T_COMPLEX(complexClassType=ClassInf.RECORD(path)))),tv,_,_)
equation
true = Absyn.pathEqual(a, path);
expl_1 = List.map3(expl, differentiateExp, tv, differentiateIfExp,inFuncs);
then DAE.CALL(a,expl_1,attr);

/*
this is wrong. The derivative of c > d is not dc > dd. It is the derivative of
Expand Down

0 comments on commit 9ec7a52

Please sign in to comment.