26.5 C
New York
Monday, July 1, 2024

You Can Use This Silly Game to Do Some Serious Physics

I'm a sucker for interesting online games that don't have a score or even a goal. In this case, it's a cartoon space simulator to promote the book What If? 2, by Randall Munroe, the author of the xkcd comics.

You can play it by clicking here. (Don’t worry, I’ll wait.)

The game works like this: You start off with a rocket on a very small planet. Click on the rocket to start, then you can use the arrows on your keyboard to turn on the thruster, rotate the spacecraft, and find other planets and a few fun things that are mostly inside What If jokes. That's it. That's the game. It's silly and fun, and I love it.

But it turns out that you can use even a simple game to explore some key concepts in physics.

Real Orbits

One of the things you can see on the initial planet is a recreation of “Newton's cannonball”—Isaac Newton’s thought experiment about the connection between a fast-moving projectile and orbital motion. Newton said that if you were able to shoot a very fast cannonball horizontally off a very tall mountain, it's possible that the curve of its trajectory could match the curvature of the Earth. This would make the cannonball fall but never hit the ground. (This is essentially what happens with an orbiting object like the International Space Station), only the ISS wasn't shot off a tall mountain.)

Seeing Newton's cannonball made me assume that I could get my spacecraft to orbit this tiny planet, which would be fun. I tried it right away using the arrow keys—with very little success. Every time I almost got it into a stable orbit, it wouldn’t last. That made me wonder if the physics interactions that control orbits in the What If world are anything like those in the real universe.

The first physics concept that applies to orbital motion is, of course, gravity. There is a gravitational interaction between any two objects that have mass. For example, there is an attractive force between the Earth and the pencil you are holding in your hand, since they both have mass. If you release the pencil, it falls.

If you’re standing on the surface of the Earth, the gravitational force acting on the pencil seems to be constant. However, if you get that pencil far enough away from the Earth (like 400 kilometers away, which is the distance at which the ISS orbits), then you would notice a decrease in the gravitational interaction: The pencil would weigh less and take longer to fall.

We can model the gravitational force between two objects with the following equation:

Most PopularBusinessThe End of Airbnb in New York

Amanda Hoover

BusinessThis Is the True Scale of New York’s Airbnb Apocalypse

Amanda Hoover

CultureStarfield Will Be the Meme Game for Decades to Come

Will Bedingfield

GearThe 15 Best Electric Bikes for Every Kind of Ride

Adrienne So

In this expression, m1 and M2 are the masses of the two objects (like the pencil and the Earth), r is the distance between their centers, and G is the gravitational constant, which has a value of 6.67 x 10-11 N*m2/kg2.

Since the Earth has such a large radius—6.37 million meters—moving even 1,000 meters away from the surface won’t significantly change the distance between the center of the Earth and the pencil. But really, the important thing to note in terms of orbits is that the gravitational force on the object decreases with the square of the object’s distance from the center of the Earth. So, as the distance to an object increases, the force will decrease and produce a smaller acceleration. This is actually significant for orbits, as you need a particular force for an orbit at a certain altitude.

The second big physics concept deals with an object moving in a circle. It doesn't matter if you are on a spinning merry-go-round or traveling aboard a space station; in both cases, you are moving in a circle. Any change in this motion, such as stopping or reversing direction, requires a force. For the merry-go-round, this force is due to the friction between your feet and the floor, and it points toward the center of the circle. If you were on the space station, the force would be—wait for it—the gravitational force, which pulls toward the center of the Earth. The magnitude of this center-pointing force depends on both the velocity of motion (v), the radius of the circular path (r), and the mass of the moving object (m1).

Notice that both the gravitational force and the force required for circular motion depend on the size of the circle (r). However, if I set the gravitational force equal to the circular force, the radius doesn't cancel, since gravity depends on the square of the radius but the circular force doesn't. Since the mass (m1) cancels, and the velocity doesn’t, that means that for a particular orbital radius, there is only one velocity that will work.

Most PopularBusinessThe End of Airbnb in New York

Amanda Hoover

BusinessThis Is the True Scale of New York’s Airbnb Apocalypse

