You can use links if you want:

plaes.org

First order PDE solving with Sympy

written by plaes, on Jul 10, 2009 1:32:00 PM.

For the past week, I have been working on my pdesolve() functionality so it would be possible to solve some first-order PDE's using the method of characteristics. Although, progress has been slow, following is already possible (if you have pulled my branch):

In [1]: from sympy import *
In [2]: from sympy.solvers.solvers import *
In [3]: from sympy import Derivative as D
In [4]: t,x,y,z = symbols('txyz')
In [5]: a = Symbol('a', Real=True)
In [6]: u = Function('u')
In [7]: eq = Eq(D(u(x, t), t) + a*D(u(x, t), x))
In [8]: eq
Out[8]: 
  d             d              
a⋅──(u(x, t)) + ──(u(x, t)) = 0
  dx            dt             
In [9]: pdesolve(eq, u(x, t))
Out[9]: [F₁(x - a⋅t)]

So, if interested, you can view the code on my github repository.

Leave a Reply