フィルターのクリア

How to imply conditional boundary condition in PDEPE?

3 ビュー (過去 30 日間)
Sait Mutlu Karahan
Sait Mutlu Karahan 2022 年 5 月 30 日
コメント済み: Torsten 2022 年 5 月 31 日
Hi all,
I have problem my left side boundary condition is time dependent and it is
when I try to apply pdepe in matlab I couldn't write my pl values according the time values.
P.S. I'm a new learner please be kind when you are replying. Thanks :)
clear all;
clc;
close all;
L = 1000;
x = linspace(0,L,1001);
t = [linspace(0,5,20), linspace(5.1,50,10)];
m = 0;
sol = pdepe(m,@heatpde,@heatic,@heatbc,x,t);
colormap hot
imagesc(x,t,sol)
colorbar
xlabel('Distance x','interpreter','latex')
ylabel('Time t','interpreter','latex')
title('Heat Equation for $0 \le x \le 1000$ and $0 \le t \le 50$','interpreter','latex')
function [c,f,s] = heatpde(x,t,u,dudx)
c = 0.02;
f = dudx;
s = 0;
end
function u0 = heatic(x)
u0 = 50-(0.01*x);
end
function [pl,ql,pr,qr] = heatbc(xl,ul,xr,ur,t)
g=50-0.1*(t-1);
if (t >= 0) && (t <= 20)
pl = ul-50;
ql = 0;
elseif (t > 20) && (t <= 50)
pl = ul - g;
ql = 0;
end
pr = ur-40;
qr = 0;
end
  8 件のコメント
Sait Mutlu Karahan
Sait Mutlu Karahan 2022 年 5 月 31 日
yes I'm talking about that but I couldn't find how to do that
Torsten
Torsten 2022 年 5 月 31 日
t = [t1;t2];
sol = [sol1(:,:,1);sol2(:,:,1)];

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

回答 (0 件)

カテゴリ

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

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by