$\theta_{trans} = \frac{\pi^2\hbar^2}{2mL^2k_B}$
$\theta_{rot} = hcB/k_B$
$\theta_{vib} = hc\tilde{\nu}/k_B$
In [1]:
import numpy as np
import matplotlib.pyplot as plt
hbar = 1.05457e-34 # J*s
h = 6.62607e-34 # J*s
kB = 1.38065e-23 # J/K
m = 28.01*1.6605e-27 # kg/molecule
V = 0.02 # m^3
c = 2.99792e10 # cm/s
B = 1.931 # cm^-1
v = 2156.6 # cm^-1
T_trans = np.pi**2*hbar**2/2/m/V**(2/3)/kB
T_rot = h*c*B/kB
T_vib = h*c*v/kB
print('Characteristic temperatures of CO:')
print('T_trans = {0:.3e} K, T_rot = {1:.3f} K, T_vib = {2:0.2f} K.'.format(T_trans,T_rot,T_vib))
For $T \gg \theta_{trans}$, $\Lambda \ll L$, $q_{trans} = V/\Lambda^3$. $\Lambda = h \left(\frac{\beta}{2\pi m}\right)^{1/2}$.
In [2]:
Lamda = h*(1/(kB*298*2*np.pi*m))**0.5
print(Lamda)
q_trans = V/Lamda**3
print('The translational partition function of a CO molecule in the bottle at 298 K is {:.4E}.'.format(q_trans))
print('It is dimensionless.')
$q_{rot} = \frac{1}{\sigma}\frac{T}{\theta_{rot}} = \frac{T}{\theta_{rot}}$
$q_{vib} = \frac{1}{1-e^{-\theta_{vib}/T}}$
In [3]:
T = np.linspace(200,2000,1000) # r = R/a_0
q_rot = T/T_rot
q_vib = 1/(1-np.exp(-T_vib/T))
plt.plot(T,q_rot)
plt.xlabel('T (K)')
plt.ylabel('$q_{rot}$')
plt.title('The rotational partition function of a CO molecule')
plt.show()
plt.plot(T,q_vib)
plt.xlabel('T (K)')
plt.ylabel('$q_{vib}$')
plt.title('The vibrational partition function of a CO molecule')
plt.show()
$U_{trans} = \frac{3}{2}RT$
$U_{rot} = RT$
$U_{vib} = R\frac{\theta_{vib}}{e^{\theta_{vib}/T}-1}$.
In [4]:
R = 8.31447 # J/(mol*K)
U_trans = 1.5*R*T
U_rot = R*T
U_vib = R*T_vib/(np.exp(T_vib/T)-1)
plt.plot(T,U_trans,label='U_trans')
plt.plot(T,U_rot,label='U_rot')
plt.plot(T,U_vib,label='U_vib')
plt.legend()
plt.xlabel('T (K)')
plt.ylabel('Internal Energy (J/mol)')
plt.title('Internal energies of CO in the bottle')
plt.show()
$C_{V,trans} = \frac{3}{2}R$
$C_{V,rot} = R$
$C_{V,vib} = R\left(\frac{\theta_{vib}}{T}\frac{e^{\theta_{vib}/2T}}{e^{\theta_{vib}/T}-1}\right)^2$
In [5]:
Cv_trans = np.linspace(1.5*R,1.5*R,1000)
Cv_rot = np.linspace(R,R,1000)
Cv_vib = R*(T_vib/T*np.exp(T_vib/2./T)/(np.exp(T_vib/T)-1))**2
plt.plot(T,Cv_trans,label='Cv_trans')
plt.plot(T,Cv_rot,label='Cv_rot')
plt.plot(T,Cv_vib,label='Cv_vib')
plt.legend()
plt.xlabel('T (K)')
plt.ylabel('Heat Capacity (J/mol/K)')
plt.title('Constant volume molar heat capacities of CO in the bottle ')
plt.show()
print('While translational motion contributes the most to the molar heat capacity of CO,')
print('it does not dominate over rotational and vibrational motion.')
$A = U - TS$
$S_{trans} = Rln\left(\frac{e^{5/2}V}{N\Lambda^3}\right)$
$S_{rot} = R(1-ln(\theta_{rot}/T))$
$S_{vib} = R\left(\frac{\theta_{vib}/T}{e^{\theta_{vib}/T}-1}-ln(1-e^{-\theta_{vib}/T})\right)$.
In [6]:
NA = 6.022e23
S_trans = R*np.log(np.exp(2.5)*V/NA/Lamda**3)
S_rot = R*(1-np.log(T_rot/T))
S_vib = R*(T_vib/T/(np.exp(T_vib/T)-1)-np.log(1-np.exp(-T_vib/T)))
A_trans = U_trans-T*S_trans
A_rot = U_rot-T*S_rot
A_vib = U_vib-T*S_vib
plt.plot(T,A_trans,label='A_trans')
plt.plot(T,A_rot,label='A_rot')
plt.plot(T,A_vib,label='A_vib')
plt.legend()
plt.xlabel('T (K)')
plt.ylabel('Helmholtz Energy (J/mol)')
plt.title('Helmholtz energies of CO in the bottle')
plt.show()
T = 298 K. $\Delta U=0$.
$\Delta P = \frac{RT}{V_2} - \frac{RT}{V_1}$.
$\Delta S = S_{trans,2} - S_{trans,1}$.
$A = U-TS$, so, $\Delta A = -T\Delta S$.
In [7]:
V2 = 0.04 # m^3
deltaP = R*298*(1/V2-1/V)
deltaS = R*np.log(np.exp(2.5)*V2/NA/Lamda**3) - R*np.log(np.exp(2.5)*V/NA/Lamda**3)
deltaA = -deltaS*298
print('Delta P = {0:.3f} Pa, Delta U = 0, Delta A = {1:.3f} J/mol, and Delta S = {2:.3f} J/mol/K.'.format(deltaP,deltaA,deltaS))
CF$_3$OH | C(O)F$_2$ | HF | ||
---|---|---|---|---|
$E^\text{elec}$ | -412.90047 | -312.57028 | -100.31885 | (Hartree) |
ZPE | 0.02889 | 0.01422 | 0.00925 | (Hartree) |
$U^\text{trans}$ | 3.7 | 3.7 | 3.7 | (kJ mol$^{-1}$) |
$U^\text{rot }$ | 3.7 | 3.7 | 2.5 | (kJ mol$^{-1}$) |
$U^\text{vib}$ | 4.3 | 1.2 | 0 | (kJ mol$^{-1}$) |
$q^{\text{trans}}/V$ | $7.72\times 10^{32}$ | $1.59\times 10^{32}$ | $8.65\times 10^{31}$ | (m$^{-3}$) |
$q^\text{rot}$ | 61830 | 679 | 9.59 | |
$q^\text{vib}$ | 2.33 | 1.16 | 1 |
Remember that $E_0$ is contained in $\Delta{U}^{\circ},\Delta{A}^{\circ},$ and $\Delta{G}^{\circ}.$ For example:
$$\Delta U^{\circ} =\sum_{product}U_{trans} + U_{rot} + U_{vib} + (E_{elec} + ZPE) - \sum_{reactant} U_{trans} + U_{rot} + U_{vib} + (E_{elec} + ZPE)$$$$=\sum_{product}U_{trans} + U_{rot} + U_{vib} + E_0 - \sum_{reactant} U_{trans} + U_{rot} + U_{vib} + E_0$$$\Delta U^{\circ} =\Delta(U_{trans} + U_{rot} + U_{vib}) + \Delta(E_0)$
In [8]:
import numpy as np
T = 298 # K
k = 1.38065e-23 # J/K
R = 8.31447 # J/(mol*K)
Na = 6.0221e23 # 1/mol
c = 6.0221e26 # 1/m^3, conversion factor of 1mol/L = 6.02e26 particles/m^3
autokJ = 2625.50
Eelec = [-412.90047 ,-312.57028 ,-100.31885 ] # kJ/mol
ZPE = [0.02889 ,0.01422 ,0.00925 ] # kJ/mol
dE0 = ((Eelec[1] + ZPE[1] + Eelec[2] + ZPE[2]) - (Eelec[0] + ZPE[0]))* autokJ # kJ/mol
u_trans = [3.7,3.7,3.7] #kJ/mol
u_rot = [3.7,3.7,2.5] #kJ/mol
u_vib = [4.3,1.2,0] #kJ/mol
dU = dE0 + (u_trans[1]+u_rot[1]+u_vib[1])+(u_trans[2]+u_rot[2]+u_vib[2])-(u_trans[0]+u_rot[0]+u_vib[0])#kJ/mol
print("delta_U = %.2f kJ/mol"%dU)
$\Delta{A^{\circ}}= \big\{[-k_BT\ln(q_{t}q_{r}q_{v})-k_BT]_{COF_2}+[-k_BT\ln(q_{t}q_{r}q_{v})-k_BT]_{HF}-[-k_BT\ln(q_{t}q_{r}q_{v})-k_BT]_{CF_3OH}\big\} *N_A + \Delta(E_0)$ $\quad \quad = \Delta(E_0)-RT\ln(Q)-RT$
In [9]:
q_trans = [7.72e32/c,1.59e32/c,8.65e31/c] # change translational partition functions from 1/m3 to mol/l std state
q_rot = [61830,679,9.59] # unitless
q_vib = [2.33,1.16,1] # unitless
Q = (q_trans[1]*q_rot[1]*q_vib[1])*(q_trans[2]*q_rot[2]*q_vib[2])/(q_trans[0]*q_rot[0]*q_vib[0]) # total partition
dA = dE0 + (-R*T*np.log(Q)- R*T)/1000 #kJ/mol
print("Q = %.2f"%Q)
print("delta_E0 = %.2f"%dE0)
print("delta_A = %.2f kJ/mol"%dA)
$\Delta{G^{\circ}} = \Delta{A^{\circ}} + \Delta(PV)$ $\quad = \quad \Delta{A^{\circ}} + RT$
In [10]:
dG = dA + R*T/1000 #kJ/mol
print("delta_G = %.2f kJ/mol"%dG)
$\Delta A^{\circ} = \Delta U^{\circ} - T\Delta S^{\circ}$
$\Delta S^{\circ} = \frac{\Delta U^{\circ} - \Delta A^{\circ}}{T}$
In [11]:
dS = 1000*(dU - dA)/T
print("delta_S = %.2f J/mol K"%dS)
$\mathrm{A} \rightarrow \mathrm{B + C}$$$K_c(T) = \frac{\frac{q_{\mathrm{B}}}{V}\frac{q_{\mathrm{C}}}{V}}{\frac{q_{\mathrm{A}}}{V}} \frac{1}{c^{\circ}} e^{-\Delta{E(0)}/kT} = e^{-\Delta G^\circ(T)/RT}, \quad \text{where} \quad \frac{q_i}{V} = \frac{q_{trans}}{V}q_{rot}q_{vib}$$ Note: $K_c(T)$ is formally unitless but "remembers" that it refers to 1 M standard state.
In [12]:
Kc = Q *np.exp(-dE0*1000/(R*T)) # Kc equation from lecture notes
print('Kc = %.3f (unitless). '%(Kc))
In [13]:
Kc = np.exp(-dG*1000/(R*T))
print('Kc = %.3f (unitless). '%(Kc))
1 mol/ 20 L = 0.05 mol/L
$\mathrm{A} \rightarrow \mathrm{B + C}$
$K_c = \frac{x^2}{0.05-x}$, solve for x. Note that x = $[\frac{mol}{L}]$.
In [22]:
from sympy import *
x = symbols('x',positive=True)
c = solve(x**2-(0.05-x)*Kc,x)
print('At equilibrium, CF3OH = %.2E mol/L, COF2 = %.5f mol/L, HF = %.5f mol/L.'%(0.05-c[0],c[0],c[0]))
print('At equilibrium, CF3OH = %.2E mol, COF2 = %.5f mol, HF = %.5f mol.'%((0.05-c[0])*20,c[0]*20,c[0]*20))
From question #8, we know that at 298K, $\Delta U$ = 18.64 kJ/mol.
$\Delta H = \Delta U + \Delta (nRT) = \Delta U + RT\Delta n$
In [15]:
dn = 2-1
R = 8.314/1000 #kJ/mol K
T = 298 #K
dH = dU+dn*R*T #kJ/mol
print("dH =",round(dH,3),"kJ/mol")
Since $\Delta H$ is positive, we expect $K \uparrow$ as $T \uparrow$
The Van't Hoff equation states:
$ln\frac{K(T_2)}{K(T_1)}=\frac{-\Delta H^o}{R}(\frac{1}{T_2}-\frac{1}{T_1})$
We know from question 12, K = 2.926 at 298 K.
In [16]:
K1 = 2.926
T1 = 298 #K
T2 = 273 #K
K2 = K1*np.exp(-dH/R*(1/T2-1/T1))
print('K=', round(K2,4), 'at 273 K.')
x = symbols('x',positive=True)
c = solve(x**2-(0.05-x)*K2,x)
print('At equilibrium, CF3OH = %.2E mol/L, COF2 = %.5f mol/L, HF = %.5f mol/L.'%(0.05-c[0],c[0],c[0]))
In [17]:
K1 = 2.926
T1 = 298 #K
T2 = 323 #K
K2 = K1*np.exp(-dH/R*(1/T2-1/T1))
print('K=', round(K2,4), 'at 323 K.')
x = symbols('x',positive=True)
c = solve(x**2-(0.05-x)*K2,x)
print('At equilibrium, CF3OH = %.2E mol/L, COF2 = %.5f mol/L, HF = %.5f mol/L.'%(0.05-c[0],c[0],c[0]))
Therefore, the at higher temperatures, the reaction shifts towards the products.
If V = 5L, the initial concentration = $\frac{1 mol}{5 L}=.2 M$
$K_c = \frac{x^2}{0.2-x}$
At 298 K, Kc = 2.926 (from problem 12)
In [24]:
T = 298 #K
R = 8.314
Kc = np.exp(-dG*1000/(R*T))
print('At 298 K, Kc = %.3f (unitless). '%(Kc))
x = symbols('x',positive=True)
c = solve(x**2-(0.2-x)*Kc,x)
print('At equilibrium, CF3OH = %.2E mol/L, COF2 = %.5f mol/L, HF = %.5f mol/L.'%(0.2-c[0],c[0],c[0]))
print('At equilibrium, CF3OH = %.2E mol, COF2 = %.5f mol, HF = %.5f mol.'%((0.2-c[0])*5,c[0]*5,c[0]*5))
print('At a smaller volume, the concentration of products increases, but the number of moles decreases.')
In [27]:
T = 298 #K
#All values were taken from NIST
#Methanol
Hm = -205 #kJ/mol
Sm = .2399 #kJ/mol K
Gm = Hm - T*Sm #kJ/mol
#Hydrogen
Hh = 0
Sh = .13068 #J/mol K
Gh = Hh - T*Sh #kJ/mol
#Formaldehyde
Hf = -108.6 #kJ/mol
Sf = .21895 #kJ/mol K
Gf = Hf - T*Sf #kJ/mol
delta_H = Hf+Hh-Hm #kJ/mol
delta_S = Sf+Sh-Sm #kJ/mol K
delta_G = Gf+Gh-Gm #kJ/mol
print('Delta H =',delta_H,'kJ/mol.')
print('Delta S =',delta_S,'kJ/mol K.')
print('Delta G =',delta_G,'kJ/mol.')
print('Therefore, by substituting F with H makes the reaction less favorable.')
In [0]: