pdepe daeic12 (line 77) eror

3 views (last 30 days)
Max
Max on 22 Apr 2014
Answered: Bill Greene on 27 Apr 2014
Hello.
I'm trying to solve a partial differential equation of the type that can be solved with pdepe, but it eror. Help please
So in general: There is a piece of land which receives contaminants. plot only limited depth. C1 C2 C3 - varying the intensity of the absorption of contaminants At the picture I wrote out main conditions of distribution.
At the initial time there is no soil pollutants.
function Dif_test
m=0;
x = linspace(0,0.1,10);
t = linspace(0,5,30);
sol=pdepe(m,@pdex6pde,@pdex6ic,@pdex6bc,x,t);
u1=sol(:,:,1);
u2=sol(:,:,2);
u3=sol(:,:,3);
figure
surf(x,t,u1)
title('u1(x,t)')
xlabel('Distance x')
ylabel('Time t')
figure
surf(x,t,u2)
title('u2(x,t)')
xlabel('Distance x')
ylabel('Time t')
figure
surf(x,t,u3)
title('u3(x,t)')
xlabel('Distance x')
ylabel('Time t')
end
%-------------------------------------------------
function [ pl,ql,pr,qr ] = pdex6bc(xl,ul,xr,ur,t)
cs=1;
a=0.5;
ql=[0; 0; 0];
pl=[ur(1)-a*cs; ul(2)-(1-a)*cs; 0];
qr=[1; 1; 0];
pr=[0; 0; 0];
end
%--------------------------------------------------
function u0 = pdex6ic(x)
u0=[0;0;0];
end
%--------------------------------------------------
function [c,f,s] = pdex6pde(x,t,u,DuDx)
d1=0; d2=0; d=0.1;
a=10; a1=0.001; a2=0.01;
D=[1 d1 0; d2 d 0 ; 0 0 0 ];
K=[-a 1 0; a -(1+a2) a1; 0 a2 -a1];
c=[1;1;0];
s=K*[1;1;0];
f=D * DuDx;
end
%-------------------------------------------------
Error using daeic12 (line 77) This DAE appears to be of index greater than 1.
Error in ode15s (line 311) [y,yp,f0,dfdy,nFE,nPD,Jfac] = daeic12(odeFcn,odeArgs,t,ICtype,Mt,y,yp0,f0,...
Error in pdepe (line 317) [t,y] = ode15s(@pdeodes,t,y0,opts);
Error in Dif_test (line 6) sol=pdepe(m,@pdex6pde,@pdex6ic,@pdex6bc,x,t);

Answers (1)

Bill Greene
Bill Greene on 27 Apr 2014
I don't see any boundary conditions on c3. I think this may be the cause of your problem.
Bill

Categories

Find more on Partial Differential Equation Toolbox in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!