🎲 Gibbs Ensemble — Entropy & Microstates
Distribute energy quanta among quantum harmonic oscillators and count microstates. The simulation randomly samples configurations, builds an energy histogram, and shows how entropy S = k·ln W emerges from counting accessible microstates.
System Setup
Oscillator energies
Click to reassign randomly
Statistics
S = k·ln W
⟨ε⟩ = q/N · ε₀
P(ε) ∝ e-ε/(kT)
Statistical Mechanics
In the microcanonical ensemble every microstate (specific distribution of energy quanta among N oscillators) has equal probability. The number of ways to distribute q indistinguishable quanta among N distinguishable oscillators is W = C(N+q−1, q) = (N+q−1)!/((N−1)!·q!). Boltzmann entropy S = k·ln W grows with both N and q. The most probable distribution — the one observed macroscopically — is the Boltzmann distribution P(εi) ∝ exp(−εi/kT), which emerges naturally from random sampling even without assuming it a priori. This simulation lets you verify that claim by collecting many random microstates and plotting the resulting energy histogram.