我正在尝试对PDE进行建模,包括平流扩散和反应项。我希望在非常小的板(5微米)中长时间(2 * 60 * 60秒)后看到浓度分布。我使用了行(ode15s
)的方法来解决这个PDE但我的结果与实验结果不匹配。因为出口浓度立即达到最大浓度(如我的情节所示)。有人有建议吗?
clc
clear
close all
%%%%%%%%%%%parameters%%%%%%%%%%%%%%%%
global a b g Ki dx cin
Lf=5e-6; %microM
dm=8.6*10^-6; %m2/min
area=0.65; % m^-1
cin=20; %
ki=1; %mg/m3 min
Ki=0.24; %m3/mg
ux=0.5; %m/min
%%%%%%%%%%%%%%%%%%constant%%%%%%%%%%%%%%%%%%%
a=dm;
b=ux;
g=ki*Ki;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
tf=2*60*60;
nx=50;
xf=Lf;
dx=xf/nx;
nt=1000;
dt=tf/nt;
x = 0:dx:xf;
t = 0:dt:tf;
N = numel(x);
u0 = zeros(N,1);
y0 = u0 ;
[t,y] = ode15s(@(t,y)fun(t,y,x,N),t,y0);
u = y(:,1:2:end);
x = (1:N)/(N+1);
plot(t/60,u(:,end))
function dydt=fun(~,y,~,N)
global a b g dx cin
bc=cin;
dydt = zeros(N,1);
i = 1;
dydt(i,:)=a*(y(i+1,:)-2*y(i,:)+bc)/(dx^2)-b*(y(i+1,:)-bc)./(2*dx)-g.*y(i+1,:);
i = 2:N-1;
dydt(i,:)=a*(y(i+1,:)-2*y(i,:)+y(i-1,:))/(dx^2)-b*(y(i+1,:)-y(i-1,:))./(2*dx)-g.*y(i,:);
i = N;
dydt(i,:)=a*(y(N,:)-2*y(i,:)+y(i-1,:))/(dx^2)-b*(y(N,:)-y(i-1,:))./(2*dx)-g.*y(i,:);
end