pdepe: Unable to meet integration tolerances without reducing the step size below the smallest value allowed
Afficher commentaires plus anciens
Hi, I'm trying to solve a system of transient convection diffusion reaction equations composed of 5 identical format PDEs. The function is below:

where d is the diffusivity, v is the velocity, G is the reaction term. The system is in cylindrical coorcinates. The problem is when if I remove the convection term in my code, it worked well. But if I added the convection term back in, the error came out: Warning: Failure at t=3.656244e-01. Unable to meet integration tolerances without reducing the step size below the smallest value allowed (8.881784e-16) at time t.
I don't know why this would happen. Could someone please help me? Thank you very much! Below is my code:
%main calling function
function model
m = 1;
x = linspace(0, 2.8, 29);
t = linspace(0, 200, 201);
sol = pdepe(m, @model_pde, @model_ic, @model_bc, x, t);
u_Ia = sol(:,:,1);
figure
surf(x, t, u_Ia)
title ('Numerical solution of Ia')
xlabel('Distance x')
ylabel ('Time t')
figure
[C, h] = contour(t, x, u_Ia', [350, 350], 'b')
xlabel('Time (min)')
ylabel('Clot Radius (mm)')
end
%boundary conditions
function [pl, ql, pr, qr] = model_bc(xl, ul, xr, ur, t)
pl = [0; 0; 0; 0; 0];
ql = [1; 1; 1; 1; 1];
pr = [0; 0; 0; 0; 0];
qr = [1; 1; 1; 1; 1];
end
%initial conditions
function u0 = model_ic(x)
u0 = [7000*(1-heaviside(x-2.5)); 2.18*heaviside(x-2.5); 2180*heaviside(x-2.5); 447.7*heaviside(x-2.5); 105*heaviside(x-2.5)];
end
%pde function
function [c, f, s] = model_pde(x, t, u, DuDx)
h_1 = 1500;
H_1m = 250000;
k_pla_upa = 60;
K_plam_upa = 50000;
h_pla = 0.096;
flow_rate = 10*10^3;
v = flow_rate / (pi*(2.4^2-(x/2)^2));
t_initial = 20;
a = 5*10^-2;
b = 5*10^-3;
m = 9*10^-6;
d = 5*10^-8;
e = 1;
rate = 1+a*v^1+b*v^2+m*v^3;
logi = 1/(1+exp(-(t - t_initial/(1+d*v^e))));
d_ia = 1.482*10^-3*logi;
d_pla = 2.958*10^-3*logi;
d_pls = 2.886*10^-3*logi;
d_l2ap = 3.15*10^-3*logi;
d_upa = 4.446*10^-3*logi;
G_Ia =-h_1*u(2)*u(1)/(H_1m+u(1));
G_PLA_generate = k_pla_upa*u(4)*u(3)/(K_plam_upa+u(3));
G_PLA_deplete = -h_pla*u(2)*u(5);
G_PLS = -k_pla_upa*u(4)*u(3)/(K_plam_upa+u(3));
G_uPA = 0;
G_L2AP = -h_pla*u(2)*u(5);
c = [1; 1; 1; 1; 1];
s = [G_Ia*rate*logi; G_PLA_generate*rate*logi + G_PLA_deplete*logi; G_PLS*rate*logi; G_uPA*logi; G_L2AP*logi];
f = [d_ia; d_pla; d_pls; d_upa; d_l2ap] .* DuDx - [v*u(1); v*u(2); v*u(3); v*u(4); v*u(5)];
% f = [d_ia; d_pla; d_pls; d_upa; d_l2ap] .* DuDx; %if there were no convection term, the code worked well
end
Réponse acceptée
Plus de réponses (1)
tom_brot
le 20 Mar 2015
0 votes
If you still have stability issues, check my answer at
BR, Tom
Catégories
En savoir plus sur PDE Solvers dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!