Simulation

Elastic Collision

Momentum & CollisionsElastic collisions

Two balls collide on a frictionless track — watch momentum and kinetic energy stay perfectly conserved through every bounce.

Objective

Verify that a one-dimensional elastic collision conserves both linear momentum and kinetic energy, and confirm the closed-form post-collision velocity formulas v₁' = ((m₁−m₂)·v₁ + 2·m₂·v₂) / (m₁+m₂) and v₂' = ((m₂−m₁)·v₂ + 2·m₁·v₁) / (m₁+m₂). Discover the equal-mass swap rule, observe how a heavy projectile barely slows when striking a lighter target, and confirm that the p total and KE total readouts remain unchanged across every bounce on the frictionless track.

Setup

  1. Press Reset to return both balls to their starting positions (x₁ = 10 m, x₂ = 30 m). The Time, v₁, v₂, p total, KE total, and Collisions readouts return to their initial values.
  2. Set the Ball 1 mass slider to 2.0 kg. Set the Ball 2 mass slider to 2.0 kg. Equal masses give the cleanest analytical reference, since the post-collision velocities simply swap.
  3. Set the Ball 1 speed slider to 8.0 m/s. Ball 2 begins at rest by construction, so v₂ = 0 m/s. The HUD now reads p total = 16.000 kg·m/s and KE total = 64.00 J before the collision.
  4. Press Start. Ball 1 travels right toward stationary Ball 2, contact occurs near the centre of the track, and the collision resolves in a single physics substep.
  5. Watch the readouts. After the collision the v₁ readout should fall to about 0 m/s and v₂ should rise to about 8 m/s, while p total and KE total stay locked at their pre-collision values.

Analytical Prediction

An elastic collision conserves both momentum (m₁·v₁ + m₂·v₂ = m₁·v₁' + m₂·v₂') and kinetic energy (½·m₁·v₁² + ½·m₂·v₂² = ½·m₁·v₁'² + ½·m₂·v₂'²). Solving the two equations simultaneously gives v₁' = ((m₁−m₂)·v₁ + 2·m₂·v₂) / (m₁+m₂) and v₂' = ((m₂−m₁)·v₂ + 2·m₁·v₁) / (m₁+m₂). With m₁ = 2 kg, m₂ = 2 kg, v₁ = 8 m/s, v₂ = 0:

v₁'=((m₁−m₂)·v₁ + 2·m₂·v₂) / (m₁+m₂)
=((2−2)·8 + 2·2·0) / 4
=0 m/s
v₂'=((m₂−m₁)·v₂ + 2·m₁·v₁) / (m₁+m₂)
=((2−2)·0 + 2·2·8) / 4
=32 / 4
=8 m/s

The conserved invariants are p_total = 2·8 + 2·0 = 16 kg·m/s and KE_total = ½·2·8² = 64 J. After the collision the same totals hold: p = 2·0 + 2·8 = 16 kg·m/s and KE = ½·2·8² = 64 J. The equal-mass case predicts a perfect velocity swap with both invariants unchanged.

Results Analysis

After Start, the readouts update on every animation frame. Before contact the v₁ readout sits at 8.00 m/s, v₂ at 0.00 m/s, p total at 16.000 kg·m/s, and KE total at 64.00 J. The Collisions counter reads 0. The instant the gap between centres closes to 2·R, the simulator applies the closed-form elastic-collision update in a single substep — v₁ flips to roughly 0.00 m/s, v₂ to roughly 8.00 m/s, and the Collisions counter increments to 1. Crucially, p total and KE total remain pinned at 16.000 kg·m/s and 64.00 J across the discontinuity, confirming both conservation laws to readout precision. Ball 2 then drifts right at 8 m/s, rebounds elastically off the right wall (v₂ flips sign), travels back, and collides with the now-stationary Ball 1 — a second velocity swap. The Collisions counter advances and the conserved totals still do not move. Each rebound off the wall and each ball-ball contact reproduces the analytical prediction.

Source of Error

What this sim does NOT model: friction along the track, rotational kinetic energy of either ball, deformation during contact, finite ball stiffness, air drag, or gravity (the track is horizontal). Both balls are point particles on a frictionless rail and every collision is resolved as perfectly elastic by construction. The closed forms for the post-collision velocities and the momentum/KE conservation laws assume the same idealizations, so they cancel rather than contributing to the residual. The remaining gap between prediction and readouts is therefore purely numerical, not physical, for this sim.

Further Exploration