# Variables
Q1 = -1227 #kcal
R = 2*10**-3 #kcal
T = 25 #C
dn = -2
# Calculations
Qp = Q1+R*(273+T)*dn
# Results
print 'Heat of reaction = %.1f kcal'%(Qp)
# Variables
H1 = -337.3 #kcal
H2 = -68.3 #kcal
H3 = -372.8 #kcal
# Calculations
Ht = H1+H2-H3
# Results
print 'Heat change of reaction = %.1f kcal'%(Ht)
# Variables
dH = -1228.2 #kcal
n1 = 10
n2 = 4
dH1 = -94.05 #kcal
dH2 = -68.32 #kcal
# Calculations
x = n1*dH1+n2*dH2-dH
# Results
print 'Heat of formation = %.1f kcal'%(x)
# Variables
H1 = -29.6 #kcal
H2 = -530.6 #kcal
H3 = -94 #kcal
H4 = -68.3 #kcal
# Calculations
dH1 = -(H1+H2-3*H3-4*H4)
dH2 = -dH1+3*H3+3*H4
# Results
print 'Heat of combustion = %.f kcal'%(dH1)
print ' Standard heat of formation = %.1f kcal'%(dH2)
# Variables
T1 = 25. #C
T2 = 100. #C
dH1 = -57.8 #kcal
Cp1 = 8.03 #cal deg**-1
Cp2 = 6.92 #cal deg**-1
Cp3 = 7.04 #cal deg**-1
# Results
Cp = Cp1-(Cp2+0.5*Cp3)
dH2 = Cp*10**-3*(T2-T1)+dH1
# Results
print 'Standard heat of formation = %.2f kcal mole**-1'%(dH2)
# Variables
a = -2.776
b = 0.947*10**-3
c = 0.295*10**-6
T1 = 373 #K
T2 = 298 #K
dH1 = -57.8 #kcal
# Calculations
dH = a*(T1-T2)+0.5*b*(T1**2-T2**2)+0.33*c*(T1**3-T2**3)
dH2 = dH1+(dH/1000)
# Results
print 'Heat obtained = %.f cal '%(dH)
print ' Smath.tanadard heat of formation = %.2f kcal mole**-1'%(dH2)
# Variables
a1 = 6.189
a2 = 3.225
a3 = 10.421
b1 = 7.787*10**-3
b2 = 0.707*10**-3
b3 = -0.3*10**-3
c1 = -0.728*10**-6
c2 = -0.04014*10**-6
c3 = 0.7212*10**-6
dH = -9.13 #kcal
# Calculations
a = -(a2+a3-a1)*10**-3
b = -0.5*(b2+b3-b1)*10**-3
c = -0.33*(c2+c3-c1)*10**-3
# Results
print 'a = %.2e kcal mole**-1'%(a)
print ' b = %.2e kcal mole**-1'%(b)
print ' c = %.2e kcal mole**-1'%(c)
print ' dH = %.2f kcal mole**-1'%(dH)
# note : rounding off error.
# Variables
dH = 31.39 #kcal
k1 = 3.397*10**-3 #kcal K**-1
k2 = -1.68*10**-6 #kcal K**-2
k3 = -0.022*10**-9 #kcal K**-3
k4 = 1.17*10**2 #kcal K
T = 25 #C
#CALCULTIONS
H = dH-(k1*(273+T)+k2*(273+T)**2+k3*(273+T)**3+k4*(273+T)**-1)
# Results
print 'Change in enthalpy = %.2f kcal'%(H)
from numpy import *
# Variables
dH = 214470 #kcal mole**-1
a = 72.43 #calmole**-1deg**-1
b = 13.08*10**-3 #kcalmole**-1
c = -1.172*10**-6 #kcalmole**-1
# Calculations
vec =roots([c,b,a,-dH])
T = vec[2]
# Results
print 'Temperature = %.f C'%(T+15)
# note : rounding off error because of roots()
# Variables
c1 = 9.3 #cal deg**-1
c2 = 6.3 #cal deg**-1
n = 2.
dH = -57500. #cal
V = 3. #cc
v1 = 3.5 #cc
T1 = 25. #C
p1 = 1. #atm
# Calculations
T2 = (-dH/(c1+n*c2))+298
p2 = p1*V*T2/(v1*(273+T1))
# Results
print 'Temperature final = %.f K'%(round(T2,-1))
print ' pressure final = %.1f atm'%(p2)
# Variables
Hc = 234.4 #kcal
Hdc = 300 #kcal
Hch = 436.5 #kcal
Hco = 152 #kcal
Hsco = 70 #kcal
Hoh = 110.2 #kcal
Hoo = 885 #kcal
Hb = 38 #kcal
Hc = 28 #kcal
Ha = 206 #kcal
H1co = 2128 #kcal
H1oh = 661 #kcal
H1c = 231 #kcal
# Calculations
dH = Hc+Hdc+Hch+Hco+Hsco+Hoh+Hoo+Ha+Hb+Hc-H1co-H1oh-H1c
# Results
print 'Heat of combustion = %.f kcal'%(dH)