#Calculate the heat transferred from the system
#initialization of varaibles
mO=1.33
CO=0.155
mC=3.67
CC=0.165
t2=1000. #F
tb=68. #F
t1=300. #F
mC2=1.
CC2=0.17
mO2=4.
CO2=0.155
H=-14087 #B/lb
#calculations
dE2=mO*CO*(t2-tb) + mC*CC*(t2-tb)
dE1=mO2*CO2*(tb-t1) + mC2*CC2*(tb-t1)
Q=dE2+dE1+H
#results
print '%s %d %s' %("Heat transfer from the system =",Q,"Btu")
#calculate the cp value of methane
#initialization of varaibles
H1=17889 #Cal/g
H2=-94052 #Cal/g
H3=2* -68317 #Cal/g
#calculations
x=H1+H2+H3
#results
print '%s %d %s' %("Constant pressure heating value of methane =",x," cal/gm formula wt.")
#calculate the cv value of methane
#initialization of varaibles
HV=4344 #B/lb
xC=56 #lb
R=1.986
T=530 #R
MC=56 #g/mol
#calculations
HR=xC*HV
Eb=-HR -R*T*(2-3)
HV=-Eb/MC
#results
print '%s %d %s' %("COnstant volume heating value =",HV,"B/lb ")
#Calculate the products temperature
#initialization of varaibles
dH2=14087 #B/lb
xc=3.67 #lb
xN=8.78 #lb
tb=100 #F
#calculations
dt2=dH2/(xc*0.196 + xN*0.248)
t2=dt2+tb
#results
print '%s %d %s' %("products temperature =",t2,"F")
#Calculate the efficiency
#initialization of varaibles
Heat=14087 #Btu/lb
x1=0.9 #lb
x2=0.05 #lb
x3=0.05 #lb
Heat2=3952 #Btu/lb
#calculations
h1=x1*Heat
h2=x2*Heat2
e=(h1+h2)/Heat
#results
print '%s %.2f' %("Efficiency = ",e)
#calculate the efficiency of the process
#initialization of varaibles
print '%s' %("From data and steam tables,")
Q=10240000. #B/hr
w=700. #lb/hr
h=19500. #B/lb
#calculations
HV=w*h
e=Q/HV
#results
print '%s %.2f' %("Efficiency = ",e)