Bug with substituting derivatives

27 views
Skip to first unread message

Jonathan Lindgren

unread,
May 19, 2015, 3:25:46 PM5/19/15
to sy...@googlegroups.com
I recently updated from sympy 0.7.4 (I tihnk) to 0.7.6 and now I have some very strange behaviour with subs. The following code

from sympy.abc import phi
import sympy as sp

z=sp.Symbol('z')
t=sp.Symbol('t')
sp.pprint((phi(z,t).diff(t,2)).subs(phi(z,t).diff(z),sp.Symbol('b')(z,t)).expand())


gives me the output    
  2        
 ∂         
───(b(z, t))
  2        
∂t  
but I would expect the output
  2        
 ∂         
───(φ(z, t))
  2        
∂t 

This was working perfectly in my previous version of sympy.

Alex Lindsay

unread,
May 19, 2015, 4:00:46 PM5/19/15
to sy...@googlegroups.com
Not to hijack this post, but why does subs(phi(z,t).diff(z),...) work when phi(z,t).diff(t,2) does not contain any derivatives of phi with respect to z? It seems like this substitution is saying that phi(z,t).diff(z) = phi(z,t)

I'm new to sympy, so I apologize if this is a stupid question.

Alex
--
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 sympy+un...@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
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/a50b1e03-3c37-4207-bc4b-7b6663c80c84%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jonathan Lindgren

unread,
May 19, 2015, 4:33:03 PM5/19/15
to sy...@googlegroups.com
Well, that is exactly the problem, and what I think is a bug....it should not work like that..

Peter Brady

unread,
May 20, 2015, 11:46:41 AM5/20/15
to sy...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages