Hi all,
I'm using sympy 0.7.4.1, and I've come across an issue I don't quite understand. If I do
from sympy import *
x,z,t = symbols('x, z, t')
psi = Function('psi')(x,z)
j1 = Derivative(psi,x) - Derivative(psi,z)
j1.subs(Derivative(psi,x), t)
I get what I expect, t - d psi/dx. However, if I do the same thing with a second derivative with respect to z, I get the following:
j2 = Derivative(psi,x) - Derivative(psi,z,2)
j2.subs(Derivative(psi,x), t)
it returns t - d^2 t/dz^2. I expect it to return t - d^2 psi/dz^2. Can anyone point me to anything I might be doing wrong? I've tried defining t as a Function, rather than as a symbol (t = Function('t')(x,z)), but that does the exact same thing. I've also tried writing the second derivative in j2 as Derivative(psi,z,z), but that also does the same thing (which I would expect).
I've found this behavior both on my computer with Python 3.3.2 and on the sympy live shell on
sympy.org, which is currently
SymPy 0.7.4.1 (Python 2.7.5).
Any advice you could provide would be very helpful.
thanks,
Jeff