Gravitational Force: Difference between revisions
mNo edit summary |
Rewrote Computational Model: working Earth-Moon-spacecraft GlowScript model, animated GIF, link, and explanation (Nawaf Alturayif, Fall 2026) |
||
| Line 43: | Line 43: | ||
===A Computational Model=== | ===A Computational Model=== | ||
A computational representation of | A computational representation of gravitational force can be created using VPython (GlowScript). The model below follows a spacecraft moving under the pull of '''both''' the Earth and the Moon. Every time step, it does the same steps listed above for each body: | ||
# Find the relative position vector from the body to the craft: <math>\vec{r} = \vec{r}_{craft} - \vec{r}_{body}</math> | |||
# Use Newton's law of gravitation to find the force by that body: <math>\vec{F}_{grav} = -\frac{G m_1 m_2}{|\vec{r}|^2}\hat{r}</math> | |||
# Add the two forces together (superposition) to get the net force on the craft | |||
# Use the Momentum Principle to update the craft's momentum and then its position | |||
The | [[File:GravitationalForce_FreeReturn.gif|frame|center|The spacecraft (yellow) leaves Earth, swings around the far side of the Moon, and returns to Earth: a "free-return" trajectory like the one Apollo 13 used. Arrows on the craft: cyan = force by Earth, magenta = force by Moon, orange = net force, red = momentum.]] | ||
'''[https://glowscript.org/#/user/Nqvvqf/folder/GPS/program/GravitationalForce-Nawaf%27sWikiModelAddition Run the interactive version on GlowScript]''' (it also graphs the magnitude of each force over time). | |||
The core of the model is the loop below. The Earth and Moon are held fixed to keep the model simple. | |||
<pre> | |||
deltat = 60 # time step (s) | |||
while t < 30*24*3600: | |||
rate(2000) | |||
# Force on craft by Earth | |||
r = craft.pos - Earth.pos | |||
rmag = mag(r) | |||
rhat = r/rmag | |||
fgrav = -G*mEarth*mcraft/rmag**2 * rhat | |||
# Force on craft by Moon | |||
rmc = craft.pos - Moon.pos | |||
rmcmag = mag(rmc) | |||
rmchat = rmc/rmcmag | |||
fgravmoon = -G*mMoon*mcraft/rmcmag**2 * rmchat | |||
# Net force (superposition) | |||
fnet = fgrav + fgravmoon | |||
# Momentum Principle: update momentum, then position | |||
pcraft = pcraft + fnet*deltat | |||
craft.pos = craft.pos + (pcraft/mcraft)*deltat | |||
t = t + deltat | |||
</pre> | |||
'''What to notice in the model:''' | |||
*The force by Earth drops off quickly as the craft moves away, because it depends on <math>1/r^2</math>. Doubling the distance cuts the force to one quarter. | |||
*Even though the Moon is about 80 times less massive than Earth, the force by the Moon becomes '''larger''' than the force by Earth when the craft passes close to the Moon (about 110 N vs. 35 N in this model), because the craft is so much closer to the Moon. | |||
*The net force always points toward the stronger "pull," and the momentum changes in the direction of the net force, which is what bends the path around the Moon. | |||
*The path is very sensitive to the starting momentum: try changing the initial speed from 3.304e3 m/s to 3.25e3 or 3.33e3 m/s in the program and the craft misses Earth on the way back or flies away. | |||
==Examples== | ==Examples== | ||
Latest revision as of 19:12, 1 December 2026
Claimed by Nawaf Alturayif (Fall 2026)
This topic covers Newton's Law of Universal Gravitation.
Created by Ankit Khanal.

Main Idea
Gravitational Force, defined in Newton's law of Universal Gravitation, is the attractive force between any two bodies of any mass, at any distance. Gravity is one of the essential forces that hold the Universe together. Newton's law of universal gravitation states that every object with mass in the universe is attracting every other object with mass with a force that is directly proportional to the product of their masses and inversely proportional to the square of the distance between them. Gravitational Force is considered to be the weakest of the four fundamental forces of nature (strong nuclear force, electromagnetic force, weak nuclear force and gravity). The first test of this law was performed in the laboratory by the British scientist Henry Cavendish in 1798, 72 years after the death of Sir Isaac Newton. This test defined the gravitational constant G.
A Mathematical Model
The gravitational law states that every mass attracts every other mass by a force acting on the line intersecting both points. The force is directly proportional to the product of the masses and inversely proportional to the square of the distance between them. The two masses involved are considered point masses, and thus any density variations or irregular shaping can be ignored.

