Trying to use PDEPE function to solve a 1-d diffusion problem, I am getting a strange error...
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
BlueSky
le 28 Jan 2013
Modifié(e) : Walter Roberson
le 5 Mar 2020
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 commentaires
Réponse acceptée
Bill Greene
le 8 Fév 2013
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 commentaires
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Eigenvalue Problems dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!