Gravitational equations used in model of orbiting bodies

In summary, the original formula for gravitational force between two masses (F = G*m1*m2/ r^2) only works when the force is computed using only the other mass (m1 or m2) and not both. The modified formula (F = G*m1/ r^2) resolves this issue. In simulations, using only one mass can be sufficient to neglect the influence of the other mass, but this is different from the second equation.Many equations in the conversation are incorrect due to inconsistent units and incorrect application of forces. Examples of n-body gravitational models can be found through a simple online search.
  • #1
nearc
Gold Member
66
6
In practice I’ve found that a valid gravitational model of orbiting bodies only works when the force is computed with only the other mass and not both masses. Thus, the original equation does not work but the modified one does. Is using one mass ok or am I doing something wrong? thanks. [also i included is the agent based model I'm using [you will need to change the file extension to .nlogo], it can be run with a free download of netlogo [ https://ccl.northwestern.edu/netlogo/download.shtml ]]F = G*m1*m2/ r^2, original

F = G*m1/ r^2, modifiedusing Finite difference; Euler's method. with the time step is built into the gravitational constant, Gvaluenew=valueold + time step*differential equationmi, mj, mass of objects,[tex]

d_x=m_{i_x}-m_{j_x}

[/tex][tex]

d_y=m_{i_y}-m_{j_y}

[/tex][tex]

R^2=d^2_x+d^2_y

[/tex][tex]

F = \frac {Gm_im_j}{R^2}

[/tex][tex]

\Theta = tan^{-1}(\frac {d_y}{d_x})

[/tex][tex]

F_{x_{new}}= F_{x_{old}}+ Fcos(\Theta)

[/tex][tex]

F_{y_{new}}= F_{y_{old}}+ Fsin(\Theta)

[/tex][tex]

v_{x_{new}}= v_{x_{old}}+ F_{x_{new}}

[/tex][tex]

v_{y_{new}}= v_{y_{old}}+ F_{y_{new}}

[/tex][tex]

m_{ix_{new}}= m_{ix_{old}}+ v_{x_{new}}

[/tex][tex]

m_{iy_{new}}= m_{iy_{old}}+ v_{y_{new}}

[/tex]Rewritten in algorithm form [i.e. computational model]:[tex]

F_{ix_{new}} =F_{ix_{old}} + G\sum_{j=1}^{k} \frac{m_im_j}{{(m_{i_x }-m_{j_x }})^2 +({m_{i_y }-m_{j_y }})^2} cos(tan^{-1}(\frac { m_{i_x }-m_{j_x } } { m_{i_y }-m_{j_y } }))), i\neq j

[/tex][tex]

F_{iy_{new}} =F_{iy_{old}} + G\sum_{j=1}^{k} \frac{m_im_j}{{(m_{i_x }-m_{j_x }})^2 +({m_{i_y }-m_{j_y }})^2} sin(tan^{-1}(\frac { m_{i_x }-m_{j_x } } { m_{i_y }-m_{j_y } }))), i\neq j

[/tex][tex]

v_{x_{new}}= v_{x_{old}}+ F_{x_{new}}

[/tex][tex]

v_{y_{new}}= v_{y_{old}}+ F_{y_{new}}

[/tex][tex]

m_{ix_{new}}= m_{ix_{old}}+ v_{x_{new}}

[/tex][tex]

m_{iy_{new}}= m_{iy_{old}}+ v_{y_{new}}

[/tex]
 

Attachments

  • earth03.txt
    12.1 KB · Views: 415
Last edited:
Physics news on Phys.org
  • #2
The original formula always works (as long as you can neglect relativistic effects), the second one will never work because the units do not match.
In many cases, it is sufficient to neglect the influence of the object you care about on the other mass, then ##a=\frac{F}{m}=\frac{GM}{r^2}## will do the job, but that is different from your second equation.

Most of the equations in your post are wrong.
 
  • #3
i see the two initital distance equations where wrong and i fixed them, can you point out the other ones that are wrong? also i still don't know why a simulation with F=GM1M2/R^2 does not work but one with F=GM1/R^2 does?
 
  • #4
F=GM1/R^2 does not work. Maybe you mean A2=GM1/R^2 ?

You must include both masses to get the force. Per Newton's third law, the force on one body will always be equal in magnitude, but opposite in polarity, to the force on the other body. However, the magnitudes of acceleration will be different if their masses are different:

[tex]F_1=G\frac{M_1M_2}{R^2}[/tex]
[tex]F_2=-G\frac{M_1M_2}{R^2}[/tex]
[tex]A_1=G\frac{M_2}{R^2}[/tex]
[tex]A_2=-G\frac{M_1}{R^2}[/tex]
 
  • #5
