You need to use u(x, t) everywhere. SymPy considers u(x) and u(x, t) to be completely different functions.
Unfortunately, pdsolve is currently not very powerful, and it is unable to solve your PDE. Aaron Meurer On Wed, May 3, 2017 at 11:27 AM, <[email protected]> wrote: > Hi, > I have just started using sympy and tried to solve a PDE like this: > > > > > > My approach in sympy was: > > from sympy.solvers.pde import pdsolve > from sympy import Function, diff, pprint, Eq, init_printing > from sympy.abc import x,t,c > init_printing() > u = Function('u') > w = Eq(diff(u(t),t,2) - (c**2*diff(u(x),x,2)),0) > pdsolve(w, u(x,t),hint="all") > > Unfortunataly I've got some error-messages which I can't handle. > Is there any help? > Thanks a lot. > > > The error messages were: > > ValueError Traceback (most recent call > last)<ipython-input-12-e0eef578ab5a> in <module>()----> 1 pdsolve(w, > u(x,t),hint="all") > C:\WinPython\WinPython-32bit-3.5.2.1\python-3.5.2\lib\site-packages\sympy\solvers\pde.py > in pdsolve(eq, func, hint, dict, solvefun, **kwargs) 171 # See the > docstring of _desolve for more details. 172 hints = _desolve(eq, > func=func,--> 173 hint=hint, simplify=True, type='pde', **kwargs) > 174 eq = hints.pop('eq', False) 175 all_ = hints.pop('all', False) > C:\WinPython\WinPython-32bit-3.5.2.1\python-3.5.2\lib\site-packages\sympy\solvers\deutils.py > in _desolve(eq, func, hint, ics, simplify, **kwargs) 224 if > hints['order'] == 0: 225 raise ValueError(--> 226 > str(eq) + " is not a differential equation in " + str(func)) 227 228 > if not hints['default']: > ValueError: -c**2*Derivative(u(x), x, x) + Derivative(u(t), t, t) is not a > differential equation in u(x, t) > > > > −c2d2dx2u(x)+d2dt2u(t)=0 > > > > > M > > > > > > -- > 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 https://groups.google.com/group/sympy. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/sympy/59512994-6ded-4253-9951-2c32d62a8905%40googlegroups.com > <https://groups.google.com/d/msgid/sympy/59512994-6ded-4253-9951-2c32d62a8905%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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 https://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAKgW%3D6%2Bpw9oukAjsCO_XLDgjh5U16gsGu_j4YC549ECtM4iajg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
