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);
0 个评论
采纳的回答
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
0 个评论
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Eigenvalue Problems 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!