Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 2055 by nikola.vidosavljevic: dsolve() problem
http://code.google.com/p/sympy/issues/detail?id=2055
Hello,
from sympy import*
x=Symbol('x')
f=Function('f')
dsolve(Eq(Derivative(f(x),x,x),1),f(x))
f(x) == C1 + C2*x + x**2/2
This example works correctly, but when I put String in dsolve, then the
problem comes:
a="Derivative(f(x),x,x)"
dsolve(Eq(a,1),f(x))
Traceback (most recent call last):
File "<pyshell#10>", line 1, in <module>
dsolve(Eq(a,1),f(x))
File "C:\Python27\lib\site-packages\sympy\core\relational.py", line 30,
in Eq
return Relational(a,b,'==')
File "C:\Python27\lib\site-packages\sympy\core\relational.py", line 117,
in __new__
lhs = _sympify(lhs)
File "C:\Python27\lib\site-packages\sympy\core\sympify.py", line 185, in
_sympify
raise SympifyError("%r is NOT a valid SymPy expression" % (a,))
SympifyError: SympifyError: 'Derivative(f(x),x,x)' is NOT a valid SymPy
expression
And after sympify this String, another error is coming out:
a=sympify(a,locals=None,convert_xor=False)
a
D(f(x), x, x)
dsolve(Eq(a,1),f(x))
Traceback (most recent call last):
File "<pyshell#13>", line 1, in <module>
dsolve(Eq(a,1),f(x))
File "C:\Python27\lib\site-packages\sympy\solvers\ode.py", line 367, in
dsolve
return dsolve(eq.lhs-eq.rhs, func, hint=hint, simplify=simplify,
**kwargs)
File "C:\Python27\lib\site-packages\sympy\solvers\ode.py", line 383, in
dsolve
raise ValueError(str(eq) + " is not a differential equation in " +
str(func))
ValueError: -1 + D(f(x), x, x) is not a differential equation in f(x)
I need to put String because I'm doing something from Java.
Thank's a lot!
Nikola Vidosavljevic
--
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.