Skip to content

Commit

Permalink
Fixed bug with differentiating exp (HelloWorld).
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@2523 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Peter Aronsson committed Sep 12, 2006
1 parent 08d3ee8 commit d765be7
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion Compiler/Derive.mo
Expand Up @@ -172,7 +172,22 @@ algorithm
then
Exp.UNARY(Exp.UMINUS(Exp.REAL()),Exp.BINARY(e_1,Exp.MUL(Exp.REAL()),
Exp.CALL(Absyn.IDENT("sin"),{e},false,true)));


case (Exp.CALL(path = fname,expLst = {e}),timevars)
equation
isExp(fname);
e_1 = differentiateExpTime(e, timevars) "der(exp(x)) = der(x)exp(x)" ;
then
Exp.BINARY(e_1,Exp.MUL(Exp.REAL()),
Exp.CALL(fname,{e},false,true));

case (Exp.CALL(path = fname,expLst = {e}),timevars)
equation
isLog(fname);
e_1 = differentiateExpTime(e, timevars) "der(log(x)) = der(x)/x";
then
Exp.BINARY(e_1,Exp.DIV(Exp.REAL()),e);

// *** Addition by JA 20060621
case (Exp.CALL(path = fname,expLst = {e},tuple_ = false,builtin = true),timevars)
equation
Expand Down

0 comments on commit d765be7

Please sign in to comment.