Amanda Hoover

CultureStarfield Will Be the Meme Game for Decades to Come

Will Bedingfield

GearThe 15 Best Electric Bikes for Every Kind of Ride

Adrienne So

The orbital velocity depends on the mass of the planet (M2), the gravitational constant (G), and the orbital radius (r). If you put these values in for the International Space Station moving 400 kilometers above the Earth's surface, you get an orbital velocity of 7,666 meters per second, or 17,148 miles per hour.

Now that we have some idea of how orbits and gravity work in the real world, let’s find out what happens in the game.

What If Gravity

Let’s try a simple experiment in the What If world. I start with the rocket on the surface of the cartoon planet and give it a little bit of thrust. It pretty much does what you expect: It moves up, slows to a stop, and then falls back down to the surface. That means there must be some type of attractive force between the rocket and planet. But does it work the same way real gravity works?

One way to examine the "gravitational" force on the rocket is to look at its position as a function of time. If you have position-time data for an object, then you get both its velocity and its acceleration. Since the force is proportional to acceleration (because net force = mass × acceleration), you can get an idea about the force.

But how do you get the position of the rocket as a function of time? The answer is video analysis. This is the process of marking an object (like a rocket) in each frame of a video. Each frame is like a slice of time. If you know how big the object is in the video, you can get its position. It helps to have some nice software; I always like to use Tracker Video Analysis.

Most PopularBusinessThe End of Airbnb in New York

Amanda Hoover

BusinessThis Is the True Scale of New York’s Airbnb Apocalypse

Amanda Hoover

CultureStarfield Will Be the Meme Game for Decades to Come

Will Bedingfield

GearThe 15 Best Electric Bikes for Every Kind of Ride

Adrienne So

OK, there is one small issue. I don't actually know the size of stuff in the What If world, so I'm going to have to guess. In the game, you can see two stick figures standing on the surface of the cartoon planet, on either side of the rocket’s launch pad. How about we say that the person on the right is 1.75 meters tall, which is the average height of an American man? From that, I can measure the size of the rocket (1.702 meters) and even the radius of the planet (about 31 meters).

In a video analysis, you want to set the x-y origin—the point that the x and y values for distance and altitude are measured from—at a single point on the screen. It can be anywhere, but you usually want to pick a noticeable feature. If you try playing this game, you will notice that the view on your screen keeps moving around to keep the spacecraft in the center. That means I can set the origin to the center of the rocket.

Now I can just track the motion of some part of the planet as the rocket flies away from it. This will give me the motion in the opposite direction of the rocket’s, but it’s simpler to do this than to have to keep resetting the origin to some point in the background that jumps around a lot.

With that, I get the following plot of position vs. time:

Since the plotted data has an arc like a parabola, that means we can find a quadratic equation that matches this data. (Tracker does that for us.) A parabolic equation is exactly what you would expect to get for an object with a constant acceleration. In fact, it comes up so often in physics courses that it even has a name—the kinematic equation. It looks like this:

Most PopularBusinessThe End of Airbnb in New York

Amanda Hoover

BusinessThis Is the True Scale of New York’s Airbnb Apocalypse

Amanda Hoover

CultureStarfield Will Be the Meme Game for Decades to Come

Will Bedingfield

GearThe 15 Best Electric Bikes for Every Kind of Ride

Adrienne So

In this expression, y0 and v0 are the starting positions and velocity, and a is the acceleration. In this case, the rocket moved up 13.4 meters and took about 5 seconds to go up and back down.

We actually learn two important things from this rocket data. First, the acceleration is constant. Second, using the fit parameters and the coefficient in front of the t2 term, we see that the vertical acceleration has a value of 5.6 meters per second squared. A constant acceleration implies that the gravitational force is also constant.

Remember that in the real world, gravity is constant near the surface of the Earth. But something must be different in the What If world, because this motion isn’t near the planet’s surface. My analysis using the stick figures already told me that the radius of this planet is 31 meters and the rocket moves upward 13.4 meters. In the real world, that would be the equivalent of sending a rocket from Earth’s surface to an altitude of 2.8 million meters, or 1,710 miles. The gravitational field would decrease from 9.8 m/s2 at the surface to 4.8 m/s2. That's not even close to being constant.

