Clear Filters
Clear Filters

How to imply conditional boundary condition in PDEPE?

3 views (last 30 days)
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 Comments
Sait Mutlu Karahan
Sait Mutlu Karahan on 31 May 2022
yes I'm talking about that but I couldn't find how to do that

Sign in to comment.

Answers (0)

Categories

Find more on Mathematics in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!