This question is closed. Reopen it to edit or answer.

Error solving simultaneous PDEs.

1 view (last 30 days)
Shrishti on 18 Apr 2014
Closed: MATLAB Answer Bot on 20 Aug 2021
I am trying to solve a set of 2 PDEs but am getting stuck with this error: ??? Error using ==> daeic12 at 77 This DAE appears to be of index greater than 1.
I am unable to figure out the problem in the code. I am enclosing the code here:
clc; clear all;
x = linspace(0,1,10);
t = linspace(0,20,10);
sol = pdepe(m,@eqn5,@initial5,@bc5,x,t);
u1 = sol(:,:,1)
u2 = sol(:,:,2)
u3 = sol(:,:,3)
u4 = sol(:,:,4)
u5 = sol(:,:,5)
function [c,b,s] = eqn5(x,t,u,DuDx)
b = [0;0];
s = [-73010;25842].*DuDx + [11.8333*(u(2)-u(1));-11.8333*(u(2)-u(1))];
function [pl,ql,pr,qr] = bc5(xl,ul,xr,ur,t)
pl = [ul-100;0];
ql = [0;0];
pr = [0;ur-200];
qr = [0;0];
function value = initial5(x)
value = [100;390];

Answers (1)

Bill Greene
Bill Greene on 19 Apr 2014
The first thing I should say is that pdepe is designed to solve systems of parabolic and elliptic PDEs. Practically this means that your b term should contain DuDx. Your b term is zero so your equations are hyperbolic. Getting a good solution from pdepe for equations of this type is very challenging.
But that is not the cause of the error you are getting. The error is due to problems with your boundary conditions. A set of boundary conditions consistent with your initial conditions is
pl = ul-[100 390]';
ql = [0;0];
pr = ur-[100 390]';
qr = [0;0];
Probably this is not what you want but pdepe will at least run to completion. The solution is obviously wrong due to the problem I mentioned first.
If you are sufficiently motivated to experiment, you can try the following:
  1. Get your boundary condition problem sorted out. You probably don't want to specify Dirichlet boundary conditions at both ends.
  2. Add a small DuDx term to b. This is generally referred to as "artificial diffusion."
  3. Refine the mesh.
Good luck.

Community Treasure Hunt

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

Start Hunting!

Translated by