Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 2197 by [email protected]: differentiate in nested functions
http://code.google.com/p/sympy/issues/detail?id=2197
this is my first report, so i don't know if this is worth a issue report,
if this problem is already known, i would like to know if there is a
workaround, where i get the function Fz(x) at the end
import sympy as sp
sp.var("E,F,Er,El,k,z,L")
Ez = lambda z: Er*sp.exp(sp.I*k*z)+El*sp.exp(-sp.I*k*z)
Fz = lambda z: Ez(z).diff(z)
res = Fz(z+L)
gives the error message:
Traceback (most recent call last):
File "test.py", line 5, in <module>
res = Fz(z+L)
File "test.py", line 4, in <lambda>
Fz = lambda z: Ez(z).diff(z)
File "/usr/lib/pymodules/python2.6/sympy/core/basic.py", line 2081, in
diff
ret = Derivative(self, *new_symbols, **assumptions)
File "/usr/lib/pymodules/python2.6/sympy/core/function.py", line 586, in
__new__
raise ValueError('Invalid literal: %s is not a valid variable' % s)
ValueError: Invalid literal: L + z is not a valid variable
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.