22 #include <ginac/function.h>
23 #include <ginac/operators.h>
24 #include <ginac/relational.h>
25 #include <ginac/symbol.h>
26 #include <ginac/wildcard.h>
30 #include <ast/parser/parse.hpp>
38 #include <util/visitors/is_constant_expression.hpp>
39 #include <util/visitors/replace_der.hpp>
52 ConvertToExpression to_exp;
53 GiNaC::ex left = to_ginac.convert(eq->left());
54 GiNaC::ex right = to_ginac.convert(eq->right());
55 GiNaC::symbol time = to_ginac.getTime();
56 GiNaC::ex der_left = left.diff(time).subs(var(GiNaC::wild(), time) == GiNaC::wild());
57 GiNaC::ex der_right = right.diff(time).subs(var(GiNaC::wild(), time) == GiNaC::wild());
58 return (
newAST_Equation_Equality(to_exp.convert(der_left), to_exp.convert(der_right), eq->comment())->getAsEquality());
66 GiNaC::ex dexp = to_ginac.
convert(exp,
false,
true);
67 GiNaC::symbol time = to_ginac.
getTime();
68 GiNaC::ex der_exp = dexp.diff(time).subs(var(GiNaC::wild(), time) == GiNaC::wild());
80 ReplaceDer replace_der;
81 GiNaC::ex dexp = to_ginac.
convert(rhs_exp,
false,
true);
82 map<string, GiNaC::symbol> dir = to_ginac.
directory();
83 GiNaC::symbol time = to_ginac.
getTime();
84 GiNaC::symbol ginac_usage = dir[
usage];
85 GiNaC::ex der_exp = dexp.subs(var(GiNaC::wild(), time) == GiNaC::wild()).diff(ginac_usage);
86 AST_Expression jac_exp = replace_der.apply(to_exp.
convert(der_exp));