- [math]\displaystyle{ |\vec{\mathbf{F}}_{grav}|= G \frac{m_1 m_2}{r^2}\ }[/math]
- where,
- F is the gravitational force between the masses;
- G is the gravitational constant [math]\displaystyle{ 6.674×10^{−11} \frac{N m^2}{kg^2}\ }[/math];
- m1 is the mass of the first object;
- m2 is the mass of the second object;
- r is the distance between the centers of both masses.
Vector Form
Newton's law of universal gravitation can be expressed in vector form to account for the direction of the gravitational force.
- [math]\displaystyle{ \vec{\mathbf{F}}_{grav}= -G \frac{m_1 m_2}{r^2}\ }[/math][math]\displaystyle{ \mathbf{\hat{r}} }[/math]

The relative position vector [math]\displaystyle{ \vec{\mathbf{r}} }[/math] is the distance from the center of object 1 to the center of object 2. The relative position between these two objects can be represented as [math]\displaystyle{ \vec{\mathbf{r}}_{2-1} }[/math], which means that it is the difference between the position of object 1 and the position of object 2. The magnitude of [math]\displaystyle{ \vec{\mathbf{r}} }[/math], represented as [math]\displaystyle{ r }[/math] or [math]\displaystyle{ |\vec{\mathbf{r}}| }[/math], is the distance between the center of two objects, found by taking the square root of the squares of each vector component, as shown below:
- [math]\displaystyle{ r=|\vec{\mathbf{r}}|=\sqrt{r_x^2+r_y^2+r_z^2} }[/math]
- r sub x, y, and z represent respectively the x, y, and z distances to the point in question.
The direction of the gravitational force on object 2 by object 1 is specified by a unit vector,[math]\displaystyle{ -\mathbf{\hat{r}} }[/math], with a minus sign in front of it. The minus sign shows that the force on object 2 by 1 is in the opposite direction to [math]\displaystyle{ \mathbf{\hat{r}} }[/math]. Because the gravitational force is an attractive force between two bodies, the magnitude of the gravitational force on one object in the duo is the same as the magnitude of the gravitational force on the other object, but in the opposite direction.

Steps for calculating Gravitational Force
- Calculate [math]\displaystyle{ \vec{\mathbf{r}} }[/math] by using the position of the center of object 2 relative to the center of object 1, keeping this in vector notation. i.e. [math]\displaystyle{ \vec{\mathbf{r}} = \vec{\mathbf{r}}_2-\vec{\mathbf{r}}_1 }[/math]
- Calculate center to center distance between the objects, by finding the magnitude of the vector above [math]\displaystyle{ |\vec{\mathbf{r}}| }[/math]
- Calculate [math]\displaystyle{ |\vec{\mathbf{F}}_{grav}| }[/math] using the equation for gravitational force
- Calculate the unit vector [math]\displaystyle{ -\mathbf{\hat{r}} }[/math] =[math]\displaystyle{ \vec{\mathbf{r}} }[/math] /[math]\displaystyle{ |\vec{\mathbf{r}}| }[/math]
- Multiply the Magnitude, [math]\displaystyle{ |\vec{\mathbf{F}}_{grav}| }[/math], by the unit vector.
A Computational Model
A computational representation of gravitational force can be created using VPython (GlowScript). The model below follows a spacecraft moving under the pull of both the Earth and the Moon. Every time step, it does the same steps listed above for each body:
- Find the relative position vector from the body to the craft: [math]\displaystyle{ \vec{r} = \vec{r}_{craft} - \vec{r}_{body} }[/math]
- Use Newton's law of gravitation to find the force by that body: [math]\displaystyle{ \vec{F}_{grav} = -\frac{G m_1 m_2}{|\vec{r}|^2}\hat{r} }[/math]
- Add the two forces together (superposition) to get the net force on the craft
- Use the Momentum Principle to update the craft's momentum and then its position

