Table of Contents

Work
When determining the motion of an object, one can certainly use Newton's Laws of Universal Motion to determine the acceleration, but its not always simple. Often the forces acting on an object can be very dynamic and will vary depending upon the orientation of the object itself or the surface the object is on. A useful tool when analyzing the motion of an object is its energy. When a force acts on an object over some distance, it may add energy to that object. This change in energy is called the work done on the object,
(1)The amount of work done, or the change in energy of the object, can be found by taking the dot product of the force vector and the displacement vector,
(2)The unit for work is a Newtonmeter (Nm) or simply called a Joule (J). Notice in Equation 2 that when the force and displacement vectors are perpendicular, no work is done.
Example:
A 10kg crate is pulled by a 25N force angled at 40 degrees from the floor. If the crate is pulled across the floor for a distance of 12 m, what is the work done by the force?$W = F \cdot d \cos \left( \theta \right)$
$W = 25 N * 12 m * \cos \left( 40^o \right) = 230 J$
Example:
A force, $\vec F = < 12.0, 3.5, 5.7 > N$, acts over the displacement, $\vec d = < 14.6, 5.7, 20.0 > m$. How much work is done?
$W = \vec F \cdot \vec d = \left( 12.0 * 14.6 \right) + \left( 3.5 * 5.7 \right) + \left( 5.7 * 20.0 \right)$
$W = 81.2 J$
In the last example, note that the work done is negative. This means that energy is being removed from the system.
Energy
When work is done on an object, the type of energy that changes may be either or both of two types, potential energy and kinetic energy. Potential energy is energy that is stored somehow. Imagine lifting a weight from the floor to over your head. You exerted a vertical force over a vertical distance, therefore you did work on it. The energy you put into the weight becomes potential energy. The weight has the potential to move if you let go of it. Since the weight is over your head, I wouldn’t recommend it. You can also add energy to an object by causing its speed to change. Kinetic energy is the energy of motion. Any object that’s moving with any amount of speed has kinetic energy. The more mass the object has and the faster its moving, the more kinetic energy the object has. When you throw a ball, you exert a roughly horizontal force over a roughly horizontal distance. This work goes to increasing the speed and therefore the kinetic energy of the ball.
Potential Energy
There are many types of potential energy: gravitational, electrical, and elastic are just a few. In a game environment, you could even create a type of magical potential energy in which you store energy in a magic item for use later. For now, we'll stick with purely physical types of potential energy. Imaginative adaptations will be left as an exercise for you, the developer, at a later date.
Gravitational Potential Energy
Let's first start by examining the potential energy of an object close to the surface of the Earth. As you lift an object, you must exert a force that is at least equal to its weight and you exert that force through a distance that results in some change in the object's height.
(3)where $h$ is the height of the object. Notice that the potential energy depends upon your reference frame. For example, if you try calculating the potential energy of a coffee mug resting on a desk, what do you claim as its height? Do you measure the height from the desktop, the floor, the ground outside, or from sea level? As it turns out, any of the options are fine so long as you don't change your reference point midway through your work. We will never be interested in the actual value of an object's potential energy, but rather we will be concerned with the change in potential energy.
Elastic Potential Energy
There are many types of systems in which energy can be stored by stretching something with elasticity such as a spring or a rubber band. Most real springs, and especially rubber bands, do not behave in a linear way, although for the purposes of any game physics application we can assume that they do. As you stretch a spring, rubber band, or say the string of a bow, you exert a force through a parallel distance. In other words, you do work and add energy to the system. This energy is stored as Elastic Potential Energy. The elastic object tries to force the the object back to the beginning, unstretched position. This is called a restoring force. In the linear systems we will consider, this is called a linear restoring force and is known as Hooke's Law,
(4)where $\vec {d}$ is called the elongation, how far the spring is stretched, and $k$ is call the spring constant. The spring constant is a measure of how stiff the spring is, or how much force the spring exerts per unit length as the spring is stretched. The default mks metric unit for the spring constant is $N/m$. When you do work against this linear restoring force, each extra bit of elongation requires an extra bit of force. Integrating the force over the distance the spring is stretched or compressed yields an amount of stored energy, elastic potential energy, that is proportional to the square of the elongation, or compression, of the spring.
(5)Movement under the influence of a restoring force often yields oscillatory motion. We'll investigate this more later in this chapter when we look at using gradients to calculate forces.
Kinetic Energy
Increasing or decreasing an object's speed will change an object's kinetic energy, the energy of motion. Reflecting back on how we defined what work is and how work is done, we can see that
(6)If the object starts out at rest, it has no energy of motion, $KE_i = 0$, so
(7)From the four kinematic equations, and knowing that $v_i = 0$
(8)Inserting these into the equation for work yields
(10)and finally canceling out $t$ gives us our final equation for the kinetic energy of an object.
(11)Note here that this is a scalar quantity; direction does not matter, only the magnitude of the velocity affects the kinetic energy.
WorkEnergy Theorem
As mentioned above, doing work on an object results in a change of energy. This concept is called the WorkEnergy Theorem. Of course, the work done could go to changing either the kinetic energy, the potential energy, or both, so Equation 1 becomes.
(12)Using this relationship can help solve a lot of problems very quickly that would require significant effort of one were to use a direct application of Newton's Laws of Motion. To be sure, Newton's Laws are always valid and when used well, will always give you the right result, but there are many cases when applying the workenergy theorem can yield results much faster and with less effort.
Conservative and NonConservative Forces
Some forces, like gravity and elastic forces, conserve the total amount of potential and kinetic energy. For these forces, no work is done as the object moves. These forces are called conservative forces. The type of energy may change from potential energy to kinetic energy and back again, but the total amount of energy does not change.
Forces that do change the total amount of potential and kinetic energy, therefore doing work on an object, are called nonconservative forces. Some types of nonconservative forces include any applied force from a person, a rope, or an motor, friction, and wind resistance.
Conservation of Mechanical Energy
Let’s take a look at how Equation 1 changes for a conservative force,
(13)The motion resulting from conservative forces is path independent, meaning that one only needs to know information about the initial and ending points. We don’t need any information about the path taken between the two points. This simplifies things significantly. Forces like friction, air resistance, and applied forces can add or remove energy from an object, therefore doing work on them. These are called nonconservative forces. Nonconservative forces are pathdependent. The amount of energy they add or remove depends upon the exact path the object takes. Dissipative forces like friction and air resistance take the kinetic energy of an object and convert it to heat energy. One way of dealing with this type of energy loss in your program is to remove a certain small fraction of the kinetic energy from the object at each timestep. This will result in a slow decrease of total energy, and the rate of energy loss will be dependent upon the speed of the object.
Example:
If you drop a bowling ball off the top of the Regnier Center, 18.4 m above the ground, how fast will it be going when it strikes the ground?$h_i = 18.4 m, h_f = 0, v_i = 0$
$KE_i = 0, KE_f = \frac {1} {2} m v^2_f$
$PE_i = m g h_i, PE_f = 0$
$\Delta KE =  \Delta PE$
$KE_f  KE_i =  \left( PE_f  PE_i \right)$
$KE_f = PE_i$
$\frac {1} {2} m v^2_f = m g h_i$
$v = \sqrt { 2 g h_i } = \sqrt { 2 * 9.8 * 18.4 } = 19.0 m/s$
Exercise:
A ball is thrown upward with a velocity of 14.3 m/s from an initial height of 1.80 m. How high will be ball go before coming back down?
Using Gradients
The potential energy for an object can be very useful when trying to determine the net force on an object. Often calculating and evaluating the forces acting on an object can be complex and computationally expensive. If you have a global function that describes the potential energy for an object throughout your environment, you can find the net force by examining how the potential energy changes with distance. This is called the potential energy gradient. The net force will point in the direction of the greatest decrease of potential energy. You can do this for each of the three components of the net force using the following equations:
(15)Let’s start out simple by thinking of the onedimensional case of a roller coaster. You might argue that a roller coaster is actually a twodimensional case, but since the car is constrained to move along the track, it only has one degree of freedom and is therefore a onedimensional problem. The potential energy of the car depends on its height, which can be expressed as a function of its position on the track. Let’s take the car’s position on the track as being $s$. Here, $s$ represents the distance along the track, not an xy coordinate. We need to look at the change in potential energy at $s$ minus some small amount and $s$ plus some small amount. Let’s call this small amount epsilon, $\varepsilon$. The net force on the car in the direction of the track can be found by applying equation 15,
(16)The size of $\varepsilon$ is arbitrary, so long as it’s smaller than the typical change in position from one timestep to the next.
Let's consider a case where the height of a path is proportional to the square of the distance along the path, $y(s) = s^2$. Then the potential energy at any point along the path would be $PE = m g y = m g s^2$. Now that we have the potential energy as a function of position along the path, we can use the gradient to find the force. Choosing the size of $\varepsilon$ at this point is critical. If $\varepsilon$ is too large, then you will get a very inaccurate approximation of the force, and you may miss subtle changes in the potential energy that can influence the force. If you choose a value of $\varepsilon$ that is too small, then the difference in potential energy at $s + \varepsilon$ and $s  \varepsilon$ may be smaller than the precision of your floating point representation will allow. You're safer here using doubleprecision rather than singleprecision floats, but it will cost you memory.
Example:
Find the value of the force given $PE(s) = 19.6 s^2 J$ and $\varepsilon = 1.0 m$ at the position $s = 12.0 m$
$PE(s + \varepsilon) = 19.6 * (12.0 + 1.0)^2 = 3312.4 J$
$PE(s  \varepsilon) = 19.6 * (12.0  1.0)^2 = 2371.6 J$
$F =  \frac { PE(s + \varepsilon)  PE(s  \varepsilon) } {2 \varepsilon}$
$F =  \frac { 3312.4  2371.6 } { 2.0 } = 470.4 N$
Example:
Repeat the above problem using $\varepsilon = 0.01 m$
$PE(s + \varepsilon) = 19.6 * (12.0 + 0.01)^2 = 2827.10596 J$
$PE(s  \varepsilon) = 19.6 * (12.0  0.01)^2 = 2817.69796 J$
$F =  \frac { PE(s + \varepsilon)  PE(s  \varepsilon) } {2 \varepsilon}$
$F =  \frac { 2827.10596  2817.69796 } { 0.02 } = 470.4 N$
In the above examples, the final value of the force ended up being exactly the same because of the simplicity of the potential function. In a case where the potential function is more complex, the difference in $\varepsilon$ will result in a different force value. As an exercise, copy and compile the following code. Enter different values for eps and see how it affects the force.
One area where this method is extremely useful is in evaluating the motion of an object in space where there may be multiple gravitational forces. The formula for potential energy given in Equation is only good for motion near the surface of Earth, or for the surface of any object if you change the value of $g$ appropriately. For an object in orbit where the distance between the object and the Earth or other gravitating bodies changes significantly, the potential energy is given by
(17)where $G = 6.67 \times 10^{11} \frac {N \cdot m^2 } { kg^2 }$, and $r$ is the distance between the object and the gravitating body. Since the potential energy will be calculated often, its best to define the potential energy as a function you can call rather than coding in the calculation each place in your program where you need it. This provides a way to calculate a net gravitational force on an object in a much easier, and computationally less expensive manner.
//A sample construct of how to use the gradient of a potential energy function to calculate a force float epsilon = 0.01f; //This value will depend on the scale of your position vectors Vector3D EpsilonX(epsilon,0.0f,0.0f); Vector3D EpsilonY(0.0f,epsilon,0.0f); Vector3D EpsilonZ(0.0f,0.0f,epsilon); while (Player1.health() > 0.0f) { //or whatever loop your game or sim runs through Position += Velocity * dt; //Update the position vector with the previous velocity vector Velocity += Acceleration * dt; //Update the velocity vector with the previous acceleration vector // ** Determine the force components using the gradient of the potential energy ** Fx = 1.0f * (PotentialEnergy(Position+EpsilonX,mass)  PotentialEnergy(PositionEpsilonX,mass)) / (2.0f * epsilon); Fy = 1.0f * (PotentialEnergy(Position+EpsilonY,mass)  PotentialEnergy(PositionEpsilonY,mass)) / (2.0f * epsilon); Fz = 1.0f * (PotentialEnergy(Position+EpsilonZ,mass)  PotentialEnergy(PositionEpsilonZ,mass)) / (2.0f * epsilon); NetForce.SetRectGivenRect(Fx,Fy,Fz); //Construct the new net force vector Acceleration = NetForce & (1.0f / mass); //Calculate the new acceleration vector } ... float PotentialEnergy(Vector3D ObjPos, float ObjMass) { float NegBigG = 6.67E11; // (note, these values are not real. your values will be different!) Vector3D Pos1(1.0f,2.0f,3.0f); //position of the first gravitating object float M1 = 10.0f; //mass of the first gravitating object Vector3D Dist1 = ObjPos  Pos1; //Distance between the player and the first gravitating object //Calculate the gravitational potential energy between the player object and the first gravitating object float PE1 = NegBigG * ObjMass * M1 / Dist1.GetMagnitude(); Vector3D Pos2(1.0f,2.0f,3.0f); //position of the second gravitating object float M2 = 10.0f //mass of the second gravitating object Vector3D Dist2 = ObjPos  Pos2; //Distance between the player and the second gravitating object //Calculate the gravitational potential energy between the player object and the second gravitating object float PE2 = NegBigG * ObjMass * M2 / Dist2.GetMagnitude(); // * repeat for however many gravitating objects you have in the worldspace * return (PE1 + PE2 + ...); //number of terms depends upon the number of gravitating objects }
Work Done By NonConservative Forces
Nonconservative forces can alter the mechanical energy of an object, that its they can add or remove potential and/or kinetic energy.
(18)If one knows the average force that acts on an object over some distance, then the velocity at the end of that distance can be determined through use of Eq. 18. Let's look at an example of a player accelerating upward using a jet pack.
Example:
A player ignites their character's jetpack which provides 1250 N of thrust over a distance of 225 m. If the character with all the equipment and jetpack have a total mass of 105 kg, starts from rest on the ground, and the rises to a height of 25.0 m, what is the final speed of the character?
$W = F d = \Delta KE + \Delta PE = \left(KE_f  KE_i \right) + \left(PE_f  PE_i \right)$
$F d = \frac {1} {2} m v_f^2 + m g h_f$
$\frac {1} {2} m v_f^2 = F d  m g h_f$
$v = \sqrt{2 \left( \frac {F d} {m}  g h_f \right)}$
$v = \sqrt{2 \left( \frac {1250 N \cdot 225 m} {105 kg}  9.8 \frac {m} {s^2} \cdot 25.0 m \right)}$
$v = 69.8 m/s$
Power
Power, simply put, is the rate at which work is done. Any motor, or person, can do any amount of work. What makes powerful motor different from a weaker one, or a professional athlete different than a normal person, is the rate at which work gets done. Think, for example, about two cars accelerating from zero to 60 mph, a Ford Focus and a Ford GT. The Focus will get up to speed in 10.3 s, but the GT will achieve the same speed in 3.7 s. The two cars are approximately the same weight, so the main difference in the time is the result of the power of their engines. Both are doing the same amount of work, creating the same change in energy, but the more powerful GT does that work much faster. Mathematically, we can express power as
(19)or
(20)For a motor moving an object against a constant resisting force at a constant velocity, we can rewrite Equation 19 thusly,
(21)where $\theta$ is the angle between the force and velocity vectors.
Review Exercises
Conceptual Questions
 What is the difference between a conservative and a nonconservative force?
 What becomes of the kinetic energy removed from an object by the force of friction?
 Qualitatively discuss the amount of kinetic, potential and total energy a car of a rollercoaster has as it leaves the station, climbs the first hill, and descends to the bottom of the first hill.
 A car driving around circular track at a constant speed is held in its path by the force of friction between the tires and the road. In this case, does the force of friction do work on the car? Defend your answer.
