# Variables
m = 1.
he = 1148.8 #B/lbm
hi = 1357. #B/lbm
Ve = 100. #ft/sec
Vi = 800. #ft/sec
# Calculations
dW = m*(he-hi) + m*(Ve**2 - Vi**2)/(2*32.2*778)
dWhr = dW*3600
hp = -dWhr/2545.
# Results
print "Horsepower output = %d hp"%(hp+1)
# Variables
rate = 80. #lbm/min
T1 = 100. #F
P1 = 100. #psia
P2 = 1000. #psia
# Calculations
v = 0.01613 #ft**3/lbm
W = rate*(P2-P1)*144*v
# Results
print "Work done = %.2f ft-lbf/min"%(round(W,-3))
# Variables
hi = 1279.1 #B/lbm
# Calculations
u2 = hi
T2 = 564. #F
# Results
print "Temperature of steam = %d F"%(T2)
# Variables
import math
P1 = 20. #psia
P2 = 100. #psia
V = 3. #ft**3
T = 560. #R
ma = 0.289
# Calculations
ma = P1*V/(53.35*T)
Wa = -ma*53.35*T*math.log(P1/P2)
Qa = -Wa
Va2 = 3/5.
V2s = V-Va2
hi = 1279.1 #B/lbm
T2s = 536. #F
# Results
print "Final temperature = %d F"%(T2s)
import math
# Variables
P1 = 200. #psia
P2 = 100. #psia
T1 = 300.+460 #R
g = 1.4
cp = 0.24
# Calculations
T2 = (T1)*(P2/P1)**((g-1)/g)
V2 = math.sqrt(2*32.2*778*cp*(T1-T2))
# Results
print "Final velocity = %d ft/sec"%(V2)
# check answer using calculator
# Variables
T1 = 500.+460 #R
P1 = 50. #psia
P2 = 15. #psia
g = 1.4
cp = 0.24
# Calculations
T2 = T1*(P2/P1)**((g-1)/g)
W = cp*(T2-T1) + (T1-460)**2 /(2*32.2*778)
# Results
print "Net work output from turbine = %.1f B/lbm"%(W)
# Variables
T1 = 150.+460 #R
T1 = 40.+460 #R
# Calculations
h2 = 43.850 #B/lbm
hf2 = 17.273
hfg2 = 64.163
x2 = (h2-hf2)/hfg2
# Results
print "Quality of freon vapor = %.3f"%(x2)