Hi:
source code:
import sympy
x=sympy.symbols('x',real=True)
f=sympy.symbols('f',cls=sympy.Function)
f.is_real=True
a=sympy.Abs(f(x).diff(x)).diff(f(x).diff(x))
a
the output is:
(re(Derivative(f(x), x))*Subs(Derivative(re(_xi_2), _xi_2), (_xi_2,),
(Derivative(f(x), x),)) + im(Derivative(f(x), x))*Subs(Derivative(im(_xi_2),
_xi_2), (_xi_2,), (Derivative(f(x), x),)))/Abs(Derivative(f(x), x))
the imaginary part still exist. Obviously, sympy does not think
f(x).diff(x) is real. So I try:
sympy.refine(a,sympy.Q.real(f(x).diff(x)))
but the output remains the same. So how to tell sympy that f(x).diff(x) is
real?
More weird stuff is:
f(x).diff(f(x))
the output is 1
but:
sympy.Abs(f(x)).diff(f(x))
the output is:
f(x)*Subs(Derivative(re(_xi_2), _xi_2), (_xi_2,), (f(x),))/Abs(f(x))
why sympy is not smart enough to simplify it to f(x)/Abs(f(x))?
I use python3.4 and sympy 0.7.6
--
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/2deb519b-9cdd-4b2e-93d7-f3f252ff8fc6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.