Run the interactive version on GlowScript (it also graphs the magnitude of each force over time).
The core of the model is the loop below. The Earth and Moon are held fixed to keep the model simple.
deltat = 60 # time step (s)
while t < 30*24*3600:
rate(2000)
# Force on craft by Earth
r = craft.pos - Earth.pos
rmag = mag(r)
rhat = r/rmag
fgrav = -G*mEarth*mcraft/rmag**2 * rhat
# Force on craft by Moon
rmc = craft.pos - Moon.pos
rmcmag = mag(rmc)
rmchat = rmc/rmcmag
fgravmoon = -G*mMoon*mcraft/rmcmag**2 * rmchat
# Net force (superposition)
fnet = fgrav + fgravmoon
# Momentum Principle: update momentum, then position
pcraft = pcraft + fnet*deltat
craft.pos = craft.pos + (pcraft/mcraft)*deltat
t = t + deltat
What to notice in the model:
- The force by Earth drops off quickly as the craft moves away, because it depends on [math]\displaystyle{ 1/r^2 }[/math]. Doubling the distance cuts the force to one quarter.
- Even though the Moon is about 80 times less massive than Earth, the force by the Moon becomes larger than the force by Earth when the craft passes close to the Moon (about 110 N vs. 35 N in this model), because the craft is so much closer to the Moon.
- The net force always points toward the stronger "pull," and the momentum changes in the direction of the net force, which is what bends the path around the Moon.
- The path is very sensitive to the starting momentum: try changing the initial speed from 3.304e3 m/s to 3.25e3 or 3.33e3 m/s in the program and the craft misses Earth on the way back or flies away.
Examples
- Problems taken from Textbook and old Test on T-square
Simple
Determine the force of gravitational attraction between the earth (m = [math]\displaystyle{ 6 x 10^{24} kg }[/math]) and a 70 kg physics student if the student is in an airplane at 40,000 feet above earth's surface. This would place the student a distance of [math]\displaystyle{ 6.38 x 10^6 m }[/math] from earth's center.
The solution of the problem involves substituting known values of G ([math]\displaystyle{ 6.673 x 10^{-11} }[/math] N m2/kg2), m1 ([math]\displaystyle{ 6 x 10^{24} }[/math] kg), m2 (70 kg) and d ([math]\displaystyle{ 6.38 x 10^6 m }[/math]) into the universal gravitation equation and solving for Fgrav. The solution is as follows:
- [math]\displaystyle{ |\mathbf{F_{g}}| = G \frac{m_E m_M}{r^2} }[/math]
- [math]\displaystyle{ |\mathbf{F_{g}}| = 6.7x10^{-11} \frac{6e24 * 70}{(6.38 x 10^6)^2} }[/math]
- [math]\displaystyle{ |\mathbf{F_{g}}| =686 N }[/math]
Middling
The mass of the Earth is [math]\displaystyle{ 6 x 10^ {24} }[/math] kg, and the mass of the Moon is [math]\displaystyle{ 7 x 10^ {22} }[/math] kg. At a particular instance the moon is at location [math]\displaystyle{ \lt 2.8 x 10^8,0,-2.8 x 10^8\gt }[/math] m, in a coordinate system whose origin is at the center of the earth. (a) What is [math]\displaystyle{ \vec{\mathbf{r}} }[/math], the relative position vector from the Earth to the Moon? (b) What is [math]\displaystyle{ |\vec{\mathbf{r}}| }[/math]? (c) What is the unit vector [math]\displaystyle{ \vec{\mathbf{r}} }[/math]? (d) What is the gravitation force exerted by the Earth on the Moon? Your answer should be in vector.
The solution of the problem involves substituting known values of G ([math]\displaystyle{ 6.673 x 10^{-11} }[/math]N m2/kg2), m1 [math]\displaystyle{ 6 x 10^ {24} }[/math] kg, m2 [math]\displaystyle{ 7 x 10^ {22} }[/math] kg and d [math]\displaystyle{ \lt 2.8 x 10^8,0,-2.8 x 10^8\gt }[/math] m m into the universal gravitation equation and solving for Fgrav. The solution is as follows:

