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

# Spring Motion and Numerical Calculations

Maybe you know I like numerical calculations, well I do. I think they are swell. [VPython](http://vpython.org) is my tool of choice. In the post [Basics: Numerical Calculations](http://blog.dotphys.net/2008/10/basics-numerical-calculations/) I used vpython and excel to do something simple. I will do that again today (in that this problem could also be solved analytically). However, there is one big difference. This problem has a non-constant forces. Suppose I have a mass that is connected by a spring to a wall. This mass-spring is sitting on a table with no friction.

There is a very interesting property of springs. The more you stretch them, the greater the force they exert (in the usual model of springs). This model works very well.

This is known as Hooke’s law. I have written it as a scalar for simplicity. The “k” is called the spring constant. It is a measure of how “stiff” the spring is. The value “s” is the amount the spring is stretched. Typically, there is a minus sign in front of the ks to indicate that the force is in the opposite direction that the spring is stretched. Really, in a scalar equation this is rather silly to include (but everyone does anyway).

**Question: What will the motion of the mass be like if I pull it back and then let go?**

Although this can be determined analytically, I am going to first calculate this with vpython. I will try to show all the details so that you can reproduce this also. If you have not already installed [vpython](http://vpython.org), do that now (don’t cost nothing).

# Basics: Forces and the momentum principle

**Pre reqs:** [Free Body Diagrams](http://blog.dotphys.net/2008/09/basics-free-body-diagrams/), [Force](http://blog.dotphys.net/2008/09/basics-what-is-a-force/), [Kinematics](http://blog.dotphys.net/2008/09/basics-kinematics/)

The time has come to look at things that are NOT in equilibrium. The most basic question to ask yourself is: *”What do forces do to an object”*? Aristotle would say that forces make things move. Constant forces make things move constantly. Actually, Aristotle said there were two types of motion:

• Natural motions: These motions don’t need anything to happen, they just do. Example: a rock falling. You don’t need to do anything to it. Example: fire rising. It just rises. (there was more to it than that, but you get the idea).
• Violent motions: These motions are due to some interaction that forces them from their natural state. The natural state of a cart is to be at rest. If someone pushes on it, it will move. When you stop pushing (stop the violent motion) it returns to its natural state – at rest

I am talking about Aristotle, because these basic ideas are what most people think. If you push something it moves. If you stop pushing, it stops. And these people are correct. The problem is that there is always this extra force that no one thinks about – friction. Without friction, the rules change.

**New Rules (Newtonian ideas)**

If you push something with one force, it changes velocity. If you stop pushing, it stays at a constant velocity.

If you want to test your feelings for force, [try this force game I made on Scratch](http://scratch.mit.edu/projects/rhettallain/285748). The idea is that you need to move the box to the red circle. The arrow keys exert a **force** on the object.

# Bullets have a lot of kinetic energy (apparently)

I was recently re-watching a MythBusters episode and I found something I had wanted to explore previously (but accidentally deleted the episode). Here is a short clip from the “shooting fish in a barrel” episode:

Did you see what I found interesting? That big barrel of water left the floor from being hit by a bullet.
The question here is: Does a bullet have enough energy to increase the gravitational potential energy of the barrel to that height?

# Physics of Linerider III: Air Resistance

There is no air resistance in line rider. Sorry to spoil the suspense.

To test for the presence of an air resistance force, a track was created that let the rider fall.