#Calculate the work done and power of the system
#Initialization of variables
rate= 5 #lbm/sec
Q=50. #Btu/s
h2=1020. #Btu/lbm
h1=1000. #Btu/lbm
V2=50. #ft/s
V1=100. #ft/s
J=778.
g=32.2 #ft/s^2
gc=g
Z2=0
Z1=100. #ft
#calculations
dw=Q/rate -(h2-h1) -(V2*V2- V1*V1)/(2*gc*J) -g/gc *(Z2-Z1)/J
power=dw*rate
#results
print '%s %.1f %s' %("work done by the system =",dw,"Btu/lbm")
print '%s %.1f %s' %("\n Power =",power,"Btu/s")
#calculate the area of the inlet pipe
#Initialization of variables
V=100. #ft/s
v=15. #lbm/ft^3
m=5. #lbm/s
#calculations
A=m*v/V
#results
print '%s %.2f %s' %("Area of inlet pipe =",A,"ft^2")