- (a) The position vector of Moon relative to Earth is,
- [math]\displaystyle{ \vec{\mathbf{r}} }[/math] = [math]\displaystyle{ \lt 2.8 x 10^8,0,-2.8 x 10^8\gt - \lt 0,0,0\gt }[/math]
- [math]\displaystyle{ \vec{\mathbf{r}} }[/math] = [math]\displaystyle{ \lt 2.8 x 10^8,0,-2.8 x 10^8\gt }[/math] m
- (b) The magnitude of position vector of Moon relative to Earth is,
- [math]\displaystyle{ |\vec{\mathbf{r}}| }[/math] = [math]\displaystyle{ \sqrt{(2.8 x 10^8)^2+0^2+(-2.8 x 10^8)^2} }[/math]
- [math]\displaystyle{ |\vec{\mathbf{r}}| }[/math] = [math]\displaystyle{ 4.0 x 10^8 }[/math] m
- (c) The unit vector of Moon relative to Earth is,
- [math]\displaystyle{ \mathbf{\hat{r}} = \frac {\vec{\mathbf{r}}}{|\vec{\mathbf{r}}|} }[/math]
- [math]\displaystyle{ \mathbf{\hat{r}} = \frac{\lt 2.8 x 10^8,0,-2.8 x 10^8\gt }{4.0 x 10^8} }[/math]
- [math]\displaystyle{ \mathbf{\hat{r}} = \lt 0.7,0,-0.7\gt }[/math]
- (d) The expression for the gravitational force on the Moon by the Earth is,
- [math]\displaystyle{ |\vec{\mathbf{F}}_{g}| = G \frac{m_E m_M}{|\vec{\mathbf{r^2}}|} }[/math]
- [math]\displaystyle{ |\vec{\mathbf{F}}_{g}| = 6.7x10^{-11} \frac{6 x 10^ {24} * 7 x 10^ {22}}{(4.0 x 10^8)^2 } }[/math]
- [math]\displaystyle{ |\vec{\mathbf{F}}_{g}| = 1.76x10^{20}N }[/math]
- [math]\displaystyle{ \vec{\mathbf{F}}_{g} }[/math] = [math]\displaystyle{ -|\mathbf{F_{grav}}|*{\mathbf{\hat{r}}} }[/math]
- [math]\displaystyle{ \vec{\mathbf{F}}_{g} }[/math] = [math]\displaystyle{ -1.76x10^{20}*\lt 0.7,0,-0.7\gt N }[/math]
- [math]\displaystyle{ \vec{\mathbf{F}}_{g} }[/math] = [math]\displaystyle{ \lt -1.232x10^{20},0,1.232x10^{20}\gt N }[/math]
Difficult
In the following problems you will be asked to calculate the net gravitational force acting on the Moon.To do so, please use the following variables:
- Mass
- mS - Mass of the Sun
- mE - Mass of the Earth
- mM - Mass of the Moon
- Initial Positions
- [math]\displaystyle{ \vec{\mathbf{r_{S}}} = \lt 0,0,0\gt m }[/math]- Position of the Sun
- [math]\displaystyle{ \vec{\mathbf{r_{E}}} }[/math] = <[math]\displaystyle{ L,0,0\gt }[/math] m- Position of the Earth
- [math]\displaystyle{ \vec{\mathbf{r_{M}}} }[/math] = <[math]\displaystyle{ L,h,0\gt }[/math] m - Position of the Moon
(a) Calculate the gravitational force on the Moon due to the Earth (b) Calculate the gravitational force on the Moon due to the Sun (c) Calculate the net gravitational force on the Moon
(a) The gravitational force on the Moon due to the Earth is,
- [math]\displaystyle{ \vec{\mathbf{r}} = \vec{\mathbf{r_M}}-\vec{\mathbf{r_E}} }[/math]
- [math]\displaystyle{ \vec{\mathbf{r}} }[/math] = <[math]\displaystyle{ L,h,0\gt }[/math]-<[math]\displaystyle{ L,0,0\gt }[/math]
- [math]\displaystyle{ \vec{\mathbf{r}} }[/math] = <[math]\displaystyle{ 0,h,0\gt }[/math]
- [math]\displaystyle{ |\vec{\mathbf{r}}| = \sqrt{(0^2+h^2+0^2)} }[/math]
- [math]\displaystyle{ |\vec{\mathbf{r}}| = h }[/math]
- [math]\displaystyle{ \mathbf{\hat{r}} = \frac {\vec{\mathbf{r}}}{|\vec{\mathbf{r}}|} }[/math]
- [math]\displaystyle{ \mathbf{\hat{r}} = \frac{\lt 0,h,0\gt }{h} }[/math]
- [math]\displaystyle{ \mathbf{\hat{r}} = \lt 0,1,0\gt }[/math]
- [math]\displaystyle{ |\vec{\mathbf{F}}_{g_1}| = G \frac{m_E m_M}{|\vec{\mathbf{r^2}|}} }[/math]
- [math]\displaystyle{ |\vec{\mathbf{F}}_{g_1}| = G \frac{m_E m_M}{h^2} }[/math]
- [math]\displaystyle{ \vec{\mathbf{F}}_{g_1} = -|\vec{\mathbf{F}}_{g_1}|*{\mathbf{\hat{r}}} }[/math]
- [math]\displaystyle{ \vec{\mathbf{F}}_{g_1} = \lt 0,-G \frac{m_E m_M}{h^2},0\gt N }[/math]
(b) The gravitational force on the Moon due to the Sun is,
- [math]\displaystyle{ \vec{\mathbf{r}} = \vec{\mathbf{r_M}}-\vec{\mathbf{r_S}} }[/math]
- [math]\displaystyle{ \vec{\mathbf{r}} }[/math] = <[math]\displaystyle{ L,h,0\gt -\lt 0,0,0\gt }[/math]
- [math]\displaystyle{ \vec{\mathbf{r}} }[/math] = <[math]\displaystyle{ L,h,0\gt m }[/math]
- [math]\displaystyle{ |\vec{\mathbf{r}}| = \sqrt{(L^2+h^2+0^2)} }[/math]
- [math]\displaystyle{ |\vec{\mathbf{r}}| = \sqrt{(L^2+h^2)} }[/math]
- [math]\displaystyle{ \mathbf{\hat{r}} = \frac {\vec{\mathbf{r}}}{|\vec{\mathbf{r}}|} }[/math]
- [math]\displaystyle{ \mathbf{\hat{r}} = \frac {\lt (L,h,0)\gt }{\sqrt{(L^2+h^2)}} }[/math]
- [math]\displaystyle{ |\vec{\mathbf{F}}_{g_2}| = G \frac{m_S m_M}{|\vec{\mathbf{r^2}|}} }[/math]
- [math]\displaystyle{ |\vec{\mathbf{F}}_{g_2}| = G \frac{m_S m_M}{L^2+h^2} }[/math]
- [math]\displaystyle{ \vec{\mathbf{F}}_{g_2} = -|\vec{\mathbf{F}}_{g_2}|*{\mathbf{\hat{r}}} }[/math]
- [math]\displaystyle{ \vec{\mathbf{F}}_{g_2} = \lt -G \frac{m_S m_M L}{(L^2+h^2)^{3/2}},-G \frac{m_S m_M h}{(L^2+h^2)^{3/2}},0\gt N }[/math]
(c) The net gravitational force on the Moon is,
- [math]\displaystyle{ \vec{\mathbf{F}}_{net} = \vec{\mathbf{F}}_{g_1}+\vec{\mathbf{F}}_{g_2} }[/math]
- [math]\displaystyle{ \vec{\mathbf{F}}_{net} = \lt 0,-G \frac{m_E m_M}{h^2},0\gt +\lt -G \frac{m_S m_M L}{(L^2+h^2)^{3/2}},-G \frac{m_S m_M h}{(L^2+h^2)^{3/2}},0\gt }[/math]
- [math]\displaystyle{ \vec{\mathbf{F}}_{net} = \lt -G \frac{m_S m_M L}{(L^2+h^2)^{3/2}},-G \frac{m_E m_M}{h^2}-G \frac{m_S m_M h}{(L^2+h^2)^{3/2}},0\gt N }[/math]
Connectedness
- Nothing interests and intrigues me as much as outer space, and the first step to understanding that is to understand the Law of Universal Gravitation. The only reason we are alive today, and part of the solar system we are in is because of the force of gravity. It controls the tides of the oceans, the orbit of Earth, and the distance of planets to the Sun (which are vital for the survival of life). It is one of the most basic concepts you learn in physics, but one of the most important of the natural forces that work to keep our universe in balance.
- As a Mechanical Engineering major, gravitational force could be important if I ever work in the aerospace field, where you must determine how much lift an airplane or spaceship needs to get off the ground in order to counteract the force of gravity. Also, if I ever assist in the designing of buildings, it is important to know all of the forces that act on them, including gravity.
- Newton's Law of Universal Gravitation acts on every single object that you see around you every day. Without it, football games would be no fun because the ball would never come back to the ground, and also because all the players and spectators would be floating off into space. If a planet or object in space has a different orbit than expected, then it can be used to find new bodies that cause that change in orbit. If we did not know the force of gravity, we would not know how fast rockets need to travel to exit the atmosphere, and how high satellites must float in order to stay in the orbit the Earth. The Apollo 13 crew would never have been able to make it back to their families had Houston not known the exact gravitational forces that the moon could exert on the spacecraft.
History

