Investigation of dependence of vapour pressure of liquid over temperature¶
The aim of the experiment if to determine the organic liquid by corresponding $\Delta H_{vap}$. The change of the vaporisation enthalpy is determined throughout the experiment at the range of temperatures from 5 to 50 $^o$C.
Organic liquid under study is poured in the manometer and sealed under vacuum in the left "hand" of the manometer. In the right "hand" there is a vacuum and a mercury separates left hand from right hand. The manometer is placed in the aquarium filled with water and the temperature of water is changed with termostate in the above mentioned range. According to the changes of the mercury levels in manometers the corresponding pressure is calculated as:
$P = h g \rho$,
where $P$ is pressure, $g$ — gravitational constant, $\rho$ — density of mercury, $h$ — height.
The obtained pressures are plotted as logarithmic dependence over reversed temperatures and the slope of the dependnces gives $\Delta H_{vap}$ according to:
$\frac{dlnP}{d(1/T)}=\frac{\Delta H_{vap}}{R}$
Import libraries¶
import numpy as np # math
import matplotlib.pyplot as plt # data plot
from scipy.optimize import curve_fit # fitting custom function
import matplotlib.ticker as mtick
Determine constants¶
R
— universal gas constant;T_K
— temperature in kelvins;alpha
— coefficient for mercury;ro
— density of mercury;g
— gravitational constant;error_of_lineika
anderror_of_termopara
are errors of scale and thermocouple respectively
R = 8.3145
T_k = 273
alfa = 1.81E-04
ro = 13530
g = 9.8
error_of_lineika = 0.05
error_of_termopara = 0.1
Load experimental data¶
# where '04.04.2022.txt' is the name of the data file
temperature, height, _ = np.loadtxt(r'04.04.2022.txt', unpack=True, delimiter='\t')
temperature
height
Data analysis¶
Calculate the corrected height with error:¶
$h^0 = \frac{h}{1 + \alpha T}$
$\Delta h^0 = \sqrt{(\frac{1}{1 + \alpha T} \cdot \Delta h)^2 + (\frac{-h}{1 + \alpha T} \cdot \Delta T)^2}$
where
- $h^0$ — corrected height,
- $h$ — height,
- $\alpha$ — coefficient for mercury,
- $T$ — temperature,
- $\Delta h^0$ — error of corrected height,
- $\Delta h$ — error of height measurement,
- $\Delta T$ — error of temperature measurement
h_0 = height / (1 + alfa * temperature)
error_h_0 = np.sqrt((1 / (1 + alfa * temperature) * error_of_lineika)**2 + (-height / (1 + alfa * temperature)**2 * error_of_termopara)**2)
h_0
plt.plot(temperature, height, 'bo')
plt.errorbar(temperature, h_0, fmt='r.', yerr=error_h_0, ecolor='#ff0000')
plt.xlabel(r'$Temperature, ^oC$')
plt.ylabel(r'Height, cm')
plt.title(r'Height and corrected height')
plt.legend(['Height', 'Corrected height'])
plt.show()
Calculate pressures and errors¶
$P = h \rho g$, where $h$ in our case is corrected height ($h^0$)
P = h_0 * ro * g
error_P = ro * g * error_h_0
plt.errorbar(temperature, P, fmt='ro', yerr=error_P, ecolor='#ff0000')
plt.xlabel(r'$Temperature, ^oC$')
plt.ylabel(r'Pressure, Pa')
plt.title(r'Dependence of pressure on temperature')
plt.gca().axes.yaxis.set_major_formatter(mtick.FormatStrFormatter('%.2e'))
plt.show()
Calculate the slope of the $lnP = f(1/T)$ dependence¶
Fit the dependence of the logarithm of pressure over reversed temperature with linear function, obtain the slope and calculate standard deviations
one_to_T = 1 / (temperature + T_k)
lnP = np.log(P)
f = lambda x, a, b: a * x + b
coeff, cov = curve_fit(f=f, xdata=one_to_T, ydata=lnP, p0=[0, 0], bounds=(-np.inf, np.inf))
stdevs = np.sqrt(np.diag(cov))
Calculate $\Delta H_{vap}$ and error¶
$\Delta H_{vap} (J/mol) = slope \cdot R$
delta_H_vap = -coeff[0] * R / 1000 # 1000 for kJ/mol
error_delta_H_vap = stdevs[1] * R
Plot our results¶
plt.plot(one_to_T, lnP, 'bo', one_to_T, f(one_to_T, *coeff), 'b--')
plt.xlabel(r'$1/T, K^{-1}$')
plt.ylabel(r'$lnP$')
plt.title(r'Dependence of lnP on reversed temperature')
plt.annotate(f"slope = {coeff[0]:.0f}",xycoords='figure fraction', xy=(0.6, 0.7))
plt.annotate(f"$\Delta H_$ = {delta_H_vap:.2f} $\pm$ {stdevs[1]:.2f} kJ/mol", xycoords='figure fraction', xy=(0.5, 0.8))
plt.show()