Inelastic Collision Simulator

JJ Ben-Joseph headshot JJ Ben-Joseph

Enter masses, velocities, and e then press Play.
Simulation summary will appear here.

1. Real‑world phenomenon

Many collisions in nature and technology are not perfectly bouncy. Cars crumple, clay blobs splat, and meteorites stick to the surfaces they strike. These events are inelastic, meaning kinetic energy decreases during impact even though momentum remains conserved. Engineers analyze such collisions to design safer vehicles, sports scientists study them to understand ball rebounds, and astronomers invoke them when modeling planetesimals accumulating into planets. This upgraded calculator keeps the original goal of computing post‑impact velocities but adds a live canvas showing how energy partitions change. As you vary the coefficient of restitution e, the blocks either rebound vigorously or merge sluggishly. A gray bar tracks energy lost to heat or deformation, making the otherwise invisible loss tangible. The accessible caption and text fallback narrate the motion for users who cannot see the canvas, and a CSV button exports all time steps for deeper analysis.

2. Variables and assumptions

We model two rigid blocks sliding along a frictionless line. Their masses are m_1 and m_2, and their initial velocities are v_1 and v_2. The coefficient of restitution e ranges from 0 for perfectly sticky to 1 for perfectly elastic. Positive velocities point to the right. Blocks start at positions x_1=-2 and x_2=2 m and move toward each other unless the inputs dictate otherwise. All quantities use SI units and must be finite; the script clamps the time step Δt to 0.0005–0.05 s. The blocks are treated as hard rectangles with no rotation or deformation; energy loss is recorded as an abstract quantity without modeling internal heating. If the blocks stick together (e=0), they continue as a single mass after contact.

3. Governing equations

Before impact, positions follow x_i(t)=x_{i0}+v_it. At the collision moment, momentum conservation and the restitution relation determine the new velocities:

m_1v_1+m_2v_2=m_1v_1'+m_2v_2'

e=v_2'-v_1'v_1-v_2

Solving yields

v_1'=m_1-e·m_2m_1+m_2v_1+1+em_1+m_2m_2v_2

v_2'=1+em_1+m_2m_1v_1+m_2-e·m_1m_1+m_2v_2

Kinetic energies before and after are KE_i=12m_iv_i2 and KE_i'=12m_iv_i'2. Energy loss is Q=(KE_1+KE_2)-(KE_1'+KE_2'), displayed as the gray bar.

4. Numerical scheme

As with the elastic simulator, positions update via explicit steps x_i+=v_iΔt. The algorithm predicts whether the blocks will overlap during the next step and solves for the exact collision time using linear interpolation. Velocities are then replaced by the restitution formulas above. When e=0, the blocks are combined into a single mass m_1+m_2 moving at their common velocity and treated as one object for subsequent motion. The time step is decoupled from animation frames, and a warning appears in the caption if the computed energy loss differs from the analytic value by more than 1%, signaling that Δt is too large. Input changes are debounced to avoid excessive recomputation while typing.

5. Worked example

Imagine a 1 kg cart moving at 2 m/s colliding with a 1 kg cart moving at −1 m/s with e=0.5. The analytic formulas give post‑collision velocities v_1'=-0.25 m/s and v_2'=1.75 m/s. Running the simulator with Δt=0.01 s reproduces these numbers. The initial kinetic energies are 2 J and 0.5 J; after collision they become 0.03 J and 1.53 J, leaving 0.94 J lost. The gray bar grows to represent this dissipated energy, and the caption reports the fractional loss. Downloading the CSV reveals a constant momentum of 1 kg·m/s throughout, while total kinetic energy drops from 2.5 J to 1.56 J at the collision time.

6. Comparison table

The table shows outcomes for three restitution values with equal masses and initial speeds 2 m/s and −1 m/s.

e v₁′ (m/s) v₂′ (m/s) Energy Loss (J)
1.0 -1 2 0
0.5 -0.25 1.75 0.94
0.0 0.5 0.5 1.25

Decreasing e reduces the rebound of the first block and increases the energy converted to heat or deformation. When e=0, both blocks move together afterward, embodying a perfectly inelastic collision.

7. How to read the animation

The canvas depicts a blue block (m_1) and an orange block (m_2) sliding toward each other. After collision, the blocks either separate or merge depending on e. The energy bar beneath uses blue and orange stripes for each block’s kinetic energy and a gray segment for lost energy. Because each segment is labeled, the visualization remains informative regardless of color perception. The caption repeats the time, velocities, and energy loss for accessibility, and the hidden text fallback mirrors it for screen readers. Pressing the space bar while the canvas has focus toggles play and pause.

8. Limitations

The model neglects rotational motion, friction with the ground, and any time dependence of the restitution coefficient. Real materials may exhibit velocity‑dependent e or multiple rebounds during contact. Large time steps can smear the collision event, though the clamped range prevents objects from tunneling through each other. When e is very small, the combined block after impact is assumed rigid; real blobs may deform or oscillate.

9. Suggested extensions

You could extend the simulator to include a spring‑damper contact model, making the collision duration finite and allowing for oscillatory rebounds. A chain of blocks with different restitution coefficients would emulate granular materials. Introducing external forces like gravity would connect this tool with our Projectile Motion Simulator. For complementary analyses, compare results with the Elastic Collision Simulator and explore energy accounting with the Work from Force Simulator.

10. References

Embed this calculator

Copy and paste the HTML below to add the Inelastic Collision Simulator with Energy Loss to your website.