#calculate the molecule
#Initialization of variables
per=85.
#calculations
a=per/12.
b=100-per
ad=1.13*a
bd=1.13*b
#results
print '%s %d %s %d' %("Molecule is C",ad, "H",bd+1)
#calculate the Oxygen and Nitrogen compositions and also the molecule
#Initialization of variables
per=0.071
#calculations
O2=8.74
N2=per/2. + 3.76*O2
Nin=32.85
CO2=7.333
H2o=3
So2=0.0312
#results
print '%s %.2f %s %.2f'%("Oxygen =",O2," and Nitrogen =",N2)
print '%s %.3f %s %d %s %.2f %s %.2f %s %.3f %s %d %s %.5f %s %.2f %s' %("\n Equation is C",CO2, "H",2*H2o,"+",O2," O2 +",Nin," N2 = ",CO2,"CO2 +",H2o,"H2O +",So2," SO2 +",N2,"N2")
#calculate the air fuel ratio
#Initialization of variables
N2=78.1
M=29
co2=8.7
co=8.9
x4=0.3
x5=3.7
x6=14.7
#calculations
O2=N2/3.76
Z=(co2+co+x4)/8.
AF=(O2+N2)*M/(Z*113.)
#results
print '%s %.1f %s' %("Air fuel ratio =",AF,"lbm air/lbm fuel")
#calculate the air fuel ratio
#Initialization of variables
N2=78.1
M=29
ba=2.12
x4=0.3
x5=3.7
x6=14.7
#calculations
O2=N2/3.76
O2=N2/3.76
Z=(x4*4+x5*2+x6*2)/17.
AF=(O2+N2)*M/(Z*113.)
#results
print '%s %.1f %s' %("Air fuel ratio =",AF,"lbm air/lbm fuel")
#calculate the air fuel ratio
#Initialization of variables
N2=78.1
M=29
ba=2.12
x4=0.3
x5=3.7
x6=14.7
#calculations
O2=N2/3.76
c=14.7
b= x4*4 + x5*2 + x6*2
a=b/ba
AF=(O2+N2)*M/(a*12 + b)
#results
print '%s %.1f %s' %("Air fuel ratio =",AF,"lbm air/lbm fuel")
#calculate the air fuel ratio
#Initialization of variables
N2=78.1
M=29
ba=2.12
co2=8.7
co=8.9
x4=0.3
x5=3.7
x6=14.7
#calculations
O2=N2/3.76
c=14.7
Z=2.238
X=(Z*17-x4*4-x5*2)/2
a=co2+co/2+x4+x6/2
b=3.764*a
AF=(O2+N2)*M/(Z*113)
#results
print '%s %.1f %s' %("Air fuel ratio =",AF,"lbm air/lbm fuel")
#calculate the air fuel ratio
#Initialization of variables
x1=8.7
x2=8.9
x3=0.3
N=78.1
z=113
M=29
#calculations
co2=(x1+x2+x3)*100/(N+x1+x2+x3)
a=2.325
AF=103*M/(a*z)
#results
print '%s %.2f %s' %("Air fuel ratio =",AF,"lbm air/lbm fuel")
#calculate the higher heating value
#Initialization of variables
dH=-2369859. #Btu
r=1.986
dn=5.5
T=536.7 #R
#calculations
dQ=dH+dn*r*T
#results
print '%s %d %s' %("Higher heating value =",dQ,"Btu")
#calculate the lower heating value
#Initialization of variables
y=13.
x=12.
M2=18.
M=170.
p=0.4593
vfg=694.9
J=778.2
m=9*18
u1=-2363996 #Btu
#calculations
z=y*M2/M
hfg=1050.4 #Btu/lbm
ufg= hfg- p*vfg*144/J
dU=ufg*m
Lhv=u1+dU
#results
print '%s %d %s' %("Lower heating value =",Lhv," Btu/lbm")
#calculate the heat of reaction
#Initialization of variables
n1=8.
n2=9.
n3=1.
n4=12.5
U11=3852.
U12=115.
U21=3009.
U22=101.
U31=24773.
U32=640.
U41=2539.
U42=83.
H=-2203389.
#calculations
dU1=n1*(U11-U12)+n2*(U21-U22)
dU2=n3*(U31-U32)+n4*(U41-U42)
Q=H+dU1-dU2
#results
print '%s %d %s' %("Heat of reaction =",Q,"Btu")
#calculate the final temperature
#Initialization of variables
n1=8
n2=9
n3=47
h1=118
h2=104
h3=82.5
Q=2203279 #Btu
#calculations
U11=n1*h1+n2*h2+n3*h3
U12=U11+Q
T2=5271 #R
#results
print '%s %d %s' %("Upon interpolating, T2 =",T2," R")