Bringing You The Future Of Science and Technology

EFFECTS OF GRAVITY AT ALTITUDE

In this tutorial we will use Python and Matplotlib to explore the effects of altitude on the forces of gravity. This is because the gravitational force above the Earth's surface is proportional to 1/R2, where R is your distance from the center of the Earth.

Categories

Art and Web Design

Latest Articles

Effects of Gravity at Altitude

The planetary weight calculator allows you to calculate your weight while on the planet's surface and assumes that the surface of the planet is of uniform distance from its center. These equations therefore will not accurately reflect the weight of objects in space around Earth, or other planetary body.

Gravity is affected by only two constants and one variable. The universal gravitational constant (6.67408 * 10-11) cannot be changed and Earth's mass (5.98 * 1024) stays pretty much the same, therefore only your distance from the center of the Earth can be changed. Earth's surface is approximately 6378.8 km in radius.

When calculating the altitude of spacecraft and satellites, don't forget to add this distance (converted to meters) to the altitude of the spacecraft above the Earth's surface. Also consider that the Earth is not a perfect sphere, but rather appears to be squashed, with more mass distributed around the equator. This means that the gravitational attraction is greater above the equator than at the poles. Due to its squashed appearance, Earth is called an oblate spheroid.

ge = G * Me / d2
G = 6.67408-11
Me = 5.9824 kg
Re = 6378.8 km

In this tutorial, we will create a Python program to calculate our weight, or the weight of a flying object, at any point above the surface of the Earth. To do this, we will need to know the weight of the object at sea level, measured in pounds (lbs). Our program will convert the weight of the object into its respective mass, which we will then use to determine its weight in the sky above the Earth's surface.

Before we begin, let us try to understand a little more about gravity on Earth. As we learned in school, the standard acceleration of gravity at sea level (g0) equals 9.80665 m/sec2. How do we know this? We can use the above equations to calculate gravity at sea level (substituting d for Re).

ge = 6.67408-11 * 5.9824 / 6378.82
ge = 9.80877157717 m/sec2

The above equation can be used to calculate the gravitational acceleration on any planetary body, including the moon, as described in my Planetary Weight Calculator tutorial. We do this simply by substituting Earth's mass and radius with those of the planetary body under investigation.

We can perform these calculations in Python, as shown in the code below:

Now that we have figured out how to calculate the gravitational acceleration at sea level, the next step is to calculate gravity at any distance above the Earth's surface. To do this, we create a new variable called object_altitude. Before we can call this variable, we will need to get the altitude (in kilometers) from the user, which we will store in another variable named altitude. To accomplish this, we will need to call upon Python's input function (the input function is a built-in function). Note that altitude is a floating point number and not an integer.

Next we will convert the weight of an object to its mass, using the standard acceleration of gravity at sea level (g0). This will allow us to then calculate the weight of the object at the given altitude. To do this, we need to create another variable, named normal_weight, and we will again call on the input function to retrieve the weight of the object and assign it to our variable.

Once we have obtained the weight of the object, at sea level, we can convert from weight to mass by dividing the weight by the gravitational acceleration at sea level. Lastly, we can convert the object's mass back to weight, at the altitude provided by multiplying its mass by the gravity_altitude variable we just created.

Complete Code

The following Python script will allow you to to calculate your weight at any altitude above Earth. Create a new Python file, name it weight_calculator_altitude.py, copy and paste the below code, then save and run. You can also download the Python sorce code from my GitHub repository at: github.com/johnathan-nicolosi/PlanetaryScience/.