Partition Function (Canonical Ensemble) Calculator
Calculate Z, ⟨E⟩, F, S, Cᵥ for an N-level system in the canonical ensemble.
Parameters
Controls
Calculated Values
Examples
Example 1: Nitrogen vibrational levels (room T)
6 levels spaced ε = 50 meV at 300 K — only ground + first level populated.
Example 2: Spin-1/2 paramagnet (2 levels)
Two levels at ε = 0.1 eV, T = 500 K.
Example 3: Approaching equipartition
4 levels spaced 0.05 eV at 5000 K — equipartition regime.
Visualization
Canonical Ensemble & the Partition Function
The canonical ensemble describes a closed system in thermal equilibrium with a heat bath at temperature T. Every accessible microstate i with energy Eᵢ is populated with probability given by the Boltzmann distribution.
The partition function Z = Σᵢ exp(−Eᵢ / kᵦT) plays the same role for statistical mechanics that the wave function plays for quantum mechanics. It uniquely determines all thermodynamic properties of the system at fixed (N, V, T).
The Helmholtz free energy F = −kᵦT ln Z encodes the equilibrium state of the system. The entropy S = −(∂F/∂T)ᵥ relates the macroscopic disorder to the number of microstates consistent with the macrostate.
Thermal averages are derivatives of ln Z or of F: ⟨E⟩ = −∂ ln Z / ∂β = kᵦT² ∂ ln Z / ∂T. Heat capacity is the second moment: Cᵥ = (⟨E²⟩ − ⟨E⟩²) / (kᵦT²).
In the high-temperature limit, every level has nearly equal probability and ⟨E⟩ → (N−1) ⟨ε⟩/2; in the low-temperature limit, only the ground state is populated and ⟨E⟩ → 0. The crossover happens around T ≈ ⟨ε⟩ / kᵦ.
The canonical framework is the gate to Bose–Einstein and Fermi–Dirac statistics: identical particles are recovered by imposing symmetry on the multi-particle wave function, but every quantity still flows from a partition function.
Key Concepts
- Partition function: Z = Σᵢ exp(−Eᵢ / kᵦT)
- Helmholtz free energy: F = −kᵦT ln Z
- Average energy: ⟨E⟩ = −∂ ln Z / ∂β
- Entropy: S = (⟨E⟩ − F) / T
- Heat capacity: Cᵥ = (⟨E²⟩ − ⟨E⟩²) / kᵦT²
- High-T limit: equipartition | Low-T limit: ground state dominates
Real-World Applications
- Two-level systems and paramagnetism
- Vibrational & rotational spectra of molecules
- Solids, liquids, and dense gases at fixed temperature
- Adsorption isotherms and chemical equilibria
- Blackbody radiation (photons as canonical oscillators)
Explore Further
- All Statistical Physics Calculators
Browse every statistical physics solver in this category.
- Statistical Physics Formula Sheet
Distributions, partition functions, and ensemble formulas.
- Entropy and Time
Microscopic randomness and the arrow of time.
- Physics Constants Reference
SI values for c, G, k_B, ε₀, and more used across solvers.
More statistical physics tools
- Maxwell-Boltzmann Distribution
Calculate velocity distributions and characteristic velocities for ideal gases using Maxwell-Boltzmann statistics.
- Bose-Einstein Statistics
Calculate particle distributions and thermodynamic properties for bosonic systems using Bose-Einstein statistics.
- Fermi-Dirac Statistics
Calculate particle distributions and thermodynamic properties for fermionic systems using Fermi-Dirac statistics.
- Phase Transition
Calculate phase diagrams and thermodynamic properties for phase transitions using statistical mechanics.
- Microcanonical Ensemble (Density of States)
Count Ω(E) microstates and derive S = kᵦ ln Ω for an isolated system — ideal gas, harmonic chain, and spin-½ paramagnet.
Physics Equations
Step-by-Step Solution
See how the main results are calculated.
Step 1: List the 6 energy levels (Eᵢ = i·ε)
Energy ladder with ground state at zero and spacing ε:
Equation:
Calculation:
Explanation:
Pick a discrete, evenly-spaced spectrum to study textbook statistics.
Step 2: Evaluate Boltzmann factors exp(−Eᵢ/kᵦT)
Compute each weight; the largest belongs to the most populated level.
Equation:
Calculation:
Explanation:
Weights quickly become tiny above the first few excited states.
Step 3: Sum to get the partition function Z
Normalising constant — all probabilities derive from it.
Equation:
Calculation:
Explanation:
A larger Z means more accessible microstates at this temperature.
Step 4: Calculate average energy ⟨E⟩
Equilibrium mean energy of the canonical ensemble.
Equation:
Calculation:
Explanation:
Tells you how much thermal energy a closed system stores at the bath temperature.
Step 5: Helmholtz free energy F and entropy S
F is the Legendre transform of ⟨E⟩ that holds T fixed; S links F to ⟨E⟩.
Equation:
Calculation:
Explanation:
F is the work obtainable in an isothermal process; S quantifies microstate multiplicity.
Step 6: Heat capacity Cᵥ (energy fluctuations)
Second derivative of ln Z — measures thermal energy fluctuations.
Equation:
Calculation:
Explanation:
Schottky anomaly: peaks near the temperature where the second level becomes active.
Frequently Asked Questions (FAQ)
What is a partition function?
Z = Σᵢ exp(−Eᵢ/kᵦT) sums Boltzmann factors over every accessible microstate. It encodes the entire thermostatic behaviour at fixed (N, V, T).
Why is F = −kᵦT ln Z?
Because F is the Legendre transform of the internal energy that holds T fixed. The Boltzmann ansatz turns the energy–entropy sum into a derivative of ln Z.
How do you recover ⟨E⟩ from Z?
⟨E⟩ = −∂ ln Z / ∂β, where β = 1/(kᵦT).
What does "low T limit" look like?
For kᵦT ≪ ε only the ground state matters: Z → 1, ⟨E⟩ → 0, S → 0 (third law).
What is the equipartition limit?
When kᵦT ≫ ε each level holds equal probability pᵢ ≈ 1/N. The mean energy then equals ε (N−1)/2, independent of individual gap.
Practice MCQs
- When only the ground state matters (kᵦT ≪ ε):
- Helmholtz free energy is:
- Heat capacity for an N-level canonical system equals:
- High-T limit for an N-level ladder with spacing ε:
- At very low T the entropy S tends to:
Related Calculators
These tools connect to the same physics concepts used in this calculator.