Filter löschen
Filter löschen

SOLVING PDE using MATLAB

1 Ansicht (letzte 30 Tage)
Mr.DDWW
Mr.DDWW am 30 Mär. 2022
Kommentiert: Torsten am 30 Mär. 2022
clc;clear all;close all;
L = 1;
x = linspace(0,L,75);
t = linspace(0,1,75);
m = 0;
sol = pdepe(m,@heatpde,@heatic,@heatbc,x,t);
sol1=sol;
figure(1)
surf(x,t,sol1);
xlabel('y/b');
zlabel('(T-T_0)/(T_1-T_0)');
title('Temperature Distribution in Finite Slab, Nu=1'); grid on;
function [c,f,s] = heatpde(x,t,u,dudx)
c = 1;
f = dudx;
s = 0;
end
function u0 = heatic(x)
u0 = 1;
end
function [pl,ql,pr,qr] = heatbc(xl,ul,xr,ur,t)
Nu = 1.0;
pl = 0;
ql = 1;
pr = Nu*ur;
qr = 1;
end
Can someone please verify if the plot as well as the method is correct ? I am trying to solve the pde in images using matlab
  1 Kommentar
Torsten
Torsten am 30 Mär. 2022
The code looks fine for me.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by