I am finding issues in PDEPe which shows time integration failure again and again

2 ビュー (過去 30 日間)
Aadityaamlan
Aadityaamlan 2024 年 6 月 21 日
回答済み: Umang Pandey 2024 年 7 月 16 日
"Warning: Failure at t=2.088125e-04. Unable to meet integration tolerances without reducing the step size
below the smallest value allowed (4.336809e-19) at time t. "
This message is being shown for running my code. I am uploading my code below.
clear all
clc
close all
m=0;
x=linspace(0,1,1001);
t=linspace(0,1,1001);
options = odeset('RelTol', 1e-3, 'AbsTol', 1e-6,'MaxStep', 0.1);
sol=pdepe(m,@coupledpde_BACD,@coupledic_BACD,@coupledbc_BACD,x,t,options);
b=sol(:,:,1);
figure(1)
surf(x,t,b)
xlabel('x')
ylabel('t')
zlabel('b(x,t)')
grid on
title('Bacterial distribution');
view([150 25])
colorbar
colormap jet
for j=[1 11 101]
ylim([0,1.2])
figure(2)
hold on
plot(x,b(j,:),LineWidth=2)
title("Particle Concentration Profile at t= (1, 11, 101)*td")
xlabel("Characteristic length")
ylabel('bacteria Concentration')
end
function [c,f,s]= coupledpde_BACD(x,t,u, dudx)
Db=10^-12;
Dc=10^-9;
X0=10^-9;
% X0=linspace(10^-11,10^-9,100);
% Db=linspace(10^-13,10^-12,100);
c=1;
s=0;
l=[pi/2 3*pi/2 5*pi/2];
A=4.*(cos(l)-1)./(2.*l-sin(2.*l));
mob_ratio=X0/Dc;
d_ratio=Db/Dc;
f=(d_ratio).*dudx-u*(mob_ratio)./(1+exp(-l(1)^2.*t).*A(1).*sin(l(1).*x)).*(exp(-l(1)^2.*t).*A(1).*cos(l(1).*x).*l(1));
end
function u0 = coupledic_BACD(x)
u0=1;
end
function [pl,ql,pr,qr]= coupledbc_BACD(xl,ul,xr,ur,t)
pl=ul;
ql=0;
pr=0;
qr=1;
end
please help me find the issue in the code
  4 件のコメント
Torsten
Torsten 2024 年 6 月 22 日
編集済み: Torsten 2024 年 6 月 22 日
At the moment, you set
(d_ratio).*dudx(@x=1)-u(@x=1)*(mob_ratio)./(1+exp(-l(1)^2.*t).*A(1).*sin(l(1))).*(exp(-l(1)^2.*t).*A(1).*cos(l(1)).*l(1)) = 0
Is this what you mean by "zero neumann boundary condition" ?
Aadityaamlan
Aadityaamlan 2024 年 6 月 25 日
This is the equation itself

サインインしてコメントする。

回答 (1 件)

Umang Pandey
Umang Pandey 2024 年 7 月 16 日
Hi Aaditya,
This error message indicates that the problem you are trying to solve is too stiff for the ODE solver you are trying to use, or that it includes a singularity.
It has been explained by the MathWorks Support Staff in the following MATLAB answer:
Hope this helps!
Best,
Umang

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by