aidoesscience
aidoesscience › findings › Maxwell–Boltzmann gas
ValidatingOracle-validated

Maxwell's 1860 speed law manufactured from collisions alone

Why does a gas of structureless colliding balls always arrange its speeds into the same fixed shape — and why never the reverse?

Measured by the lab
0.88707
Known value
0.88622693
Relative error
9.50e-4

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)

The Maxwell–Boltzmann gas simulation that produced this measurement

▶ Run this simulationRead how it works

The finding

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. The SHIPPED module's readout was replaced, not disclosed: it printed a SINGLE-FRAME ⟨v⟩ to three decimals with no uncertainty — per-frame scatter of the ratio is 0.0077, so two of those digits were sampling noise and the number never converged — plus an EMA shape distance floored near 8% and a plug-in H sitting 0.51 nats off the closed form with the chart's dashed 'floor' drawn at the trace's own running minimum. It now runs THIS ORACLE's estimator and is checked as one instrument with it: 7/7 displayed statistics and all 170 H-trace points Object.is-identical to an independently written replica of these definitions over the module's executed velocity stream, and across 96 runs in 6 disjoint seed families the screen reads ⟨v⟩/v_rms = 0.886679 ± 0.000059 = √π/2 + (4.5 ± 0.6)e-4 against the closed-form microcanonical excess +√π/16N = +3.46e-4 at N=320 — 1.8 SE, no residual systematic, and 0.09 combined SE from the oracle's own event-driven periodic recovery

Method

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.

The law it recovers

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)

Measurements, controls & cross-checks

Recovered se

0.0009

Recovered se units

0.9

Shape

Tv pooled 2d
0.0108
Tv gate
0.015
Note
6 seeds pooled in v/s units, ~1.4e5 effective draws; the MB overlay has zero adjustable parameters — s comes from the conserved energy, never from a fit

H theorem

H0 delta ring
-0.073
Floor measured
-2.1383
Floor closed form
-2.1427
Floor abs error
0.0044
Drop nats
2.06
Monotone violations
0
Post floor chunk spread
0.008
Note
windowed 2-D velocity histogram, 4 replicas pooled, snapshots every N/4 events (decorrelated), Miller–Madow corrected. H falls 2.06 nats from the coarse-grained delta ring, monotone within 0.06 (3-window smoothed), lands on Boltzmann's closed-form minimum to 4.4e-3 nats, then only jitters by 8e-3 — the arrow of time, with its floor predicted by theory and never fed in.

Finite N

Ratio N16
0.89358
Ratio N16 se
0.00065
Excess over N128
0.00651
Predicted sqrt pi over 16N
0.00692
Note
the N=16 gas reads HIGH by the microcanonical energy-sphere marginal's O(1/N) excess, within 1 SE of the Beta-function prediction √π/16N — Maxwell–Boltzmann is the N→∞ limit and the finite gas measures its own distance to it. The N=128 headline's +0.9 SE offset is the same (disclosed, not subtracted) +9e-4 predicted excess.

Perturbation

Temperature
Ratio T1
0.88707
Ratio T4
0.88757
Delta
0.0005
S2 recovered
1.9931
S2 expected half v0sq
2
H floor shift
-1.382
H floor shift expected
-1.3863
Note
v₀×2 (T×4): the dimensionless shape is unchanged (|Δratio| = 5e-4), the scale tracks the conserved energy (s² = ½v₀² to 0.3%, the 1−1/N CM correction), and the H floor drops by ln4 to 4.3e-3 nats — hotter ⇒ more velocity-space entropy, by the closed form.

Rivals

Wrong dimension 3d
Tv 3d
0.1074
Tv ratio 3d over 2d
10
Ratio 3d
0.9213177
Rejection se
38
Note
the energy-matched 3-D Maxwell shape (v² prefactor, 3σ² = ⟨v²⟩, zero fitted parameters) scored on the identical pooled histogram: TV ×10 worse, and its ratio √(8/3π) sits 38 SE above the measurement — the vⁿ⁻¹ velocity-space Jacobian is physical dimension-counting, not curve-fitting freedom
Collisionless
Ratio
0.99651
Tv
0.779
Note
the SAME box, initial state and integrator with the collision exchange removed: the ratio stays at the delta-spike value ≈1 (CM-frame spread is O(1/N)), the histogram never approaches MB, H never falls — equilibrium is manufactured by collisions, not by the container or the passage of time

