- 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
Cette question est clôturée. Rouvrir pour modifier ou répondre.
Error solving simultaneous PDEs.
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Bill Greene
le 19 Avr 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:
Good luck.
Bill
0 commentaires
Cette question est clôturée.
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!