In [6]:

```
#Variable declaration:
Vx_in = 420 #Entry Velocity in X direction (m/s)
Vx_out = 0 #Exit Velocity in X direction (m/s)
Vy_in = 0 #Entry Velocity in Y direction (m/s)
Vy_out = 420 #Exit Velocity in Y direction (m/s)
m = 0.15 #Rate of water entrained by the steam (kg/s)
lb = 1.0/4.46 #Pound force in a newton force
#Calculations:
Mx_out = m*Vx_out #Rate of change of momentum at entry in x-direction (kg.m)
Mx_in = m*Vx_in #Rate of change of momentum at exit in x-direction (kg.m)
My_out = m*Vy_out #Rate of change of momentum at entry in y-direction (kg.m)
My_in = m*Vy_in #Rate of change of momentum at exit in y-direction (kg.m)
Fxgc = (Mx_out - Mx_in)*lb #Force in X direction (lbf)
Fygc = (My_out - My_in)*lb #Force in X direction (lbf)
#Results:
if Fxgc < 1:
print "The x-direction supporting force acting on the 90° elbow is :",round(-Fxgc,1)," lbf acting toward the left. "
else:
print "The x-direction supporting force acting on the 90° elbow is :",round(Fxgc,1)," lbf acting toward the right. "
if Fygc < 1:
print "The y-direction supporting force acting on the 90° elbow is :",round(-Fygc,1)," lbf acting downwards. "
else:
print "The y-direction supporting force acting on the 90° elbow is :",round(Fygc,1)," lbf acting upwards. "
```

In [4]:

```
from math import sqrt,degrees,atan2
#Variable declaration:
Fx = -63 #Force component in X direction (N)
Fy = 63 #Force component in Y direction (N)
lbf = 0.22481 #Pound-forrce in unit newton (lbf)
#Calculations:
Fr = sqrt(Fx**2 + Fy**2)*lbf #The resultant supporting force (lbf)
u = degrees(atan2(Fy,Fx)) #Angle between the positive x axis and the direction of the force (degrees)
#Result:
if (0<u<90):
print "The supporting force is :",round(Fr,1)," lbf acting at",u,"° i.e in the “northeast” direction."
elif (90<u<180):
print "The supporting force is :",round(Fr,1)," lbf acting at",u,"° i.e in the “northwest” direction."
elif (180<u<270):
print "The supporting force is :",round(Fr,1)," lbf acting at",u,"° i.e in the “southwest” direction."
elif (270<u<360):
print "The supporting force is :",round(Fr,1)," lbf acting at",u,"° i.e in the “southeast” direction."
```

In [7]:

```
#Variable declaration:
R1_in = 10000 #Rate of fuel fed into the boiler (lb/h)
R2_1n = 20000 #Rate of air fed into the boiler (lb/h)
R3_in = 2000 #Rate of methane fed into the boiler (lb/h)
#Calculations:
m_in = R1_in + R2_1n + R3_in #Rate of mass in (lb/h)
m_out = m_in #Rate of mass out (lb/h)
#Result:
print "The rate of the product gases exit from the incinerator is :",round(m_in)," lb/h"
```

In [6]:

```
#Variable declaration:
E1 = 65 #Efficiency of spray tower (%)
E2 = 98 #Efficiency of packed column (%)
m_in = 76 #Mass flow rate of HCl entering the system (lb/h)
#Calculations:
m1_out = (1 - E1/100.0)*m_in #Mass flow rate of HCl leaving the spray tower (lb/h)
m2_out = (1 - E2/100.0)*m1_out #Mass flow rate of HCl entering the packed column (lb/h)
E = (m_in - m2_out)/m_in #Overall fractional efficiency (%)
#Result:
print "The mass flow rate of HCl leaving the spray tower is :",round(m1_out,2)," lb/h HCL"
print "The mass flow rate of HCl entering the packed column is :",round(m2_out,3)," lb/h HCL"
print "The overall fractional efficiency is :",round(E*100,1)," %"
```

In [8]:

```
#Variable declaration:
m1 = 1000 #Flowrate data 1 (lb/min)
m2 = 1000 #Flowrate data 2 (lb/min)
m4 = 200 #Flowrate data 4 (lb/min)
#Calculations:
m5 = m1 + m2 - m4 #Flowrate data 5 (lb/min)
m6 = m2 #Flowrate data 6 (lb/min)
m = m5 - m6 #Flowrate of water lost in operation (lb/min)
#Result:
print "The amount of water lost by evaporation in the operation is", round(m)," lb/min"
```

In [9]:

