Python Shorts — Artificial Gravity in Space | by John Clark Craig | Jun, 2022

Python makes it simple to calculate just how fast a space station needs to spin to generate one G of artificial gravity.

Spinning space stations create artificial gravity — image courtesy Orbital Assembly Corporation

In the movie Interstellar, Mathew McConaughey and crew start their wheel-shaped station spinning in space in order to generate one G of artificial gravity, or the same acceleration we experience due to gravity here on Earth. They spin up to a certain rotational velocity in order for the centripetal force to reach one G.

The Interstellar station as it spins in space — courtesy Interstellar

So how fast did they need to spin this relatively small station? The three factors are spin rate, the radius of rotation, and the G forces created at the circumference. The following Python program lets you input any two of these, and the third is calculated.

Search “artificial gravity” in Wikipedia for a much more in-depth explanation of how the physics of all this works. If g is the number of g-forces relative to earth’s gravity, r is the radius of spin, and s is the number of seconds for one complete rotation, then this equation ties them all together:


Plug in any two known values for g, s, and r, and the remaining unknown can be solved for. Here’s a short Python program to do these calculations…

from math import *print("\nRadius of rotation (meters)")
print("Seconds per rotation")
print("Gs = normal gravity is 1.0")
print("\nEnter two knowns..")
a = "Radius: "
b = "Seconds/rot: "
c = "Gs of accel: "
r = input(a)
r = float(r) if r else 0
s = input(b)
s = float(s) if s else 0
g = input(c)
g = float(g) if g else 0
if not r:
r = 9.8 * g * s**2 / (4 * pi**2)
if not s:
s = 2 * pi / (9.8 * g / r) ** 0.5
if not g:
g = 4 * pi * pi * r / 9.8 / s**2
print(a, r)
print(b, s)
print(c, g)

Notice that after each call to input(), the assigned variable is checked to see if a value was actually entered. If not, a value of zero is assigned, preventing errors down the road. This is a handy hack for some data entry situations.

Example Calculation

I timed the rotation of the station shown in Interstellar with a stopwatch at the point where they stated they were up to a full 1 g. It was spinning approximately 12 seconds per complete revolution. Assuming the producers were attempting to be realistic with their physics, how far out from the center of the rotation was Mathew McConaughey?


35 plus meters is about 117 feet, a radius of spin that appears to be very roughly in the right ballpark for the CGI depiction of the spinning station.

A Lighter Weight Calculation

A full 1 g of artificial gravity might not be required to prevent astronauts from having health issues on longer voyages, say to Mars some time in the near future. Let’s run the program again, where we assume the radius of rotation is 36 meters, and we only want the equivalent of a half-gravity of force. How many seconds per revolution will be required?


Seventeen seconds would do the trick.

A Much Longer Calculation

For a final example, consider twin habitable pods at each end of a 5 km tether, spinning around each other like a two-headed bolas:

1*vkaGYRDA9CpX0 QvrwQ5w
Courtesy Pearson Scott Foresman

Well, remove the horse, the rider, the bird, and cut the string near the middle, and then imagine the two bolas balls dancing around each other. In space. Smoothly. With people on board. I know, it’s a stretch, but you get the idea.

If Space Station Bolas is rotating slowly at once every two minutes, or 120 seconds, how many g-forces are created in the pods at each end? Notice that the radius of rotation is half the tether length, or 2500 meters…

1*ZIo9FV uwB7N 0hB0zD5nw

A g-force of about 0.7 would be quite reasonable, and a spin taking a full two minutes would minimize dizziness and disorientation.

Of course there are other issues to contend with for Space Station Bolas, such as handling any types of accelerations as they neared Mars, moving equipment and supplies between the pods, docking somehow or another to the station, and so on. But we’re just having fun with Python, so I’ll leave that part of the discussion for others to think about.

News Credit

%d bloggers like this: