Trying to use PDEPE function to solve a 1-d diffusion problem, I am getting a strange error...

1 次查看(过去 30 天)
function angiogenesis
m = 0;
z = linspace(0, .25, 15);
t = linspace(0,7*24,24);
soln = pdepe(m, @pde, @ic, @bc, z, t);
Conc = soln(:,:,1);
plot(z,Conc);
% ezplot3(z,Conc,t)
xlabel('Distance in cm');
ylabel('Concentration in mM');
function [c,f,s] = pde(z, t, Conc, dudz)
D = 1e-6;
c = 1/D;
f = dudz;
s = 0;
function u = ic(z)
u = 0;
function [pa,qa,pb,qb] = bc(za, ua, b, ub, t)
Fp = 4.94e-19;
D = 1e-6;
pa = Fp;
qa = D;
pb = 0;
qb = 0;
Error:
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 angiogenesis (line 7)
soln = pdepe(m, @pde, @ic, @bc, z, t);

采纳的回答

Bill Greene
Bill Greene 2013-2-8
Hi,
The problem is with your boundary conditions at the right end (although I agree the error message doesn't make that particularly clear).
Do you want the solution to be zero at the right end? If so, change pb=0; to pb = ub;
If instead you want the flux to be zero, change qb = 0; to qb = 1;
Bill

更多回答(1 个)

BlueSky
BlueSky 2013-2-24
OK, that fixed it actually, Thanks
can you explain to me what each parameter inside the boundary condition function mean?

Community Treasure Hunt

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

Start Hunting!

Translated by