```
#Variable declaration:
q1 = 1000.0 #Volumetric flowrate from tank 1 (gal/day)
q2 = 1000.0 #Volumetric flowrate from tank 2 (gal/day)
q3 = 2000.0 #Volumetric flowrate from tank 3 (gal/day)
q4 = 200.0 #Volumetric flowrate from tank 4 (gal/day)
q5 = 1800.0 #Volumetric flowrate from tank 5 (gal/day)
q6 = 1000.0 #Volumetric flowrate from tank 6 (gal/day)
C1 = 4.0 #Phosphate concentration in tank 1 (ppm)
C2 = 0.0 #Phosphate concentration in tank 2 (ppm)
C3 = 2.0 #Phosphate concentration in tank 3 (ppm)
C4 = 20.0 #Phosphate concentration in tank 4 (ppm)
C5 = 0.0 #Phosphate concentration in tank 5 (ppm)
C6 = 0.0 #Phosphate concentration in tank 6 (ppm)
Cf = 120000.0 #conversion factor for water (gal/10**6lb)
#Calculations:
C1q1 = C1*q1/Cf #Data 1 (lb/day)
C2q2 = C2*q2/Cf #Data 2 (lb/day)
C3q3 = C3*q3/Cf #Data 3 (lb/day)
C4q4 = C4*q4/Cf #Data 4 (lb/day)
C5q5 = C5*q5/Cf #Data 5 (lb/day)
C6q6 = C6*q6/Cf #Data 6 (lb/day)
#Results:
if (((C1q1 + C2q2) == C3q3) and C3q3 == (C4q4 + C5q5) and C5q5 == C6q6 and C2q2 == C6q6):
print "The data appear to be consistent ."
else:
print "The data appear to be inconsistent ."
```

In [10]:

```
#Variable declaration:
Dz = 3000 #Height (ft)
V0 = 500000 #Flowrate of water (gal/min)
n = 30 #Turbine efficiency (%)
m = 0.3048 #Meters in a feet
m3 = 0.00378 #Meters-cube in a gallon
g = 9.8 #Gravitational acceleration (m/s^2)
gc = 1 #Conversion factor
MW = 10**(-6) #Megawatt in newton-meter-per-second
#Calculations:
V1 = (V0*m3)*1000.0/60.0 #The mass flow rate of the water in kilograms/second (kg/s)
DPE = V1*g*Dz*m/gc*MW #The loss in potential energy (MW)
AP = n/100.0*DPE #The actual power output (MW)
#Result:
print "The power generated by the lake located is :",round(AP,1)," MW"
```

In [11]:

```
#Variable declaration:
n = 111.4 #Flowrate of air stream (lbmol/min)
H1 = 1170 #Average heat capacity at 200°F (Btu/lbmol)
H2 = 4010 #Average heat capacity at 600°F (Btu/lbmol)
#Calculation:
Q = n*(H2 - H1) #The heat transfer rate (Btu/min)
#Result:
print "The heat transfer rate required is:",round(Q/10**5,2)," x 10**5 Btu/min"
```

In [12]:

```
#Variable declaration:
n = 600 #The mass flow rate of fluid (lbmol/min)
Cp_AV = 0.271 #Heat capacity (Btu/lbmol . °F)
T1 = 200 #Initial temperature(°F)
T2 = 600 #Final temperature(°F)
#Calcultaion:
Q = n*Cp_AV*(T2 - T1) #The required heat rate (Btu/min)
#Result:
print "The required heat rate is :",round(Q,-2)," Btu/min"
```

In [13]:

```
#Variable declaration:
T_c1 = 20 #Initial cold fluid temperature (°C)
T_h1 = 82 #Initial hot fluid temperature (°C)
T_h2 = 94 #Final hot fluid temperature (°C)
#Calculation:
T_c2 = (T_h2 - T_h1 + T_c1) #Final cold fluid temperature (°C)
#Result:
print "The heat transfer rate is:",round(T_c2)," °C"
print "There is a printing mistake in book regarding unit of the final result."
```

In [14]:

```
#Variable declaration:
Q = -5.5*10**6 #The heat transferred out from the gas (W)
Cp = 1090.0 #The average heat capacity of the gas (J/(kg . °C))
m = 9.0 #The gas mass flow rate (kg/s)
T1 = 650 #The gas inlet temperature (°C)
#Calculation:
T2 = Q/(m*Cp)+T1 #The gas outlet temperature (°C)
#Result:
print "The gas outlet temperature is :",round(T2)," °C"
```

In [15]:

```
#Variable declaration:
n = 3500.0 #Inlet flowrate of water (gal/min)
Cp_W = 75.4 #Heat capacity of water (J/(gmol . °C)
p = 62.4 #Density of water (lb/ft^3)
M = 24*60.0 #Minutes in a day (min/day)
G = 7.48 #Gallons in a feet cube (gal/ft^3)
gm = 454.0 #Grams in a pound (g/lb)
J = 1054.0 #Joules in a Btu (J/Btu)
g = 18.0 #Grams in a gmol (g/gmol)
F = 1.8 #Degree fahrenheit in a degree celcius (°F)
Ti = 38.0 #Initial temperature (°F)
Tf = 36.2 #Final temperature (°F)
#Calculations:
T= Ti-Tf #Temperature loss (°F)
m = n*p*M/G #Mass flow rate of water (lb/day)
Cp = Cp_W*gm/J/g/F #Heat capacity in cosistent units (Btu/(lb.°F))
Q = m*Cp*T #Rate of heat flow from water (Btu/day)
#Result:
print "The rate of Btu removed from the water per day is :",round(Q/10**8,2)," x 10**8 Btu/day ."
print "There is a calculation mistake in the book regarding the final result."
```