Effacer les filtres
Effacer les filtres

How to imply conditional boundary condition in PDEPE?

3 vues (au cours des 30 derniers jours)
Sait Mutlu Karahan
Sait Mutlu Karahan le 30 Mai 2022
Commenté : Torsten le 31 Mai 2022
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 commentaires
Sait Mutlu Karahan
Sait Mutlu Karahan le 31 Mai 2022
yes I'm talking about that but I couldn't find how to do that
Torsten
Torsten le 31 Mai 2022
t = [t1;t2];
sol = [sol1(:,:,1);sol2(:,:,1)];

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by