This simulation shows how the molecular partition function of a system with a few discrete energy levels determines its thermodynamic properties. Particles are distributed among the energy levels according to the Boltzmann distribution, and the partition function, internal energy, heat capacity, entropy, and Helmholtz free energy are calculated from that distribution as functions of temperature.
Select the number of energy levels (2 to 4) and the degeneracy of each level (1 to 4). The simulation picks the energy spacings; click "new energy levels" to get a different set. The ground level is at zero energy.
The energy-level diagram on the left shows each quantum state as a short horizontal line; a level with degeneracy g has g states at the same energy. The dots are 40 particles distributed among the states at the selected temperature, and the number of particles in each level is shown on the right. Move the temperature slider to see how the particles move to higher levels as temperature increases. The orange bar on the energy axis (and the dashed line across the levels) has a height equal to the thermal energy RT; a level becomes significantly populated when RT becomes comparable to its energy.
Use the drop-down menu above the plot to choose which property is plotted versus temperature. The dot on the plot marks the current temperature, and the two lines below the figures list the property values at that temperature (per mole of particles).
The molecular partition function for a set of energy levels, each with energy \(\varepsilon_i\) and degeneracy \(g_i\), is
\[ q = \sum_i g_i \exp\!\left(-\frac{\varepsilon_i}{k_B T}\right) \]The ground level is the energy reference, \(\varepsilon_0 = 0\). The fraction of particles in level \(i\) follows the Boltzmann distribution:
\[ p_i = \frac{N_i}{N} = \frac{g_i \exp\!\left(-\varepsilon_i / k_B T\right)}{q} \]Expressing level energies per mole, \(E_i = N_A \varepsilon_i\), so that \(E_i / RT = \varepsilon_i / k_B T\), the molar thermodynamic properties are
\[ U = \sum_i E_i \, p_i = RT^2 \left(\frac{\partial \ln q}{\partial T}\right)_V \] \[ C_V = \left(\frac{\partial U}{\partial T}\right)_V = \frac{1}{RT^2}\left[\sum_i E_i^2 \, p_i - \left(\sum_i E_i \, p_i\right)^2\right] \] \[ S = \frac{U}{T} + R \ln q \] \[ A = U - TS = -RT \ln q \]At low temperature, all particles are in the ground level, so \(q \to g_0\), \(U \to 0\), and \(S \to R \ln g_0\). At high temperature, all states are equally populated, so \(q \to \sum_i g_i\) and \(S \to R \ln \sum_i g_i\). The heat capacity goes through a maximum (a Schottky anomaly) at the temperature where particles move most rapidly into the upper levels, and it approaches zero at both low and high temperature because the number of levels is finite.
The diagram uses 40 particles; the numbers in each level are the Boltzmann fractions multiplied by 40 and rounded so that they add to 40.
Symbols:
| \(A\) | molar Helmholtz free energy (kJ/mol) |
| \(C_V\) | molar heat capacity at constant volume (J/[mol K]) |
| \(E_i\) | energy of level \(i\) per mole (kJ/mol) |
| \(g_i\) | degeneracy of level \(i\) (number of states with energy \(\varepsilon_i\)) |
| \(i\) | energy level index (0 is the ground level) |
| \(k_B\) | Boltzmann constant (1.381 × 10−23 J/K) |
| \(N\) | total number of particles |
| \(N_A\) | Avogadro's number (6.022 × 1023 mol−1) |
| \(N_i\) | number of particles in level \(i\) |
| \(p_i\) | fraction of particles in level \(i\) |
| \(q\) | molecular partition function |
| \(R\) | ideal gas constant (8.314 J/[mol K]) |
| \(S\) | molar entropy (J/[mol K]) |
| \(T\) | temperature (K) |
| \(U\) | molar internal energy relative to the ground level (kJ/mol) |
| \(\varepsilon_i\) | energy of level \(i\) per particle (J) |
This simulation was created in the Department of Chemical and Biological Engineering at University of Colorado Boulder for LearnChemE.com by John L. Falconer using Claude AI. It was prepared with financial support from the National Science Foundation (DUE 2336987 and 2336988). Address any questions or comments to LearnChemE@gmail.com.