How would you orbit a planet with a constant gravitational force? First, notice that the magnitude of the gravitational force is constant, but it still points toward the center of the planet. Suppose we model this force as just m1 × g where g = 5.6 m/s2. I should be able to make a circular orbit. In this case, I can set the new gravitational force to the mass of the spacecraft multiplied by the circular acceleration to get the following:

Most PopularBusinessThe End of Airbnb in New York

Amanda Hoover

BusinessThis Is the True Scale of New York’s Airbnb Apocalypse

Amanda Hoover

CultureStarfield Will Be the Meme Game for Decades to Come

Will Bedingfield

GearThe 15 Best Electric Bikes for Every Kind of Ride

Adrienne So

In the game, there’s a white line circling the cartoon planet. (If you follow it, it leads to the Newton’s cannonball illustration.) Using the height of the stick figure guy as a guide, I calculate that this line has an altitude of 11 meters above the planet.

Let’s say I want to try orbiting at this altitude. That requires an orbital radius of 42 meters, which means I need to make the rocket travel at a speed of 15.3 meters per second.

There’s really no way to precisely control your speed in the game—you just have to use trial and error to adjust your thrusters and turn the spacecraft in a way that keeps the rocket at the same altitude. It's quite difficult. I think I got close, but it wasn’t perfect. Based on my measurements, the spacecraft was moving at around 13 m/s—a little bit slower than calculated. I'm not sure if this is because my gravity calculation was off or maybe I just didn’t achieve a perfectly circular orbit.

What If Model

You've probably heard me say it before: You don't really understand something unless you can model it. So let's build a Python program to see if we can reproduce the motion in the What If world.

Here's how this is going to work: I'm going to make an object with the same initial position and initial velocity as the rocket in my attempted orbit. From that, I will break the problem into short time intervals of 0.01 seconds. During each interval, I can assume the acceleration is constant. With this, I can calculate the position and velocity of the Python-object at the end of the time interval. Then I can just repeat this for the next time interval and all the time intervals after that. This is the main idea of a numerical calculation. (Here's another example of how this works.)

Now let's take a look at the output. This was created with Web VPython, an online Python implementation that has built-in functions for 3D objects. Here is my calculated motion:

How does that compare to the motion in the What If world? I can plot the distance from the center of the planet as a function of time for both the measured and calculated rocket. With that, I get the following plot:

Most PopularBusinessThe End of Airbnb in New York

Amanda Hoover

BusinessThis Is the True Scale of New York’s Airbnb Apocalypse

Amanda Hoover

CultureStarfield Will Be the Meme Game for Decades to Come

Will Bedingfield

GearThe 15 Best Electric Bikes for Every Kind of Ride

Adrienne So

These two curves aren't identical, but this isn't too bad, either. It's not completely trivial to measure the exact initial conditions in the What If world, so overall, I'm pretty happy.

What If World and the Nature of Science

Some of you might be wondering why I'm wasting my time trying to figure out how this program works. Couldn't I just ask the creators of the game if gravity is constant?

Yes, I could. But that would be the opposite of fun. This game gives people the opportunity not just to explore the What If world but also to investigate how it works. It's a web-based version of real-life science, which is the process of building and testing models based on data. (Except a lot cheaper, since you don't actually need to build anything to test your model.)

For example, there are other planets in the game. They have different sizes, but do they also have different gravitational forces? If the gravity is different, is there some relationship between the size of the planet and the gravitational force?

Or: The rocket has thrusters. When they are fired, the rocket increases in speed. What is the acceleration of the rocket while the engine is on?

If you want answers, you have to keep exploring. If you want to know whether the gravitational force depends on the size of the planet, you have to find another planet. If you want to know what kind of acceleration the thrusters produce, you need to find a good situation to measure this (like maybe flying into deep space, away from the planets). Just like in real life, it’s up to you to create your own experiments.

Related Articles

Latest Articles