Why do I get the message "Spatial Discretization has failed..."?

I am trying to run pdepe by using the following functions and I get the message "Spatial Discretization has failed...etc" when I run it. Is there anything wrong with my functions? The PDE I'm trying to solve is: 1/CD * ∂u/∂t=(∂^2 u)/(∂x^2 ) where C and D are constants and u stands for the concentration of a molecule which is being diffused.
function [c,f,s]=portokalia(x,t,u,DuDx)
C=0.9;
D=0.0003;
c = 1/(C*D);
f = DuDx;
s = 0;
function u0 = mila(x)
dAHL=0.01;
u0 = exp(-dAHL*x);
function [pl,ql,pr,qr] = mpananes(xl,ul,xr,ur,t)
pl = ul - 0.02;
ql = 0;
pr = 0;
qr = 0;

Answers (1)

Torsten
Torsten on 5 May 2017
Edited: Torsten on 5 May 2017
You get this message because no boundary condition is set at x=xr.
Best wishes
Torsten.

Tags

Edited:

on 5 May 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!