Projectile Motion in Portal 2 – part 3

And finally, let’s take a look at air resistance. Do falling objects in Portal 2 slow down due to air resistance?

Short answer: Yes! The Source engine accurately handles air resistance and terminal velocity!

Long answer:

Air Resistance and Terminal Velocity Background

Terminal velocity follows naturally from comparing forces acting on an object. As Newton’s first law explains, objects change the way they move only when acted upon by an outside force. For instance, a hockey puck is perfectly content sitting still on the ice so long as no forces are acting on it (as if we could speculate about the mindset of an inanimate object!). As soon as a force acts on it, perhaps in the form of a slap shot, it starts to move. The puck will maintain the same velocity until another force, let’s say the goalie’s glove, changes its velocity. To be even more precise, unbalanced forces cause changes in velocity. That is, multiple forces can act on an object without causing an acceleration so long as the forces balance each other out. In tug-of-war, for example, two teams may be enacting tremendous forces on a rope, but so long as both teams create the same force in opposite directions the rope doesn’t budge. As soon as one team pulls harder than the other, the forces become unbalanced and the rope’s velocity starts to change.

In the hockey example above, we assume the ice and air around the puck produce negligible friction on the puck, a tactic often employed by physics problems. In reality, the situation is more complicated. Any object moving through a fluid, such as air, or in contact with a surface, such as ice, feels friction. Friction is a unique force in that it always opposes motion. Without motion, friction does not exist. Unlike other forces, friction can never cause motion. As an object’s velocity increases, so does the force of friction.

In an situation analogous to tug-of-war, a falling object feels opposing forces. Gravity accelerates the object downward while air resistance accelerates the object upward in the form of friction. As the falling object gets faster, friction from air resistance increases. Eventually, the frictional force matches the gravitational force and the object no longer accelerates. At this point, the falling object has reached its maximum velocity, which we call terminal velocity.

The velocity of an object in freefall will generally follow the relationship below:
[equation 1, credit to Wikipedia]

where m is the mass of the object, g is acceleration from gravity, ρ is the density of the fluid (typically air), A is the cross-sectional area of the falling object (or the surface area of the side of the object facing the direction of motion), and CD is a dimensionless constant called the drag coefficient. Notice in this equation that mass is a factor, and a more massive falling object should fall faster than a lighter counterpart.

Terminal Velocity in Portal 2

Once again, we want to collect data from Tracker and fit a curve to it with Gnuplot. This time we’ll be looking at velocity as a function of time and trying to fit it to equation 1. We’ll use Gnuplot to fit the data to a function of the form of

[equation 2]      v(t) = -B*tanh(C*t),

where B and C represent the constants before the hyperbolic tangent (tanh) and inside the hyperbolic tangent of equation 1 respectively.

terminal velocity

Holy cow. The velocity of a freefalling 55kg contraption cube almost perfectly follows what you would expect from equation 1 (note: this graph lacks uncertainty).  We can confidently say that the Source engine mimics air resistance!

We’re left with an interesting situation, though. On the one hand, we have data that clearly show that whatever algorithms are controlling motion in Source accurately represent air resistance. But now we have to wonder about the constants within equation 1. We know Source scales terminal velocity to mass. But is Source using a realistic value for air density in the game? Is it really taking the cross-sectional area and drag coefficient of the cube into account?

For now, we can check if Source is at least internally consistent, regardless of whether or not it uses accurate values for the constants in equation 1. Let’s assume that Source uses some constant to account for drag coefficient and air density. We already know mass and gravity. So let’s solve for the cross-sectional area. Gnuplot solved equation 2 with B = 318.6 and C = 0.4768. If we equate B to the constant before the hyperbolic tangent in equation 1 and solve for the cross-sectional area, we get a value of 0.121 u2. Plugging in our value for cross-sectional area to the constant inside the hyperbolic tangent, C, and using all of the same values for ρ, CD, m, and g, we get C = 0.477, which is exactly what Gnuplot produced. So, at least Source is in some way internally consistent.

To be continued with a wrap up of projectile motion…

Tagged , , , ,

One thought on “Projectile Motion in Portal 2 – part 3

  1. […] Here’s the data I used to analyze projectile motion, in case anyone ever wants to do their own data analysis: Portal 2 Position Time Data, Portal 2 […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: