Borrar filtros
Borrar filtros

How to imply conditional boundary condition in PDEPE?

3 visualizaciones (últimos 30 días)
Sait Mutlu Karahan
Sait Mutlu Karahan el 30 de Mayo de 2022
Comentada: Torsten el 31 de Mayo de 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 comentarios
Sait Mutlu Karahan
Sait Mutlu Karahan el 31 de Mayo de 2022
yes I'm talking about that but I couldn't find how to do that
Torsten
Torsten el 31 de Mayo de 2022
t = [t1;t2];
sol = [sol1(:,:,1);sol2(:,:,1)];

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Mathematics en Help Center y File Exchange.

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by