#Variable Declaration
dHcCH4 = -891.0 #Std. heat of combustion for CH4, kJ/mol
dHcC8H18 = -5471.0 #Std. heat of combustion for C8H18, kJ/mol
T = 298.15
SmCO2, SmCH4, SmH2O, SmO2, SmC8H18 = 213.8,186.3,70.0,205.2, 316.1
dnCH4 = -2.
dnC8H18 = 4.5
R = 8.314
#Calculations
dACH4 = dHcCH4*1e3 - dnCH4*R*T - T*(SmCO2 + 2*SmH2O - SmCH4 - 2*SmO2)
dAC8H18 = dHcC8H18*1e3 - dnC8H18*R*T - T*(8*SmCO2 + 9*SmH2O - SmC8H18 - 25.*SmO2/2)
#Results
print 'Maximum Available work through combustion of CH4 %4.1f kJ/mol'%(dACH4/1000)
print 'Maximum Available work through combustion of C8H18 %4.1f kJ/mol'%(dAC8H18/1000)
#Variable Declaration
dHcCH4 = -891.0 #Std. heat of combustion for CH4, kJ/mol
dHcC8H18 = -5471.0 #Std. heat of combustion for C8H18, kJ/mol
T = 298.15
SmCO2, SmCH4, SmH2O, SmO2, SmC8H18 = 213.8,186.3,70.0,205.2, 316.1
dnCH4 = -2.
dnC8H18 = 4.5
R = 8.314
#Calculations
dGCH4 = dHcCH4*1e3 - T*(SmCO2 + 2*SmH2O - SmCH4 - 2*SmO2)
dGC8H18 = dHcC8H18*1e3 - T*(8*SmCO2 + 9*SmH2O - SmC8H18 - 25.*SmO2/2)
#Results
print 'Maximum nonexapnasion work through combustion of CH4 %4.1f kJ/mol'%(dGCH4/1000)
print 'Maximum nonexapnasion work through combustion of C8H18 %4.1f kJ/mol'%(dGC8H18/1000)
#Variable Declaration
dGf298 = 370.7 #Std. free energy of formation for Fe (g), kJ/mol
dHf298 = 416.3 #Std. Enthalpy of formation for Fe (g), kJ/mol
T0 = 298.15 #Temperature in K
T = 400. #Temperature in K
R = 8.314
#Calculations
dGf = T*(dGf298*1e3/T0 + dHf298*1e3*(1./T - 1./T0))
#Results
print 'Std. free energy of formation for Fe(g) at 400 K is %4.1f kJ/mol'%(dGf/1000)
from math import log
#Variable Declaration
nHe = 1.0 #Number of moles of He
nNe = 3.0 #Number of moles of Ne
nAr = 2.0 #Number of moles of Ar
nXe = 2.5 #Number of moles of Xe
T = 298.15 #Temperature in K
P = 1.0 #Pressure, bar
R = 8.314
#Calculations
n = nHe + nNe + nAr + nXe
dGmix = n*R*T*((nHe/n)*log(nHe/n) + (nNe/n)*log(nNe/n) +(nAr/n)*log(nAr/n) + (nXe/n)*log(nXe/n))
dSmix = n*R*((nHe/n)*log(nHe/n) + (nNe/n)*log(nNe/n) +(nAr/n)*log(nAr/n) + (nXe/n)*log(nXe/n))
#Results
print 'Std. free energy Change on mixing is %3.1e J'%(dGmix)
print 'Std. entropy Change on mixing is %4.1f J'%(dSmix)
#Variable Declaration
dGfFe = 0.0 #Std. Gibbs energy of formation for Fe (S), kJ/mol
dGfH2O = -237.1 #Std. Gibbs energy of formation for Water (g), kJ/mol
dGfFe2O3 = -1015.4 #Std. Gibbs energy of formation for Fe2O3 (s), kJ/mol
dGfH2 = 0.0 #Std. Gibbs energy of formation for Hydrogen (g), kJ/mol
T0 = 298.15 #Temperature in K
R = 8.314
nFe, nH2, nFe2O3, nH2O = 3,-4,-1,4
#Calculations
dGR = nFe*dGfFe + nH2O*dGfH2O + nFe2O3*dGfFe2O3 + nH2*dGfH2
#Results
print 'Std. Gibbs energy change for reaction is %4.2f kJ/mol'%(dGR)
#Variable Declaration
dGR = 67.0 #Std. Gibbs energy of formation for reaction, kJ, from previous problem
dHfFe = 0.0 #Enthalpy of formation for Fe (S), kJ/mol
dHfH2O = -285.8 #Enthalpy of formation for Water (g), kJ/mol
dHfFe2O3 = -1118.4 #Enthalpy of formation for Fe2O3 (s), kJ/mol
dHfH2 = 0.0 #Enthalpy of formation for Hydrogen (g), kJ/mol
T0 = 298.15 #Temperature in K
T = 525. #Temperature in K
R = 8.314
nFe, nH2, nFe2O3, nH2O = 3,-4,-1,4
#Calculations
dHR = nFe*dHfFe + nH2O*dHfH2O + nFe2O3*dHfFe2O3 + nH2*dHfH2
dGR2 = T*(dGR*1e3/T0 + dHR*1e3*(1./T - 1./T0))
#Results
print 'Std. Enthalpy change for reactionat %4.1f is %4.2f kJ/mol'%(T, dHR)
print 'Std. Gibbs energy change for reactionat %4.1f is %4.0f kJ/mol'%(T, dGR2/1e3)
from math import log
#Variable Declaration
dGfNO2 = 51.3 #Std. Gibbs energy of formation for NO2 (g), kJ/mol
dGfN2O4 = 99.8 #Std. Gibbs energy of formation for N2O4 (g), kJ/mol
T0 = 298.15 #Temperature in K
pNO2 = 0.350 #Partial pressure of NO2, bar
pN2O4 = 0.650 #Partial pressure of N2O4, bar
R = 8.314
nNO2, nN2O4 = -2, 1 #Stoichiomentric coeff of NO2 and N2O4 respectively in reaction
#Calculations
dGR = nN2O4*dGfN2O4*1e3 + nNO2*dGfNO2*1e3 + R*T0*log(pN2O4/(pNO2)**2)
#Results
print 'Std. Gibbs energy change for reaction is %5.3f kJ/mol'%(dGR/1e3)
from math import exp
#Variable Declaration
dGfCO2 = -394.4 #Std. Gibbs energy of formation for CO2 (g), kJ/mol
dGfH2 = 0.0 #Std. Gibbs energy of formation for H2 (g), kJ/mol
dGfCO = 237.1 #Std. Gibbs energy of formation for CO (g), kJ/mol
dGfH2O = 137.2 #Std. Gibbs energy of formation for H24 (l), kJ/mol
T0 = 298.15 #Temperature in K
R = 8.314
nCO2, nH2, nCO, nH2O = 1,1,1,1 #Stoichiomentric coeff of CO2,H2,CO,H2O respectively in reaction
#Calculations
dGR = nCO2*dGfCO2 + nH2*dGfH2 + nCO*dGfCO + nH2O*dGfH2O
Kp = exp(-dGR*1e3/(R*T0))
#Results
print 'Std. Gibbs energy change for reaction is %5.3f kJ/mol'%(dGR/1e3)
print 'Equilibrium constant for reaction is %5.3f '%(Kp)
if Kp > 1: print 'Kp >> 1. hence, mixture will consists of product CO2 and H2'
from math import exp, sqrt
#Variable Declaration
dGfCl2 = 0.0 #Std. Gibbs energy of formation for CO2 (g), kJ/mol
dGfCl = 105.7 #Std. Gibbs energy of formation for H2 (g), kJ/mol
dHfCl2 = 0.0 #Std. Gibbs energy of formation for CO (g), kJ/mol
dHfCl = 121.3 #Std. Gibbs energy of formation for H24 (l), kJ/mol
T0 = 298.15 #Temperature in K
R = 8.314
nCl2, nCl= -1,2 #Stoichiomentric coeff of Cl2,Cl respectively in reaction
PbyP0 = 0.01
#Calculations
dGR = nCl*dGfCl + nCl2*dGfCl2
dHR = nCl*dHfCl + nCl2*dHfCl2
func = lambda T: exp(-dGR*1e3/(R*T0) - dHR*1e3*(1./T - 1./T0)/R)
Kp8 = func(800)
Kp15 = func(1500)
Kp20 = func(2000)
DDiss = lambda K: sqrt(K/(K+4*PbyP0))
alp8 = DDiss(Kp8)
alp15 = DDiss(Kp15)
alp20 = DDiss(Kp20)
#Results
print 'Part A'
print 'Std. Gibbs energy change for reaction is %5.3f kJ/mol'%(dGR)
print 'Std. Enthalpy change for reaction is %5.3f kJ/mol'%(dHR)
print 'Equilibrium constants at 800, 1500, and 2000 K are %4.3e, %4.3e, and %4.3e'%(Kp8,Kp15,Kp20)
print 'Part B'
print 'Degree of dissociation at 800, 1500, and 2000 K are %4.3e, %4.3e, and %4.3e'%(alp8,alp15,alp20)
from math import exp
#Variable Declaration
dGfCaCO3 = -1128.8 #Std. Gibbs energy of formation for CaCO3 (s), kJ/mol
dGfCaO = -603.3 #Std. Gibbs energy of formation for CaO (s), kJ/mol
dGfCO2 = -394.4 #Std. Gibbs energy of formation for O2 (g), kJ/mol
dHfCaCO3 = -1206.9 #Std. Enthalpy Change of formation for CaCO3 (s), kJ/mol
dHfCaO = -634.9 #Std. Enthalpy Change of formation for CaO (s), kJ/mol
dHfCO2 = -393.5 #Std. Enthalpy Change of formation for O2 (g), kJ/mol
T0 = 298.15 #Temperature in K
R = 8.314
nCaCO3, nCaO, nO2 = -1,1,1 #Stoichiomentric coeff of CaCO3, CaO, O2 respectively in reaction
#Calculations
dGR = nCaO*dGfCaO + nO2*dGfCO2 + nCaCO3*dGfCaCO3
dHR = nCaO*dHfCaO + nO2*dHfCO2 + nCaCO3*dHfCaCO3
func = lambda T: exp(-dGR*1e3/(R*T0) - dHR*1e3*(1./T - 1./T0)/R)
Kp10 = func(1000)
Kp11 = func(1100)
Kp12 = func(1200)
#Results
print 'Std. Gibbs energy change for reaction is %4.1f kJ/mol'%(dGR)
print 'Std. Enthalpy change for reaction is %4.1f kJ/mol'%(dHR)
print 'Equilibrium constants at 1000, 1100, and 1200 K are %4.4f, %4.3fe, and %4.3f'%(Kp10,Kp11,Kp12)
from math import exp
#Variable Declaration
dGfCG = 0.0 #Std. Gibbs energy of formation for CaCO3 (s), kJ/mol
dGfCD = 2.90 #Std. Gibbs energy of formation for CaO (s), kJ/mol
rhoG = 2.25e3 #Density of Graphite, kg/m3
rhoD = 3.52e3 #Density of dimond, kg/m3
T0 = 298.15 #Std. Temperature, K
R = 8.314 #Ideal gas constant, J/(mol.K)
P0 = 1.0 #Pressure, bar
M = 12.01 #Molceular wt of Carbon
#Calculations
P = P0*1e5 + dGfCD*1e3/((1./rhoG-1./rhoD)*M*1e-3)
#Results
print 'Pressure at which graphite and dimond will be in equilibrium is %4.2e bar'%(P/1e5)
from math import exp
#Variable Declaration
beta = 2.04e-4 #Thermal exapansion coefficient, /K
kapa = 45.9e-6 #Isothermal compressibility, /bar
T = 298.15 #Std. Temperature, K
R = 8.206e-2 #Ideal gas constant, atm.L/(mol.K)
T1 = 320.0 #Temperature, K
Pi = 1.0 #Initial Pressure, bar
V = 1.00 #Volume, m3
a = 1.35 #van der Waals constant a for nitrogen, atm.L2/mol2
#Calculations
dUbydV = Pf = (beta*T1-kapa*P0)/kapa
dVT = V*kapa*(Pf-Pi)
dVbyV = dVT*100/V
Vm = Pi/(R*T1)
dUbydVm = a/(Vm**2)
#Results
print 'dUbydV = %4.2e bar'%(dUbydV)
print 'dVbyV = %4.3f percent'%(dVbyV)
print 'dUbydVm = %4.0e atm'%(dUbydVm)
from math import exp, log
#Variable Declaration
m = 1000.0 #mass of mercury, g
Pi, Ti = 1.00, 300.0 #Intial pressure and temperature, bar, K
Pf, Tf = 300., 600.0 #Final pressure and temperature, bar, K
rho = 13534. #Density of mercury, kg/m3
beta = 18.1e-4 #Thermal exapansion coefficient for Hg, /K
kapa = 3.91e-6 #Isothermal compressibility for Hg, /Pa
Cpm = 27.98 #Molar Specific heat at constant pressure, J/(mol.K)
M = 200.59 #Molecular wt of Hg, g/mol
#Calculations
Vi = m*1e-3/rho
Vf = Vi*exp(-kapa*(Pf-Pi))
Ut = m*Cpm*(Tf-Ti)/M
Up = (beta*Ti/kapa-Pi)*1e5*(Vf-Vi) + (Vi-Vf+Vf*log(Vf/Vi))*1e5/kapa
dU = Ut + Up
Ht = m*Cpm*(Tf-Ti)/M
Hp = ((1 + beta*(Tf-Ti))*Vi*exp(-kapa*Pi)/kapa)*(exp(-kapa*Pi)-exp(-kapa*Pf))
dH = Ht + Hp
#Results
print 'Internal energy change is %6.2e J/mol in which \ncontribution of temeprature dependent term %6.4f percent'%(dU,Ut*100/dH)
print 'Enthalpy change is %4.3e J/mol in which \ncontribution of temeprature dependent term %4.1f percent'%(dH,Ht*100/dH)
#Variable Declaration
T = 300.0 #Temperature of Hg, K
beta = 18.1e-4 #Thermal exapansion coefficient for Hg, /K
kapa = 3.91e-6 #Isothermal compressibility for Hg, /Pa
M = 0.20059 #Molecular wt of Hg, kg/mol
rho = 13534 #Density of mercury, kg/m3
Cpm = 27.98 #Experimental Molar specif heat at const pressure for mercury, J/(mol.K)
#Calculations
Vm = M/rho
DCpmCv = T*Vm*beta**2/kapa
Cvm = Cpm - DCpmCv
#Results
print 'Difference in molar specific heats \nat constant volume and constant pressure %4.2e J/(mol.K)'%DCpmCv
print 'Molar Specific heat of Hg at const. volume is %4.2f J/(mol.K)'%Cvm
#Variable Declaration
T = 298.15 #Std. Temperature, K
P = 1.0 #Initial Pressure, bar
Hm0, Sm0 = 0.0,154.8 #Std. molar enthalpy and entropy of Ar(g), kJ, mol, K units
Sm0H2, Sm0O2 = 130.7,205.2 #Std. molar entropy of O2 and H2 (g), kJ/(mol.K)
dGfH2O = -237.1 #Gibbs energy of formation for H2O(l), kJ/mol
nH2, nO2 = 1, 1./2 #Stoichiomentric coefficients for H2 and O2 in water formation reaction
#Calculations
Gm0 = Hm0 - T*Sm0
dGmH2O = dGfH2O*1000 - T*(nH2*Sm0H2 + nO2*Sm0O2)
#Results
print 'Molar Gibbs energy of Ar %4.3f kJ/mol'%(Gm0/1e3)
print 'Molar Gibbs energy of Water %4.3f kJ/mol'%(dGmH2O/1e3)