Elastic Collisions in 1D

I need a nice model to predict the final velocity when two balls collide elastically. Don’t worry why I need this—just trust me.

After working on this for a short bit and making an error, I realized what I need to do. I need to blog about it. A blog is the perfect place to work things out.

So, here is the situation. A ball of mass 10 kg (ball A) is moving with a speed of 0.1 m/s in the positive x-direction. This collides with a 1 kg ball (ball B) moving at 0.1 m/s in the negative x-direction. What is the final velocity of the two balls if the collision is perfectly elastic.

For a perfectly elastic collision, the following two things are true:

• Momentum is conserved. The total momentum before the collision is equal to the total momentum after the collision.
• Kinetic energy is conserved. The total kinetic energy is the same before and after the collision.

In one dimension, I can write this as the following two equations. I’m going to drop the “x” notation since you already know it’s in the x-direction. Also, I am going to use A1 for the velocity of A before the collision and A2 for after. Same for ball B.

$m_Av_{A1}+m_B v_{B1} = m_Av_{A2}+m_B v_{B2}$

$\frac{1}{2}m_A v_{A1}^2+\frac{1}{2}m_B v_{B1}^2 = \frac{1}{2}m_A v_{A2}^2+\frac{1}{2}m_B v_{B2}^2$

That’s two equations and two unknowns (the two final velocities). Before solving this, I want to find the answer with a numerical calculation.

Numerical Solution

Here’s the basic plan (I’m not going over all the deets).

• Model the two masses as points with springs on them (not really going to show the springs).
• When the two masses “overlap” there is a spring force pushing them apart. The strength of this force depends on the amount they overlap.
• Calculate the position and force on each ball (the force would be the zero-vector in cases where they aren’t “touching”).
• Update the momentum of the balls.
• Update the position of the balls.
• Repeat until you get bored.

Oh, make sure you set your fake spring constant high enough. If it’s too low, the two masses can just pass through each other (which would still be an elastic collision).

Here is what it looks like.

Here is the code (you should take a look). Oh, the final velocities are 0.0636 m/s for ball A and 0.2639 m/s for ball B. Also, here is a plot of the momentum so you can see momentum is conserved.

What about the kinetic energy? Here you go.

Actually, notice that KE is NOT conserved. During the collision there is a decrease in the total KE because of the elastic potential energy. I just thought that was cool.

Analytical Solution

Now let’s get to solving this sucker. I’m going to start with a trick—a trick that I’m pretty sure will work (but not positive). Instead of having the two balls moving towards each other at a speed of 0.1 m/s each, I am going to use the reference frame that has ball B with an initial speed of 0 m/s and ball A with a speed of 0.2 m/s.

Since I am switching reference frames, I am going to rename the velocities. I am going to call ball A velocity C1 and C2 and then ball B will be D1 and D2 (for final and initial). Technically, I should use prime notation – but I think it will just get messy.

So, here is how it looks in the new reference frame.

In general, the initial C velocity would be:

$v_{C1}=v_{A1}-v_{B1}$

Now I get the following for the momentum and kinetic energy conservation equations.

$m_A v_{C1}=m_A v_{C2}+m_B v_{D2}$

$\frac{1}{2}m_A v_{C1}^2=\frac{1}{2}m_A v_{C2}^2 +\frac{1}{2}m_B v_{D2}^2$

Now we have two equations two unknowns. I’m going to cheat. I worked this out on paper and I’m just going to take a picture of it.

Here is the final solution (in case you can’t read it).

$v_{C2} = v_{C1}-\frac{m_B}{m_A}v_{D2}$

$v_{D2} = \frac{2v_{C1}}{\frac{m_B}{m_A}+1}$

So, you can get a value for vD2 and then plug that into vC2. After that, you can convert them back to the stationary reference frame to get vA2 and vB2.

Boom. It works. Here is my calculation. Just to be clear, it looks like this:

The output looks like this:

Winning. That agrees with my numerical model.