#initialisation of variables
w= 20. #lbm/sec plant rate
sh= 0.004
mw2= 0.12 #lbm/sec stream rate
ma3= 12.2 #lbm/sec rates of air
mw3= 0.130 #lbm/sec water rate
#CALCULATIONS
mw1= w/((1/sh)+1)
ma1= w-mw1
ma4= ma1-ma3
mw4= mw1+mw2-mw3
mr= ma4+mw4
sh1= mw4/ma4
#RESULTS
print ' mw1 = %.4f lbm/sec'%(mw1)
print ' ma1 = %.2f lbm/sec'%(ma1)
print ' ma4 = %.2f lbm/sec'%(ma4)
print ' mw4 = %.4f lbm/sec'%(mw4)
print ' mr = %.2f lbm/sec'%(mr)
print ' specific humidity = %.5f lbm/sec'%(sh1)
import math
#initialisation of variables
w= 62.4 #lbf/ft**3 fluid density
g= 32.2 #ft/sec**2
v= 86.5 #ft/sec velocity
d2= 3. #in
d1= 6. #in
dp= 50. #lbf/in**2 gauge pressure
#CALCULATIONS
Fb= ((math.pi*(w/g)*v**2*(1/d1)**2*(1-(d2/d1)**2)*0.25)-dp*144*(math.pi/4)*(1/d2)**2)
#RESULTS
print 'Load on the bolts = %.f lbf'%(Fb)
import math
#initialisation of variables
F1= 237. #lb
dp= 50. #lbf/in**2
D= 6. #in diameter
#CALCULATIONS
F2= dp*144*(math.pi/4)*(D/12)**2
Fb= F1-F2
#RESULTS
print 'Load on the bolts = %.f lbf'%(Fb)
#rounding-off error
import math
#initialisation of variables
w1= 0.0286 #lbm/ft**3 density
v= 2500. #ft/sec velocity
A= 2.5 #ft**3 area
k= 0.015
p2= 700. #lbf/ft**2
p1= 628. #lbf/ft**2 pressure
v2= 3500. #ft/sec outlet
g= 32.17 #ft/sec**2
#CALCULATIONS
ma= w1*v*A
mf= round(k*ma,2)
mt= round(ma+mf,1)
F= (p2-p1)*A+(mt*v2/g)-(ma*v/g)
#RESULTS
print ' air mass flow rate = %.2f lbm/sec'%(ma)
print ' Fuel flow rate = %.2f lbm/sec'%(mf)
print ' Fuel flow rate at station 2 = %.2f lbm/sec'%(mt)
print ' Thrust force = %d lbf'%(round(F,-1))