Sir Isaac Newton, the 17th century English scientist is considered one of the most important minds of the Scientific Revolution. He is popularly associated with discovering the force of gravity but scientists had been studying gravity for centuries before Newton. Based on Galileo’s and Kepler’s works on heliocentric solar system, Newton published “Principia” in 1687, in which he explained that the force that causes the planets to orbit the Sun is the same force that makes objects fall to and remain on the surface of the Earth. Newton explained that gravity is a force that attracts different masses and is inversely proportional to the square distance between the objects. However Newton did not fully understand how gravitational force acted from one object to another over vast distances due to the limited tools at his disposal. Despite this flaw, the law he developed has been used for more than three centuries and is still used mostly without issue to approximate the motion of bodies acting under gravitational force. Albert Einstein rejected it in his explanation of the Theory of Relativity, saying that the gravitational force is a result of the curvature of space-time. This theory explains a number of phenomena we observe around extremely massive bodies, including the curving of light around such bodies.
While Newton's theory of gravity falls apart under scrutiny near extremely massive bodies, and cannot explain some of the phenomena we see around these bodies, it is a good enough approximation for most situations that are encountered.
See also
- For an interesting lab on the Law of Universal Gravitation visit here
- For more information and applications pertaining to the gravitational force visit here
- This video here is much like the experiment done in lecture, and attempts to show how gravity acts on small objects by using a conical shape Watch.
- Here is a short video that reinforces the concepts laid out above.
Further reading
Matter and Interactions By Ruth W. Chabay, Bruce A. Sherwood - Chapter 3
External links
- 1: http://www.physicsclassroom.com/Class/circles/u6l3c.cfm
- 2: https://www.youtube.com/watch?v=0hOuNtRMSAI
- 3: http://csep10.phys.utk.edu/astr161/lect/history/newtongrav.html
- 4: http://www.animations.physics.unsw.edu.au/jw/gravity.htm
- 5: http://sandyabouttechnology.blogspot.com/2012/09/gravitation-force-and-application.html
References
- 1: "Newton's Law of Universal Gravitation." Newton's Law of Universal Gravitation. N.p., n.d. Web. 27 Nov. 2015.<http://www.physicsclassroom.com/Class/circles/u6l3c.cfm>
- 2: Rankin, Alan. "What Is a Gravitational Force?" WiseGeek. Conjecture, n.d. Web. 28 Nov. 2015. <http://www.wisegeek.com/what-is-a-gravitational-force.htm>
- 3: "History of Gravity." History of Gravity. N.p., n.d. Web. 28 Nov. 2015. <https://www.physics.wisc.edu/museum/Exhibits-1/Mechanics/GravPit/index_HistGrav-2.html>