On Saturday, January 9, 2021 at 5:57:09 AM UTC-6 [email protected] wrote:

> But now I have an another question if the manipulation works in 
> algebraically robust way,
> For example, we have lots of pitfalls of expression tree manipulation that 
> some simple examples like "x / x" work, 
> but we soon end up with some more complicated examples like " 
> exp(x+1)/exp(1)" doesn't work robustly,
> and the only way to cope with them are appending 
> .expand().cancel().together().simplify(), ... to the tail which is pretty 
> much black-boxed and not robust at all.
>

At present the `Equation` class does no extra simplification that `sympy` 
does not already do. Are you asking for the `Equation` class to 
automatically apply extra simplification steps? Here is the present 
behavior of a standard `sympy Expr` and the proposed `Equation` classes for 
your simple example.

>>> expr1 = exp(x+1) 
>>> expr2 = expr1/exp(x) 
>>> expr2 exp(-x)*exp(x + 1) 
>>> eq1 = Eqn(a, expr1) 
>>> eq2 = eq1/exp(x) 
>>> eq2 
a*exp(-x) = exp(-x)*exp(x + 1) 
>>> expand(eq2) 
a*exp(-x) = E 
>>> expand(expr2) E

Thanks for the input.
Jonathan

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/677e7470-1356-4a45-93ca-24e91260d27fn%40googlegroups.com.

Reply via email to