nearc said:
can you point out the other ones that are wrong?
All with inconsistent units, so nearly all of them. And those where you take the previous force and increase it step by step based on the total force.
also i still don't know why a simulation with F=GM1M2/R^2 does not work but one with F=GM1/R^2 does?
See TurtleMeister, but I'm surprised your formulas lead to anything reasonable at all. Maybe some lucky coincidence for specific time steps.
 
  • #6
mfb said:
All with inconsistent units, so nearly all of them.

the only equations i can find with inconsistent are:

[tex]

v_{x_{new}}= v_{x_{old}}+ F_{x_{new}}

[/tex][tex]

v_{y_{new}}= v_{y_{old}}+ F_{y_{new}}

[/tex]

can you point out how the other ones are also inconsistent?

And those where you take the previous force and increase it step by step based on the total force.

are you saying these equations are wrong?:

[tex]

F_{x_{new}}= F_{x_{old}}+ Fcos(\Theta)

[/tex][tex]

F_{y_{new}}= F_{y_{old}}+ Fsin(\Theta)

[/tex]
See TurtleMeister, but I'm surprised your formulas lead to anything reasonable at all. Maybe some lucky coincidence for specific time steps.

i have used various time steps, grid spacing, number of bodies. all of the simulations work fine with one mass but not both masses.

can anyone point to an example of a n-body gravitational model?
 
  • #7
nearc said:
can you point out how the other ones are also inconsistent?
- adding velocities to masses (changing masses are weird on their own)
- adding forces to the gravitational constant (the mass units in the sums cancel)

are you saying these equations are wrong?:
I don't see any way how they can make sense.

i have used various time steps, grid spacing, number of bodies. all of the simulations work fine with one mass but not both masses.
One mass is just floating in space?

Do you get a stable ellipsis in any setup?

can anyone point to an example of a n-body gravitational model?
https://www.youtube.com/watch?v=TXY6NJm5se0
http://www.codeproject.com/Articles/22438/Gravity-and-Collision-Simulation-in-C
http://users.softlab.ece.ntua.gr/~ttsiod/gravity.html

Random google hits, I don't know them.
 
  • #8
mfb said:
- adding velocities to masses (changing masses are weird on their own)
- adding forces to the gravitational constant (the mass units in the sums cancel)

I don't see any way how they can make sense.

velocities are not being added to masses, if you are referring to:

[tex]

m_{ix_{new}}= m_{ix_{old}}+ v_{x_{new}}

[/tex]

that is the x position of mass i, being adjusted by the the velocity which is multiplied by the time step [remember the time step is built into G]. velocity multiplied by time yields distance, so that equation is x_new = x_old + delta distance

i'm seeing where i add forces to the gravitational constant which equations are you referring to?
 
  • #9
The only equation that comes to mind is :
total acceleration (of both bodies) = ( G * ( M + m ) ) / r ^2

If m is negligible, then you get : acceleration of m = ( G * M ) / r ^2
(M is deemed to be non accelerating)
 

What is the formula for calculating the force of gravity between two objects?

The formula for calculating the force of gravity between two objects is F = G(m1m2)/d^2, where F is the force of gravity, G is the gravitational constant, m1 and m2 are the masses of the two objects, and d is the distance between them.

How does the mass of an object affect its orbit around another object?

The mass of an object affects its orbit around another object by determining the strength of the gravitational force between them. The greater the mass of an object, the stronger its gravitational pull, which can result in a larger or faster orbit around another object.

What is the role of velocity in orbital motion?

The role of velocity in orbital motion is to balance the force of gravity between two objects. The velocity of an object in orbit must be high enough to counteract the gravitational pull, but not too high that it escapes the orbit altogether.

How are Kepler's laws of planetary motion related to gravitational equations?

Kepler's laws of planetary motion describe the relationship between a planet's orbital period, distance from the sun, and the shape of its orbit. These laws are based on gravitational equations, as the force of gravity is what keeps planets in orbit around the sun.

Can gravitational equations be used to model the motion of objects in space other than planets?

Yes, gravitational equations can be used to model the motion of any two objects in space that are affected by the force of gravity. This includes satellites, moons, and even artificial objects such as spacecrafts.

Similar threads

Replies
0
Views
2K
  • Advanced Physics Homework Help
Replies
1
Views
2K
  • Introductory Physics Homework Help
Replies
14
Views
1K
  • Introductory Physics Homework Help
Replies
4
Views
1K
Replies
1
Views
2K
  • Calculus and Beyond Homework Help
Replies
5
Views
2K
Replies
6
Views
2K
Replies
13
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
204
  • General Math
4
Replies
125
Views
16K
Back
Top