1D transient heat equation
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Lindsay Mau
el 31 de Jul. de 2020
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/339610/image.png)
n=120; %number of iterations
t=0; %initial time
dt=30; %change in time [seconds]
tmax = 3600; %cool for 1 hr
T_initial = [80; 80; 80; 80; 80; 80; 80; 80; 80; 80; 80]; %initial temperature
A=[-230,50,0,0,0,0,0,0,0,0,0;
50,-460,50,0,0,0,0,0,0,0,0;
0,50,-460,50,0,0,0,0,0,0,0;
0,0,50,-460,50,0,0,0,0,0,0;
0,0,0,50,-460,50,0,0,0,0,0;
0,0,0,0,50,-460,50,0,0,0,0;
0,0,0,0,0,50,-460,50,0,0,0;
0,0,0,0,0,0,50,-460,50,0,0;
0,0,0,0,0,0,0,50,-460,50,0;
0,0,0,0,0,0,0,0,50,-460,50;
0,0,0,0,0,0,0,0,0,50,-330];
B =[-14400;-28800;-28800;-28800;-28800;-28800;-28800;-28800;-28800;-28800;-16400];
for i=1 %initialize solution
T(i)=T_initial;
end
T(1)=T_initial;
while (t < tmax)
i=i+1;
t=t+dt;
for i=2:n-1
T(i) = A\B;
end
end
0 comentarios
Respuestas (1)
clc
clear
A=[-230,50,0,0,0,0,0,0,0,0,0;
50,-460,50,0,0,0,0,0,0,0,0;
0,50,-460,50,0,0,0,0,0,0,0;
0,0,50,-460,50,0,0,0,0,0,0;
0,0,0,50,-460,50,0,0,0,0,0;
0,0,0,0,50,-460,50,0,0,0,0;
0,0,0,0,0,50,-460,50,0,0,0;
0,0,0,0,0,0,50,-460,50,0,0;
0,0,0,0,0,0,0,50,-460,50,0;
0,0,0,0,0,0,0,0,50,-460,50;
0,0,0,0,0,0,0,0,0,50,-330];
B =[-14400;-28800;-28800;-28800;-28800;-28800;-28800;-28800;-28800;-28800;-16400];
T=A\B
1 comentario
Thanks for asking. Please accept my proposal if your questions were resolved. I remain at your disposal for any questions.
Ver también
Categorías
Más información sobre Heat and Mass Transfer en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!