MATLAB: I am using the pdepe function and the question is how I could fix the following error: ‘This DAE appears to be of index greater than 1’.

pdepe

function modelo
m = 0;
r=20;
s=20;
x = linspace(0,1,r);
t = linspace(-0.3555,4,s);
sol = pdepe(m,@modelopde,@modeloic,@modelobc,x,t);
u1 = sol(:,:,1);
u2 = sol(:,:,2);
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')
return
end
function [c,f,s] = modelopde(x,t,u,DuDx)
alpha = 1e-3;
c = [0;1];
f = [-u(1);0]+ alpha*DuDx;
a = 1048.92;
b = -0.1397;
ceq = u(2)/(a-b*u(2));
st = 21.57;
aux1=(-u(1)+ceq)*st;
aux2=(u(1)-ceq)*st;
s =[aux1;aux2];
return
end
function u0 = modeloic(x)
u0 = [4.47;2000/(0.1*(1-0.26))];
return
end
function [pl,ql,pr,qr] = modelobc(xl,ul,xr,ur,t)
pl = [ul(1)-4.47;0];
ql = [0; 0];
pr = [0; 0];
qr = [0; 0];
return
end
Errors:
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 modelo (line 9)
sol = pdepe(m,@modelopde,@modeloic,@modelobc,x,t);

Best Answer

You only prescribe one boundary condition for your PDE system, but four are necessary to fix the solution.
Best wishes
Torsten.
Related Question