Azzera filtri
Azzera filtri

How to imply conditional boundary condition in PDEPE?

3 visualizzazioni (ultimi 30 giorni)
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 Commenti
Sait Mutlu Karahan
Sait Mutlu Karahan il 31 Mag 2022
yes I'm talking about that but I couldn't find how to do that

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Mathematics in Help Center e File Exchange

Prodotti


Release

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by