Convection-Conduction equation simulation
11 ビュー (過去 30 日間)
古いコメントを表示
Greetings, I have problem involving the convection-conduction equation. This partial differential equation has been lumped into a discrete time - discrete space system that you will see in the nested for loop in the code. The problem is, I'm not sure how to program it correctly. The given initial conditions are shown in the code as well as a what's being input into the system. Any help is appreciated. Please don't be shy if you need more explanation, I will attempt to try.
T = 0.01;
H = 1;
M = 10;
N = 10000;
u = zeros(1,N);
w = 1;
T = .01;
f = 0;
for m = 2:M
for n = 2:N+1
if n >= 10/T && n <=12/T
h = w;
else h = 0;
end
y(n) = h;
f(m,n) = 0;
u(m,1) = 1;
u(1,n) = 1+y(n);
u(4,n) = 1;
u(m,n+1) = u(n,m) - T./H.*(u(m,n) - u(m-1,n)) + T./H.^2.*(u(m+1,n) - 2*u(m,n) + u(m-1,n)) + T*f(m,n);
end
end
% t = T*[0:N];
% plot(t,y)
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Thermal Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!