In: Other
A metal bar of length 30 cm, is initially at 25 oC. Then through an electrical wire heat is generated at a rate of 0.5 cal/cm3s. The left end (x = 0 cm ) is contacted with a medium at 10 oC. At the right end there is a heat loss due to the air convection at a flux of 0.6 cal/cm2s. The physical properties are, k = 2 cal/cm oC s, r = 8 g/cm3, Cp = 0.2 cal/g oC.
Use M = 0.25, Dx = 5 cm. Solve the model numerically to find the temperature at the length of 22.5 cm after 10 seconds.
he MATLAB code and it's result is
close all;clear all;clc;
for i=1:7
T(i,1)=25;
end
for j=1:41
T(1,j)=10;
end
for j=1:41
for i=2:6
T(i,j+1)=(0.25*(((1.25/25)*(T(i+1,j)-(2*T(i,j))+T(i-1,j)))-0.3125))+T(i,j);
end
T(7,j)=(-0.3*5)+T(6,j);
end
T(5,:);
T(6,:);
for j=1:41
T(8,j)=(T(5,j)+T(6,j))/2
end
fprintf('value of T after 10 seconds is %f degree C',T(8,end));
value of T after 10 seconds is 0.000000 degree C>>