Momentum and Impulse Defined

 < Day Day Up > 

The fist step in the process of modeling collisions between two moving objects is to define a new quantitymomentum. Momentum ( p ) is defined as mass times velocity. This means that the more massive an object is, the more momentum it has. That's why it's extremely difficult to bring a tractor-trailer to an abrupt stop. Likewise, a large velocity also results in a lot of momentum, so even if you're driving a little sports car, it's still difficult to stop at 100mph.

Momentum

p = mv

where m = mass and v = velocity.


NOTE

Because momentum is based on velocity, which constantly changes, it makes sense to talk about instantaneous momentum at specific points in time or change in momentum over a time interval.


Let's quickly address the issue of units again. If you stay consistent with metric units, mass is measured in kilograms, and velocity is measured in meters per second, so the unit for momentum is kg*m/s. Be careful. This is often confused with Newtons, but remember that 1N = 1kg*m/s 2 , not kg*m/s.

Also, if you look closely at the definition, you'll see that momentum is equal to a scalar (mass) times a vector (velocity). This means that momentum is also a vector quantity, and its direction is always the same as the velocity. In one dimension that direction can be only positive or negative. In two dimensions, the angle of the velocity in polar coordinates is the same as the direction of the momentum. In 2D or 3D, you'll most likely leave these vector quantities in component form for programming. The great thing about vectors is that each of these components can be treated separately, which brings you right back to one dimension.

Example 13.4: Calculating Momentum in 1D

If a truck weighs approximately 5500lbs, and it is traveling at 60mph down a straight road, what is its momentum?

Solution
  1. Notice that the truck's weight is approximated in pounds , but the definition requires mass in kilograms, so you need to do a conversion:

    graphics/13equ04.gif


    w = m g

    24,466.19N = m (9.8m/s 2 )

    m = 2496.55kg

  2. Also, the velocity needs to be converted to meters per second:

    graphics/13equ05.gif


  3. Now you can plug these two values into the definition:

    p = mv

    p = 2496.55kg(26.82m/s)

    p = 66,957.47kg*m/s

The momentum function looks like this:

 float momentum(float velocity, float mass)     {      float momentum;      momentum = mass*velocity;      return momentum;     } 

This example is one-dimensional, so the positive momentum indicates that the direction is forward, just like the velocity. Let's look at a 3D situation next .

Example 13.5: Calculating Momentum in 3D

If a spaceship has an approximate mass of 4500kg, and its current velocity vector is

graphics/13equ06.gif


what is its momentum at that instant?

Solution

This time the velocity is expressed as a 3D vector, so calculate momentum as a 3D vector:

p = mv

graphics/13equ07.gif


3D momentum is also straightforward in code. Here is a function the calculates the solution using a scalar multiplication:

 vector3D momentum3D(vector3D velocity, float mass)     {          vector3D temp;          temp = scalarMultiply(mass,velocity);          return temp;     } 

Now that you've defined momentum, there's only one more quantity to defineimpulse. To do so, revisit Newton's Second Law from Chapter 11, "Newton's Laws":

F = ma

Substitute the definition of acceleration:

F = m ( v f v i )/ t

F = ( mv f mv i )/ t

Do you recognize the top of that fraction? That's rightit's actually the change in momentum:

F = ( D p )/ t

Believe it or not, this was actually the original form of Newton's Second Law. Initially, he stated that force equals the rate of change of momentum. Eventually, most texts adopted the F = ma version.

The last step is to multiply both sides by time:

Ft = ( D p )

The left side of this equation is actually the impulse.

Impulse

Impulse = Ft

where F = net force and t = a very small time.


Typically, an impulse is a force delivered in a very small amount of time, such as an instant. For example, if a golfer tees up and hits the ball with his club, he delivers an impulse to the ball. The club is in contact with the golf ball for a fraction of a second, but it sends the ball flying. This brings us back to the equation you just derived:

Ft = ( D p )

This tells you that an impulse changes an object's momentum. In other words, a force delivered quickly results in a change of momentum. This means that if the mass does not change, the object either speeds up or slows down. This formula has a special name the impulse-momentum theorem .

Impulse-Momentum Theorem

Impulse = Ft = ( D p )

where F = net force, t = a very small amount of time, and p = momentum.


Conceptually, the impulse-momentum theorem is the same as Newton's Second Law. Both formulas support the idea that a net force applied to an object results in a change in velocity. However, you might find that the impulse-momentum theorem is more optimized for programming. Let's revisit the golfer getting ready to tee up. Chapter 11 discussed assigning a force for the club hitting the ball. Then you can calculate the resulting acceleration and use the five equations of motion to calculate the resulting velocity. A faster approach might be to assign a value to the impulse based on user input. Then, if you know the mass of the golf ball and its initial velocity (in this case, 0), you can calculate the final velocity as a result of hitting the golf ball with the club. Just like before, this final velocity then becomes the initial velocity of the projectile motion. The impulse-momentum theorem performs the same process, just with fewer steps.

The trick is to remember that this all happens very quickly. The golf club is in contact with the ball for only a fraction of a second. So the ball's motion has two separate segmentsthe collision with the club, which is an extremely small time interval, and the projectile motion.

Example 13.6: Impulse-Momentum Theorem

Suppose you're coding a golf game, and the ball has a mass of 45g (0.045kg). The player determines the club's impulse using a sliding scale. If the player selects enough force to deliver an impulse of

graphics/13equ08.gif


(measured in kg*m/s), what is the ball's resulting velocity?

Solution

Go straight to the impulse-momentum theorem and plug in what you know:

impulse = D p = mv f mv i

graphics/13equ09.gif


(The initial velocity is 0 because the ball is sitting on the tee.)

graphics/13equ10.gif


Here is what the impulse momentum theorem looks like in code:

 vector3D impulse3D (vector3D final, vector3D initial, float mass)      {          vector3D impulse,momentumFinal, momentumInitial;          momentumFinal = momentum3D(final,mass);          momentumInitial = momentum3D(initial,mass);          impulse = subtractVectors(momentumFinal,momentumInitial);          return impulse;      } 

NOTE

Remember that the final velocity you calculate here becomes the initial velocity for the projectile motion.


We've just scratched the surface of modeling collisions by examining the effects on one object in a collision. The impulse momentum theorem shows you how an object's motion changes as a result of being hit by something else. The next section takes this idea one step further and looks at how both objects should move as a result of colliding with each other. Just remember that momentum is at the root of all collisions.

Self-Assessment

1.

If a boulder weighs approximately 100lbs, and it rolls horizontally across the screen toward your player going 15m/s, what is its momentum at that instant?

2.

In a 3D game, your vehicle has a current velocity vector of

graphics/13equ11.gif

and a mass of 2000kg. What is its current momentum?

3.

In a fighting game, one player is standing still when the other player kicks him. If he weighs approximately 250lbs, and he gets hit with an impulse of 5000kg*ms/s, how fast should he go flying as a result of the kick?

4.

Suppose the player described in question 3 is not standing still when he gets kicked. Instead, he's running toward his attacker with an initial speed of 5m/s. What's his final velocity?

5.

Suppose you're coding a 3D fighting game. The player who gets hit still weighs approximately 250lbs. This time he's hit with an impulse of

graphics/13equ12.gif

What's his resulting velocity in 3D?


 < Day Day Up > 


Beginning Math and Physics for Game Programmers
Beginning Math and Physics for Game Programmers
ISBN: 0735713901
EAN: 2147483647
Year: 2004
Pages: 143
Authors: Wendy Stahler

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net