Videos

shoot the coconut

For some reason, one physics problem that has stuck with me since I was an undergrad is the “shoot the coconut” problem. The scenario involves a coconut falling from a tree and another projectile being thrown or launched at it. Students have to calculate the right angle and velocity of the projectile to hit the coconut before it hits the ground.

The Puzzle Maker is perfect for bringing physics problems to life. Here’s my take on shooting coconuts in Portal 2.

Let’s do a little bit of informal physics to calculate the velocity of cube 2 when launched. For simplicity’s sake, we’ll label the falling cube C1, and the launched cube C2.

C1 falls about 13 panels (units) before striking C2. Using the equation for displacement, we find that it takes about

t = sqrt (2*h/g)          (1)

to reach the point of impact. By equation 1, t = 2.35 s. That is, of course, without air resistance. Taking into account air resistance and the amount of time it takes for the cube to actually leave its dispenser give us t = 3.6 s (calculated with a stopwatch, by the way).

It takes almost 2.7 s for C2 to drop, roll, hit the AFP and get launched through the air (this number actually varies from test to test because cubes don’t always leave their dispensers in exactly the same way).

That leaves us with about 1.1 s for C2 to leave the angled panel, fly through the air and strike C1 as it falls. C2 leaves the orange portal at an angle, θ = 45 degrees and has to travel 4 panels in the x-direction to reach C1. So, in the x-direction, C2 has a velocity, vx = 3.6 u/s. Using trigonometry, we start with

vx = v*cos(θ)          (2)

and then rearrange to find

v = vx/cos(θ)          (3)

which tells us the initial velocity of C2. After plugging in our variables, equation 3 tells us that C2 has an initial velocity of v = 6.9 u/s.

Gotta love physics.

Oscillators

Correction: I originally labeled this post and the corresponding youtube video as describing a simple harmonic oscillator. Incidentally, it isn’t. It’s just an oscillator. Not sure what I was thinking when I made this. I’ve made all the corrections I could without changing the video. I’ll post an updated version eventually.

Oscillators run through physics. Light waves, sound waves, pendulums, bouncing balls, shock absorbers, springs, circuits, and any other repeated process can be described using the math of oscillators. In Portal 2, we can make an oscillator using two portals placed on a horizontal surface.

A few things to note:

1) Objects other than the player are dampened because they feel air resistance. The strength of the air resistance will be covered later.

2) There is a minimum amplitude for oscillations through portals. No matter the object, eventually it will become an undampened simple harmonic oscillator.

3) As described in the video, the math behind finding the period of an oscillation is pretty simple and appears to work. That being said, it’s worth investigating a little more rigorously to determine the accuracy of the Source engine. Other physics engines have been found to cheat with physics, especially in terms of the way time goes by in the game. For instance, the Karma engine that Unreal Tournament 2004 uses has been found running time at 110% speed. I’d be interested to know if Source does something similar.

edit: 4) This isn’t technically a dampened oscillator! I’ll be investigating the differences soon!

the physics of momentum flings

One of the main mechanics in Portal 2 is the momentum fling, which allows a player to send themselves great distances through the air. A momentum fling redirects momentum gained through potential energy into a parabolic path through the air. It involves two portals, one placed well below a player and another usually placed on a vertical or angled panel. Whatever momentum a player gains going into the portal below them will be conserved as they are flung out of the vertical or angled portal and then fly through the air.

A few things to note:

1) The player flies farther than the companion cube. The player doesn’t feel air resistance while the cube does. Also, it appears that the player lands exactly where the equations say she should (of course, slight approximations were involved, so a little more detailed experimentation would be a good thing). +1 for the Source engine’s accuracy.

2) In class, the momentum fling can be used to investigate multiple areas of physics, including: momentum, conservation of energy, projectile motion, and air resistance. All great physics topics.

3) Adding barriers or obstacles would make this a perfect way to test student knowledge of projectile motion. Give students a maximum ceiling height or a minimum path height (i.e. a wall is between the player and the destination) and allow students to calculate the necessary starting height and portal angle to make it to their destination.

4) Add a moving target to further torture students. Make them calculate the time it takes to make it to a destination. Now they have to figure out the math to fling themselves not only to the right place but at the right time.