MATLAB: How to solve boundary condition with ordinary differential in PDEPE

odepde

How can I couple the ODE for boundary condition in PDE? Now I have one very simple PDE function – diffusion equation.
dt*dC(t,x)=D*dC^2(t,x)/dx^2
But with a complicated boundary condition
C(0,t)/dt=alpha*C(0)
C(1,t)/dt=alpha*C(1)
My question is how can I couple this ODE B.C. in PDEPE solver.
I am a MatLab beginner. Please provide me any suggestion that I can try.
Thank you very much!

Best Answer

PDEPE does not accept ordinary differential equations as boundary conditions.
In the case above, you can simply integrate the ODEs beforehand and supply
C(0,t) = C(0)*(1+alpha*t)
C(1,t) = C(1)*(1+alpha*t)
But if the ODEs for the boundaries get more complicated, you will have to code the solution of the PDE on your own.
One way is to discretize the PDE in space and solve the resulting system of ordinary differential equations using ODE15S. Look up "method-of-lines" for more details.
Best wishes
Torsten.
Related Question