Failure at t=0.000000e+00. Unable to meet integration tolerances without reducing the step size below the smallest value allowed (7.905050e-323) at time t.

26 ビュー (過去 30 日間)
I am solving a heat conduction problem using pde solver. Here is the full question:
A solid body occupying the space from y = 0 to y = ∞ is initially at temperature T0. Beginning at time t=0, a periodic heat flux given by 𝑄𝑦=𝑄0cos𝜔𝑡 , is imposed at y = 0. Here 𝑄0 is the amplitude of the heat flux oscillations, and ω is the frequency.
The code I use is:
function heateqn
global rho cp k
global q t0 w q0
L=Inf; %m
t0=100;
q0=10 ;
w=100;
k=200; %W/m-K
rho=10000; %kg/m^3
cp=500; %J/kg-K
q=100; %W/m^2
tend=10; %seconds
m = 0;
x = linspace(0,L,200);
t = linspace(0,tend,50);
% solving
sol = pdepe(m,@pdex1pde,@pdex1ic,@pdex1bc,x,t);
% Post processing
Temperature = sol(:,:,1);
% Plot temperature vs. length
figure, plot(x,Temperature(end,:))
title(strcat('Solution at t = ', num2str(tend)))
xlabel('Distance x')
ylabel('Temperature (C)')
%
figure, plot(t,Temperature(:,1))
title('Temperature (C)')
xlabel('Time (s)')
ylabel('Temperature (C)')
% --------------------------------------------------------------
function [c,f,s] = pdex1pde(x,t,u,DuDx)
global rho cp k
c = rho*cp;
f = k*DuDx;
s = 0;
% --------------------------------------------------------------
% end
function u0 = pdex1ic(x)
t0=100;
u0 = t0;
% --------------------------------------------------------------
% end
function [pl,ql,pr,qr] = pdex1bc(xl,ul,xr,ur,t)
global q
pl = 10 *cos(100*t);
ql = 1;
pr =ur-10;
qr = 0;
% end
I am getting the error message:
Warning: Failure at t=0.000000e+00.
Unable to meet integration tolerances
without reducing the step size below the
smallest value allowed (7.905050e-323) at
time t.
> In ode15s (line 668)
In pdepe (line 289)
In heat (line 20)
Warning: Time integration has failed.
Solution is available at requested time
points up to t=0.000000e+00.
> In pdepe (line 303)
In heat (line 20)
>>

採用された回答

esat gulhan
esat gulhan 2020 年 8 月 15 日
I think the main problem is the value of L. Inf is not a good way to solve this problem. You should write largest positive floating-point number, realmax which is 1.7977e+308
L= realmax
If your code is right, it will gives you right answer

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by