numerical solution for heat equation
12 ビュー (過去 30 日間)
古いコメントを表示
How can I plot temperature vs z if there is noting given about z?
The code that I write for it is,
inits='T1(0)=10,T2(0)=10,T3(0)=10';
>> [T1,T2,T3]=dsolve('DT1=-2*T1+T2+10','DT2=T3-2*T2+T1','DT3=90-2*T3+T2',inits)
1 件のコメント
Walter Roberson
2023 年 12 月 15 日
T(z,t>=0) implies that you have a PDE not an ODE. dsolve() cannot handle PDE.
採用された回答
Torsten
2023 年 12 月 15 日
I think your discretization should be done using the FV-method. Here, the volumes and areas of the bricks - expressed with dx, dy and dz - come into play.
syms T1(t) T2(t) T3(t) t
Ta = 10;
Tb = 90;
tplot = 10;
eqn1 = diff(T1,t) == T2-2*T1+Ta;
eqn2 = diff(T2,t) == T3-2*T2+T1;
eqn3 = diff(T3,t) == Tb-2*T3+T2;
eqns = [eqn1,eqn2,eqn3];
cond1 = T1(0)==Ta;
cond2 = T2(0)==Ta;
cond3 = T3(0)==Ta;
conds = [cond1,cond2,cond3];
[T1sol,T2sol,T3sol] = dsolve(eqns,conds);
hold on
fplot(T1sol,[0 tplot])
fplot(T2sol,[0 tplot])
fplot(T3sol,[0 tplot])
hold off
grid on
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