Delta spike start

Ratio t0 lab
1
Tv t0 min
0.727
Note
every seed starts at lab-frame ⟨v⟩/v_rms = 1 to machine precision and TV ≥ 0.73 from MB — the recovered √π/2 is manufactured by the dynamics, not baked into the initial state

Module certificate

What
The SHIPPED src/modules/MaxwellGasModule.ts is sha-pinned, mechanically type-stripped (47 rules, each at its exact hit count; TS scan empty; Math.random appears once, in the seed default) and EXECUTED in Node against recorder stubs, then driven through its own fixedUpdate loop until its measurement completes at call 10400 — the work schedule is fixed and seed-independent, so that call number, the 153600 pooled H samples and the 170 trace points are all pinned too.
Estimator replaced
The module headlined a SINGLE-FRAME ⟨v⟩ printed to three decimals with no uncertainty at all. At N=320 the per-frame scatter of ⟨v⟩/v_rms is 0.0077 (0.87%) — measured, and 3.4× BELOW the naive i.i.d. √((4/π−1)/N) = 0.029 because the conserved energy removes the component of Var(v) correlated with v² — so two of those three decimals were sampling noise and the readout never converged. Its shape distance came from an EMA whose floor sat near 8% against this oracle's pooled 1.08%, and its H was a plug-in estimate over 6 consecutive (correlated) frames with no Miller–Madow correction, landing 0.51 nats above −ln(2πs²)−1, while the chart's dashed 'floor' was the running MINIMUM of its own trace — self-referential. All three were REPLACED by this oracle's estimators: the dimensionless ratio from TIME averages of both moments (a per-call sample is a time average; sampling at collisions would over-weight fast configurations) over a fixed 800-call warm-up plus 8 blocks of 1200, with ± = sd(block ratios)/√8; the 40-bin total variation with this oracle's closed-form bin masses and tail term; and Miller–Madow-corrected H.
Bit exact
Screen and oracle are now ONE instrument, checked as such: the recovered ratio, its ±, the total variation, the pooled H floor, H₀, the closed-form floor and the MB scale s are all bit-identical (Object.is) to an independently written replica of these definitions fed the module's executed velocities call by call, and so are all 170 H-trace points.
Screen reads
⟨v⟩/v_rms = 0.886679 ± 0.000059 over 96 executed runs (6 disjoint seed families × 16; seed sd 4.48e-4, 79/96 above √π/2), i.e. √π/2 + (4.52 ± 0.59)e-4 against the closed-form microcanonical excess +√π/16N = +3.46e-4 at N=320 — a 1.06e-4 = 1.8 SE residual, so the offset the screen prints IS the finite-N term and nothing else is resolved. Against the oracle's own event-driven periodic N=128 recovery (0.88707 ± 0.00090) the separation is 0.09 combined SE — two independent dynamics, one number. Shape: TV = 0.75% ± 0.07 (better than the oracle's pooled 1.08%, as N=320 carries a smaller O(1/N) shape deviation than N=128). H: the pooled floor lands −1.16e-3 ± 3.4e-4 nat from −ln(2πs²)−1 (the oracle's own is +4.4e-3) and falls 2.076 nats from the t=0 ring. Energy drift ≤ 0.45 ppm.
Displayed uncertainty is honest
One run is ONE seed, so the ± has to come from inside the run: it is sd(8 block ratios)/√8, with blocks of 1200 calls ≈ 37 integrated autocorrelation times (τ = 32 calls, measured), so the blocks are effectively independent. It reads 3.8–4.5e-4 against a true seed spread of 4.48e-4 — ×0.9 to ×1.1, i.e. the printed error bar tracks the real one rather than flattering it.
On screen disclosure
The HUD prints the measured ratio and ±, √π/2 beneath it with the signed gap, and the finite-N term +√π/16N recomputed at the live N — both the gap and that term are gate-checked as live arithmetic on the values above them, not stored strings. The chart's speed histogram is the accumulated time-weighted one with the parameter-free MB curve over it; its H panel draws the trace and a dashed line at the trace's OWN measured plateau, deliberately NOT at the closed-form floor, because an 8-call window over-reads H by +0.485 ± 0.005 nat at 2560 samples and drawing Boltzmann's exact level there would put the curve below a line it cannot reach. The level compared to the closed form is the pooled read, and that is the one the HUD quotes.
Trace vs floor
Two H estimators on purpose, both Miller–Madow corrected: short 8-call windows resolve the FALL (window 0 is the t=0 delta ring, ensemble-sampled from a private stream — without it the first dynamical window has already absorbed ~160 collisions and the fall is invisible) but over-read the level by +0.485 nat at 2560 samples; one pooled accumulation over 153600 samples reads the LEVEL to ~1e-3. The residual was diagnosed, not assumed: at grid 32 it halves as the sample count doubles (+0.021 at 16k → +0.0096 at 32k → +0.0038 at 64k → 0.000 at 192k) and GROWS with a finer grid at fixed n, so it is the entropy estimator's finite-sample bias, not velocity-grid discretization.

Energy drift max

2.9000e-15

What it reduces to

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.

Module systematics

Three, all measured and all on the screen or in this record. (1) FINITE N. The module runs N=320 in a reflecting-wall box, so its single-particle speed marginal is the microcanonical energy-sphere one, above √π/2 by +√π/16N = +3.46e-4 (the same Beta-function marginal the oracle resolves at N=16); measured over 96 runs the screen sits +4.52e-4 ± 0.59e-4 above √π/2, a 1.8 SE residual over that prediction — so the offset the HUD prints beside the gap accounts for it, and no further systematic is resolved. (2) The plotted H trace over-reads its level by +0.485 nat (8-call windows, 2560 samples, an entropy-estimator finite-sample bias that halves as the sample count doubles), so the chart shows the SHAPE of the fall and the HUD quotes the pooled read, which lands −1.16e-3 ± 3.4e-4 nat from −ln(2πs²)−1. (3) The shape distance is binned-sampling limited at 0.75% ± 0.07. Two candidate systematics were hunted and NOT found, which is why they are not disclosed as biases. The fixed-step overlap detector genuinely MISSES collisions — directly counted, 2.42% of true crossings at DT=0.01, 1.20% at DT/2, 0.55% at DT/4, and the missed pairs run ×1.04 faster in |v_rel| — yet a 40-seed scan at equal physical time finds the ratio flat across those three step sizes (+3.01, +2.84, +2.80 e-4 ± 0.8), because the velocity update is an orthogonal reflection whichever pairs receive it, so losing some does not move the velocity-sphere measure; and the overlap push-apart perturbs positions only, never velocities, leaving energy exact (drift ≤ 0.45 ppm). A paired 40-seed test over warm-ups 400/800/1600/2000/3200 finds no dependence either (|paired Δ| ≤ 0.65e-4), so the shipped 800 discards the delta-spike transient. ESTIMATOR LESSON, earned here and reusable: the SE from seed scatter WITHIN one seed family under-states the real uncertainty on a module mean by ~30%. Single families of 12, 16, 10 and 40 seeds read the offset as +4.9, +7.6, +6.3 and +3.0 e-4 with claimed SEs of 0.6–1.2e-4 — mutually inconsistent — and the pinned 16-seed gate set (+7.6e-4, a nominal 4.7 SE "excess" over the finite-N prediction) does not replicate. Six DISJOINT families of 16 give a between-family SE of 0.59e-4 against a naive within-family 0.44e-4, and the excess evaporates to 1.8 SE. The gate therefore asserts the offset's sign and its size loosely (and explicitly does NOT require every seed to sit above √π/2 — only 79 of 96 do) rather than pinning one draw as physics.

Confidence & reproduction

Confidence
high
Validation
derisk-pass
Re-run the check
npm run derisk -- maxwell (scripts/maxwell-derisk.mjs)
Oracle
scripts/oracles/maxwell.reference.json

Sources

J. 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.

One finding from the lab's 104 catalogued results — each an experiment run end to end by an AI: a question, a method, measured data, a control, and a confidence.