I am solving a pde using pdepe in matlab. But I am getting warnings and some peculiar results.

2 次查看(过去 30 天)
Here is my differential equation. A and B are constant. u1 is the lambda and u2 is the Here is my code for the problem
function diff
m = 0;
y = 0:0.01:01;
t = 0:0.01:29;
length(t)
options= odeset('RelTol',1e-13,'AbsTol',1e-8);
options = odeset('NonNegative', 2);
sol = pdepe(m,@diffpde,@diffic,@diffbc,y,t,options);
Lambda = sol(:,:,1);
Velocity = sol(:,:,2);
size(Lambda)
size(t)
size(y)
figure
plot(y, Velocity(end,:))
title('velocity at the last time');
figure
plot(y, Lambda(end,:))
title('Lambda at the last time');
% xlswrite('Velocity', Velocity);
xlswrite('Lambda', Lambda);
end
% -----------------------------------------------------------------------------
function [c,f,s] = diffpde(y,t,u,DuDy)
De= 0.04;
GammaDotNaughtTilda=0.9;
c = [De; 1];
f= [0;1].*flip(exp(u)).*DuDy;
s = [1;0]+[-u(1)*GammaDotNaughtTilda;0].*flip(DuDy);
end
% --------------------------------------------------------------
function u0 = diffic(y);
u0 = [0; 0];
end
% --------------------------------------------------------------
function [pl,ql,pr,qr] = diffbc(yl,ul,yr,ur,t)
pl = [0; ul(2)];
ql = [1; 0];
pr = [ur(1); ur(2)-1];
qr = [1; 0];
end
Here in my code De is the constant A and GammaDotNaughtTilda is B. I am using A as 0.04 and B as 0.9. I have to solve the problem to find the steady state. The problem with my code is that I m not able to find the steady state. After some time I get a warning "Warning: Time integration has failed. Solution is available at requested time points up to t=2.819000e+01. " and the last value of u1 i.e. Lambda I get is 700 always even if I change the values of A and B. Thanks

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Partial Differential Equation Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by