您在這裡

Example 2.17

8 十月, 2015 - 17:29

The long statements are split to make it easier to read. However, despite the use of descriptive variable names, it is hard to understand what this script does, see the following Command Window output:

    t_water=80;
t_outside=15;
inner_dia=0.05;
thickness=0.006;
Lambda_steel=48;
AlfaInside=2800;
AlfaOutside=17;
thickness_insulation=0.012;
Lambda_insulation=0.03;

r_i=inner_dia/2
r_o=r_i+thickness
r_i_insulation=r_o
r_o_insulation=r_i_insulation+thickness_insulation
AreaInside=2*pi*r_i
AreaOutside=2*pi*r_o
AreaOutside_insulated=2*pi*r_o_insulation
AreaM_pipe=(2*pi*(r_o-r_i))/log(r_o/r_i)
AreaM_insulation=(2*pi*(r_o_insulation-r_i_insulation)) ...
    /log(r_o_insulation/r_i_insulation)
TotalResistance=(1/(AlfaInside*AreaInside))+ ...
    (thickness/(Lambda_steel*AreaM_pipe))+(1/(AlfaOutside*AreaOutside))
TotalResistance_insulated=(1/(AlfaInside*AreaInside))+ ...
    (thickness/(Lambda_steel*AreaM_pipe))+(thickness_insulation ...
    /(Lambda_insulation*AreaM_insulation))+(1/(AlfaOutside*AreaOutside_insulated))
Q_dot=(t_water-t_outside)/(TotalResistance*1000)
Q_dot_insulated=(t_water-t_outside)/(TotalResistance_insulated*1000)
PercentageReducttion=((Q_dot-Q_dot_insulated)/Q_dot)*100