フィルターのクリア

Heat transfer matlab code

4 ビュー (過去 30 日間)
Fahad Pervaiz
Fahad Pervaiz 2018 年 8 月 22 日
コメント済み: Kuifeng Zhao 2018 年 8 月 23 日
I am trying to write a program to plot the temperature distribution in a insulated rod using the explicit Finite Central Difference Method and 1D Heat equation. The rod is heated on one end at 273.15k and exposed to ambient temperature on the right end at 268.15k. I am using a time of 1s, 11 grid points and a .002s time step. When I plot it gives me a crazy curve which isn't right. I think I am messing up my initial and boundary conditions. Here is my code.
L=1; t=1; k=.001; n=11; nt=500; dx=L/n; dt=.002; alpha=k*dt/dx^2; T0=273.15*ones(1,n); T1=268.15*ones(1,n); T0(1) = 268.15; T0(end) = 268.15; for j=1:nt T1(2:n-1) = T0(2:n-1) + alpha*(T0(3:n)-2*T0(2:n-1)+T0(1:n-2)); T0=T1; end plot(T1)
  3 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2018 年 8 月 22 日
編集済み: KALYAN ACHARJYA 2018 年 8 月 22 日
What type of curve do you expect? As I have no idea about Heat Transfer
Kuifeng Zhao
Kuifeng Zhao 2018 年 8 月 23 日
If you don't know what you are plotting, how do you know it gives you a curve 'which isn't right'? Then, what is the right thing you want to plot?

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeGeometry and Mesh についてさらに検索

製品


リリース

R2014b

Community Treasure Hunt

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

Start Hunting!

Translated by