solve pde with BC in python

60 views Asked by At

I have this partial differential equation ut=0; with this boundary condition: u(x,0)=x and I want to solve it with pdsolve in python

from sympy import *
from sympy.abc import x, t # x and y are the independent variables

u = Function("u")(x, t) 
initial_condition = u0.subs(t, 0) - x 
pde = Eq((u0.diff(t), 0))
boundary_conditions = [Eq(u.subs(x, 0), x)]
solution = pdsolve(pde, u, boundary_conditions)

I wrote this code but then I received this error

typeError: can only concatenate str (not "list") to str

How to use boundary condition to solve PDE equation

0

There are 0 answers