#initialization
P = 500 #lb/in^2
T = 800+460.0 #R
Pf = 1.0 #lb/in^2
#calculation
#From table 4 of appendix
ht1 = 69.7
vt1 = 0.01614
W = vt1*(P-Pf)*144
ht2 = W/778 +ht1
ht3 = 1412.1
s3 = 1.6571
ht4 = 925.8
WbyJ = ht3-ht4
W3 = 778*WbyJ
dW = W3-W
eta = 1-((ht4-ht1)/(ht3-ht2))
#result
print "Neglecting pump work, Work = %d ft-lb/lbm" %W3
print "Considering pump work, Work = %d ft-lb/lbm" %dW
print "Considering pump work, Thermal efficiency = %.3f" %(eta-0.001)
print "Neglecting pump work, Thermal efficiency = 0.362"
#initialization
P1 = 400.0 #lb/in^2
T1 = 800+460.0 #R
Pt1 = 1.0 #lb/in^2
T2 = 95+460.0 #R
Pt2 = 500.0 #lb/in^2
es = 0.8
ep = 0.75
et = 0.8
#calculation
#From Appendix steam tables and mollier chart
ht1 = 62.98
ht3 = 1416.4
ht4s = 941.1
vt1 = 0.0161
WbyJ = vt1*(Pt2-Pt1)/(ep*778)
ht2 = WbyJ+ht1
Q = (ht3-ht2)/et
WtbyJ = et*(ht3-ht4s)
dW = 778*(WtbyJ-WbyJ)
eta = WtbyJ/Q
#result
print "Thermal efficiency = %.3f" %eta
print "Specific net work = %d B/lbm" %dW
#initialization
P1 = 500 #lb/in^2
T1 = 800 #F
#calculation
#From steam tables
ht1 = 69.7
ht3 = 1412.1
s3 = 1.6571
ht4 = 1175
Pt4 = 53
ht5 = 1430
s5 = 1.917
ht6 = 1070
X6 = 0.966
Wsum = 778*(ht3-ht4+ht5-ht6)
Qsum = ht3-ht1+ht5-ht4
eta = Wsum/(778*Qsum)
#result
print "Specific work = %d ft-lb/lbm" %Wsum
print "Thermal efficiency = %.3f " %eta
#initialization
# From steam tables
ht1 = 218.12
ht3 = 1412.1
st3 = 1.6571
ht4 = 1134.6
ht5 = 925.8
ht6 = 69.7
#calculation
w = (ht1-ht6)/(ht4-ht6)
WbyJ = ht3-ht4+(1-w)*(ht4-ht5)
W = 778*WbyJ
Q = ht3-ht1
eta = WbyJ/Q
#result
print "Specific work = %d ft-lb/lbm" %W
print "Efficiency = %.3f" %eta