MATLAB Answers

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Error solving simultaneous PDEs.

2 ビュー (過去 30 日間)
Shrishti
Shrishti 2014 年 4 月 18 日
終了済み: MATLAB Answer Bot 2021 年 8 月 20 日
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;
m=0;
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)
c=[3.79995;4.3425475];
b = [0;0];
s = [-73010;25842].*DuDx + [11.8333*(u(2)-u(1));-11.8333*(u(2)-u(1))];
end
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];
end
function value = initial5(x)
value = [100;390];
end

回答 (1 件)

Bill Greene
Bill Greene 2014 年 4 月 19 日
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.
Bill

Community Treasure Hunt

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

Start Hunting!

Translated by