Why does a gas of structureless colliding balls always arrange its speeds into the same fixed shape — and why never the reverse?
Units: dimensionless (⟨v⟩/v_rms = √π/2 for the 2-D Maxwell–Boltzmann speed law; 3-D gives √(8/3π) = 0.9213 — the ratio counts dimensions)
▶ Run this simulationRead how it works
Maxwell's 1860 speed law manufactured from collisions alone: an event-driven hard-disk gas started at the LEAST thermal state possible (every disk at the same speed — a delta spike, ratio ⟨v⟩/v_rms = 1 exactly) relaxes onto the 2-D Maxwell–Boltzmann distribution with NO fitted parameter — ⟨v⟩/v_rms = 0.88707 ± 0.00090 vs √π/2 = 0.886227 (0.10%, 0.9 SE), pooled histogram TV 0.011 against the energy-fixed MB curve — while Boltzmann's H falls 2.06 nats monotonically onto the closed-form floor −ln(2πs²)−1 to 0.0044 nats and shifts by exactly −ln4 when T×4. The energy-matched 3-D Maxwell shape (wrong Jacobian) is rejected ×10 in TV and 38 SE in ratio; the SAME gas with collisions off stays a delta spike forever; and the N=16 gas reads high by +0.0065 — the microcanonical O(1/N) excess (predicted +0.0069) that vanishes as N→∞: MB is the infinite-gas limit, measured
Run a from-scratch event-driven 2-D hard-disk gas in a periodic box (earliest pairwise collision under the minimum image; equal-mass elastic exchange of the normal velocity component — energy AND momentum conserved to machine precision; at small N, where min-image linear motion can see no approaching pair, the gas free-streams a capped step until the wrap restores an approach). Initialize at the delta spike: every disk at speed v₀, random direction — lab-frame ⟨v⟩/v_rms = 1 exactly, the least-thermal speed distribution at this energy. Measure in the CENTRE-OF-MASS frame (momentum is conserved; the lab frame carries an O(1/N) drift bias) with continuous TIME averages (speeds are piecewise constant between events, so Σ|vᵢ−v_cm|·dt is exact — collision-event snapshots over-weight fast configurations). Recover: (A) the dimensionless ratio ⟨v⟩/v_rms across 6 seeds × 12000 collisions at N=128, v_rms pinned by the conserved energy; (B) the full time-weighted speed histogram pooled across seeds in v/s units against the parameter-free MB curve (s² = ½⟨v²⟩ from energy, no fit); (C) Boltzmann's H(t) from replica-pooled DECORRELATED velocity-grid snapshots with the Miller–Madow correction, its floor against the closed form −ln(2πs²)−1; (D) the finite-N microcanonical excess at N=16; (E) a v₀×2 temperature sweep (ratio invariant; H floor shifts −ln4). Rivals: the energy-matched 3-D Maxwell shape (v² Jacobian, 3σ²=⟨v²⟩, zero fitted parameters) scored on the identical data, and the SAME machinery with collisions off. √π/2, √(8/3π) and −ln(2πs²)−1 are loaded/computed only to score.
f(v) = (v/s²)·exp(−v²/2s²) with s² = kT/m = ½⟨v²⟩ fixed entirely by the conserved energy; ⟨v⟩ = s√(π/2), v_rms = s√2; H = ∫f ln f d²v falls to −ln(2πs²)−1 (Boltzmann's minimum at fixed energy)
0.0009
0.9
2.9000e-15
Maxwell's 1860 equilibrium speed distribution (Phil. Mag. 19, Prop. IV — the first statistical law of physics) and Boltzmann's 1872 H-theorem, in their 2-D form: Gaussian velocity components ⇒ the Rayleigh speed law f(v) = (v/s²)exp(−v²/2s²), whose parameter-free signature ⟨v⟩/v_rms = √π/2 the gas must produce from ANY initial condition at the same energy. This world VALIDATES, not derives: the generator codes only free flight and equal-mass elastic momentum exchange — no Gaussian, no temperature, no H, no √π/2 — and the delta-spike start is the strongest possible non-circularity control (the initial ratio is exactly 1; every recovered signature is manufactured by the collision dynamics during the run). Non-circular on several further fronts: v_rms is pinned by the conserved energy so the headline ratio has zero adjustable scale; the MB overlay uses s² = ½⟨v²⟩ from energy, not a fit; the H floor is compared to a closed form computed only in the scorer; the collisionless control shows the machinery does NOT produce MB when the physics (collisions) is removed; the wrong-dimension rival shows the recovery discriminates between closed-form laws on the same data; and the finite-N excess (+0.0065 at N=16 vs the predicted +√π/16N = +0.0069 microcanonical Beta-function marginal) demonstrates the measurement resolves even the known O(1/N) departure from MB, in the predicted direction and size. Estimator lessons earned here: measure in the CM frame (the lab frame's conserved-momentum drift biases at O(1/N)), time-average between events rather than sampling at collisions (event sampling over-weights fast configurations), and never estimate an entropy from correlated samples (per-event sampling biased H high by ~0.8 nat; decorrelated snapshots + Miller–Madow pinned the floor to 4.4e-3). Distinct from ?world=meanfreepath (the TRANSPORT side: collision rates and Maxwell's √2, which assumes thermalization has happened): this world is the EQUILIBRIUM side — why the thermal state exists and is reached at all, the H-theorem arrow included. It does not model 3-D gases (the 2-D law is validated and 3-D is the falsified rival's shape here), quantum statistics, or the Poincaré-recurrence/Loschmidt-reversal caveats beyond noting the module discloses them; the finite deterministic gas exhibits the overwhelmingly-probable monotone H, which is exactly Boltzmann's claim.
The on-screen MaxwellGasModule (N=320, reflecting walls, fixed timestep DT=0.01 with overlap push-apart) displays the SAME observables the oracle gates — live ⟨v⟩ against the printed target s√(π/2), the total-variation distance to the energy-fixed MB curve, and a falling H(t) trace — but is a time-stepped integrator, not the oracle's exact event-driven one: the overlap push-apart perturbs positions (never velocities, so energy is exact and the velocity-sphere measure untouched), walls break momentum conservation (so its lab-frame read needs no CM correction), the single-frame ⟨v⟩ readout fluctuates ±0.52/√320 ≈ ±3% around the target (EMA-smoothed on the histogram), and the finite-N excess at N=320 (+0.01%) is invisible at display precision. The module's numbers were reconciled by construction (identical observable definitions), not by headless scrape this run — pinning the displayed digits against a verbatim-RNG replay is the remaining step to the validated-with-honest-module rung.
npm run derisk -- maxwell (scripts/maxwell-derisk.mjs)scripts/oracles/maxwell.reference.jsonJ. C. Maxwell, 'Illustrations of the dynamical theory of gases', Phil. Mag. 19, 19–32 (1860) — Prop. IV. L. Boltzmann, 'Weitere Studien über das Wärmegleichgewicht unter Gasmolekülen', Wien. Ber. 66, 275 (1872) — the H-theorem. √π/2 = 0.8862269255 (2-D); √(8/3π) = 0.9213177 (3-D); MB floor −ln(2πs²)−1.