Watch N frictionless discs bounce inside a box with perfectly elastic collisions. The speed histogram converges to the Maxwell-Boltzmann distribution — a cornerstone of statistical physics and kinetic gas theory.
J = 2·m₁·m₂·(v_rel · n̂) / (m₁ + m₂)
v₁' = v₁ − J·n̂/m₁
v₂' = v₂ + J·n̂/m₂
Maxwell-Boltzmann (2D):
f(v) = (m/kT)·v·exp(−mv²/2kT)
Temperature: T = m·⟨v²⟩ / (2k)
James Clerk Maxwell and Ludwig Boltzmann derived their famous distribution in the 1860s–1870s without computers, using pure probability theory. The distribution explains why the sky is blue (Rayleigh scattering depends on molecular speed distribution) and underlies the efficiency of every internal combustion engine.
An elastic collision is one in which both momentum and kinetic energy are conserved. No energy is lost to heat, sound, or deformation. Billiard balls and gas molecules approximate elastic collisions very well.
The normal impulse magnitude is J = 2·m₁·m₂·(v_rel · n) / (m₁ + m₂), where v_rel is the relative velocity of the two discs and n is the unit normal at the contact point. Each disc's velocity is then updated by ±J·n/mass.
The Maxwell-Boltzmann distribution gives the probability distribution of particle speeds in an ideal gas at thermal equilibrium. It shows that most particles have a speed near the most probable speed, with fewer particles at very low or very high speeds.
Because all collisions are perfectly elastic with no friction or damping. The impulse formulation conserves both momentum and kinetic energy exactly by construction. Wall reflections only reverse the normal velocity component, preserving speed magnitude.
In the kinetic theory of gases, temperature T is proportional to the mean kinetic energy per particle: (1/2)mv² = (f/2)kT, where f is degrees of freedom and k is Boltzmann's constant. In 2D, f=2, so T = m·‹v²›/(2k).
The most probable speed is v_p = √(2kT/m). The mean speed is v_avg = √(8kT/πm) ≈ 1.13·v_p, and the root-mean-square speed is v_rms = √(3kT/m) ≈ 1.22·v_p for a 3D gas.
More particles mean more collisions per unit time, so the system reaches Maxwell-Boltzmann equilibrium faster. With N particles and a collision rate proportional to N², the equilibration time scales roughly as 1/N.
In elastic collisions between particles of different masses, energy is exchanged until each species reaches the same mean kinetic energy (equipartition theorem). Lighter particles end up moving faster than heavier ones on average.
Each individual collision conserves momentum by Newton's third law: the impulse on particle A is equal and opposite to that on particle B. Since all internal forces are paired, the total momentum of the system is unchanged over all collisions.
In 2D, the Maxwell-Boltzmann speed distribution is f(v) = (m/kT)·v·exp(−mv²/2kT), which rises linearly then falls exponentially. In 3D it is f(v) = 4π(m/2πkT)^(3/2)·v²·exp(−mv²/2kT), rising as v² before falling.
This simulation models a closed system of frictionless discs undergoing perfectly elastic collisions in two dimensions. Both momentum and kinetic energy are conserved in every collision, mirroring the behaviour of idealised gas molecules in kinetic theory. By watching the colour-coded particles bounce off walls and each other, you can observe how a random initial state spontaneously organises into the Maxwell-Boltzmann speed distribution.
Elastic collision mechanics underpin diverse real-world fields, from billiard table engineering and nuclear reactor design to molecular dynamics simulations used in drug discovery and materials science.
An elastic collision is one in which both linear momentum and kinetic energy are conserved. No mechanical energy is converted to heat, sound, or permanent deformation. Hard billiard balls and noble gas atoms come close to this ideal in everyday situations.
Use the sliders in the top-right panel to change the number of particles (5-200), their radius, overall speed scale, and the mass ratio between the two particle types (shown in pink and cyan). Toggle Trails to see motion paths, Show Velocities to display speed arrows, and Show Histogram to watch the speed distribution evolve toward the Maxwell-Boltzmann curve. Press Pause or hit the Space bar to freeze the simulation, and Reset to start fresh.
The histogram in the bottom-left corner plots how many particles currently have each speed. The white curve is the theoretical 2D Maxwell-Boltzmann distribution f(v) = (m/kT) * v * exp(-mv^2/2kT). As particles collide and exchange energy, the bars gradually converge to match this curve, demonstrating how thermal equilibrium emerges from local collision rules alone.
The normal impulse magnitude is J = 2*m1*m2*(v_rel dot n) / (m1 + m2), where v_rel = v1 - v2 is the relative velocity and n is the unit normal pointing from disc 1 to disc 2 at the contact point. Each disc's velocity is then updated as v1' = v1 - J*n/m1 and v2' = v2 + J*n/m2. This derivation follows directly from Newton's third law combined with the conservation of kinetic energy along the contact normal.
Newton's cradle demonstrates nearly elastic collisions between steel balls, transferring momentum along a chain with minimal energy loss. In nuclear reactors, neutrons elastically collide with moderator atoms (commonly hydrogen in water) to slow down to thermal energies. At the atomic scale, noble gas atoms such as helium and neon exchange kinetic energy through elastic collisions with extremely high efficiency.
A common misconception is that displaying near-zero total momentum is trivial. In fact, wall reflections do change individual particle momenta, but because the simulation pairs every wall impulse with an equal reaction on the enclosing box (not tracked here), the internal particle momentum is only exactly conserved during disc-disc collisions. The HUD displays |px| and |py| so you can verify that disc-disc impulses do not drift the centre-of-momentum frame over time.
James Clerk Maxwell derived the speed distribution for gas molecules in 1860 using a symmetry argument, showing the distribution must be Gaussian in each velocity component. Ludwig Boltzmann extended and rigorously justified the result in 1872 through his H-theorem, proving that any initial distribution would evolve toward the Maxwell-Boltzmann equilibrium. Their combined work founded statistical mechanics and kinetic gas theory.
Elastic collision mechanics generalise directly to hard-sphere molecular dynamics, the foundation of computational chemistry. Related simulations include inelastic collision models (where a coefficient of restitution below 1 causes energy loss), granular gas simulations (modelling sand or powders), and Lorentz gas models used to study deterministic chaos. Billiard dynamical systems — mathematical billiards in various shaped enclosures — are an active area of ergodic theory research.
Game physics engines (Unity, Unreal, Bullet) use the same impulse-based elastic collision resolution implemented here to simulate rigid body contacts in real time. Molecular dynamics packages such as GROMACS and LAMMPS apply elastic or near-elastic potentials to simulate protein folding, materials stress, and semiconductor properties. Particle physics detectors at CERN use elastic proton-proton scattering cross-sections calibrated against kinetic theory predictions to identify new physics signals.
The ergodic properties of hard-disc billiard systems — whether almost all initial conditions produce the same long-run statistics — were only fully proven by Simanyi in 2004, and open questions remain for specific geometries. Researchers are also studying how elastic collision networks behave at the quantum level (quantum billiards), their connection to quantum chaos, and how slight inelasticity triggers clustering instabilities (the granular cooling problem) relevant to planetary ring formation and powder processing.