Problems
 Find the total energy of a 1000kg plane flying at an altitude of 500 m at a speed of 65 m/s.
 The aircraft from the above question lands at a speed of 25 m/s. How much work was done by air resistance on the aircraft from when it was flying as described in Question 1, to when it touches down on the runway?
 Calculate the amount of work done by a 145N force at 20 degrees above the horizontal acting over a horizontal distance of 12.4 m.
 Calculate the amount of work done given the following force and displacement vectors: $\vec F = 24.5 N \hat x  12.9 N \hat y + 9.3 N \hat z$ and $\vec d = 1.09 m \hat x + 3.98 m \hat y  12.5 m \hat z$
 A crane at a loading dock does 194 kJ of work is done to a 450kg crate. How high did the crane lift the crate?
 A 1230kg car is accelerated from zero to 27.8 m/s in 10.3s. How much work was done on the car?
 A batter hits a baseball directly upward at a speed of 45 m/s. Use the conservation of energy to find the maximum height the popfly reaches.
 The tallest roller coaster in the world, Kingda Ka, has record setting drop of 127 m. Using the conservation of energy, what is the speed of this roller coaster assuming that the car begins at the top of the essentially at rest?
 If a 100 kg bicyclist begins at rest at the bottom of a 20m high hill and does 25 kJ of work to reach the top of the hill, how fast is the bicyclist traveling at the top of the hill?
 The GE Dash 944CW locomotive is capable of producing 4380 hp. For a typical coal train of 150 cars, three of these engines are used. Each locomotive has a mass of 179,000 kg. Each loaded coal car has a mass of 118,000 kg. What’s the minimum amount of time needed to for three Dash 9s to accelerate this train to a running speed of 65 mph?
 What is the minimum power required to lift a 2500kg anchor at a constant speed of 0.20 m/s?
 Write a function for the potential energy of a spacecraft of mass $m$ at the position $\vec r_{craft} = X \hat x + Y \hat y + Z \hat z$ in a space that contains two gravitating masses, $M_1$ and $M_2$, at the positions $\vec r_1 = X_1 \hat x + Y_1 \hat y + Z_1 \hat z$ and $\vec r_2 = X_2 \hat x + Y_2 \hat y + Z_2 \hat z$
 What is the potential, kinetic, and total energy for the International Space Station given that it orbits at an average altitude of 333 km at an average speed of 7.707 km/s and has a mass of 213,800 kg.
 The IMP8 spacecraft has a mass of 371 kg, and orbits the Earth at a distance of 215,000 km. The mass of the Earth is $5.98 \times 10^{24} kg$. What is the potential energy for IMP8?