Temp_in = 23 ;
d = 0.150;
r = (d/2);
N = (166.69/60);
W = 9000;
L = 0.300 ;
c = 0.00065 ;
C_ratio = r/c;
P = W/(2*r*L);
Slenderness = L/d ;
Tf = Temp_in + 3;
V = 0.0018*exp(-0.026*Tf);
S = ((C_ratio)^2)*((V*N)/P);
if Slenderness == 1
delta_T = (0.349109 + (6.00940*S)+(0.047467*(S^2)))*(P*(10^-6))/0.120;
elseif Slenderness == 1/2
delta_T = (0.394552 + (6.392527*S)-(0.036013*(S^2)))*(P*(10^-6))/0.120;
elseif Slenderness == 1/4
delta_T = 0.933828 + (6.437512*S)- (0.011048*(S^2))*(P*(10^-6))/0.120;
else
delta_T = ((33405*(S)^6)-(51557*(S)^5)+(30669*(S)^4)-(8871.9*(S)^3)+(1297.4*(S)^2)-(85.088*(S))+2.6111)*(P*(10^-6))/0.120;
end
T_average = Temp_in + (delta_T/2);
while abs (Tf-T_average)>0.001
delta = (Tf-T_average)/2;
Tf = Tf-delta;
V = 0.0018*exp(-0.026*Tf);
S = (C_ratio)^2*((V*N)/P);
if Slenderness == 1
delta_T = (0.349109 + (6.00940*S)+(0.047467*(S^2)))*(P*(10^-6))/0.120;
elseif Slenderness == 1/2
delta_T = (0.394552 + (6.392527*S)-(0.036013*(S^2)))*(P*(10^-6))/0.120;
elseif Slenderness == 1/4
delta_T = (0.933828 + (6.437512*S)- (0.011048*(S^2)))*(P*(10^-6))/0.120;
elseif Slenderness > 1
delta_T = ((33405*(S)^6)-(51557*(S)^5)+(30669*(S)^4)-(8871.9*(S)^3)+(1297.4*(S)^2)-(85.088*(S))+2.6111)*(P*(10^-6))/0.120;
end
T_average = Temp_in + (delta_T/2);
disp ('Table for iteration');disp (' Tf V S deltaT T average ');
format shortG
disp ([Tf', V',S',delta_T', T_average',]);
end