- Get your boundary condition problem sorted out. You probably don't want to specify Dirichlet boundary conditions at both ends.
- Add a small DuDx term to b. This is generally referred to as "artificial diffusion."
- Refine the mesh.
Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Error solving simultaneous PDEs.
조회 수: 1 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
답변 (1개)
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:
Good luck.
Bill
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!