Gravitational equations used in model of orbiting bodies

Click For Summary
SUMMARY

The forum discussion centers on the validity of gravitational models for orbiting bodies, specifically the use of modified equations for force calculations. The original equation, F = G*m1*m2/r^2, is deemed ineffective when simulating interactions between two masses, while the modified equation, F = G*m1/r^2, is suggested to yield better results. Participants emphasize the necessity of including both masses in force calculations due to Newton's third law, which states that forces are equal and opposite. The discussion also highlights the importance of consistent units across equations to ensure accurate simulations.

PREREQUISITES
  • Understanding of Newton's laws of motion
  • Familiarity with gravitational force equations
  • Knowledge of numerical methods such as Euler's method
  • Experience with simulation tools like NetLogo
NEXT STEPS
  • Study the implementation of gravitational models in NetLogo
  • Learn about the implications of using inconsistent units in physics equations
  • Research advanced numerical methods for simulating n-body problems
  • Explore examples of n-body gravitational simulations available online
USEFUL FOR

Physicists, computer scientists, and simulation developers interested in gravitational modeling and numerical simulations of orbital mechanics.

nearc
Gold Member
Messages
65
Reaction score
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,<br /> <br /> d_x=m_{i_x}-m_{j_x}<br /> <br /><br /> <br /> d_y=m_{i_y}-m_{j_y}<br /> <br /><br /> <br /> R^2=d^2_x+d^2_y<br /> <br /><br /> <br /> F = \frac {Gm_im_j}{R^2}<br /> <br /><br /> <br /> \Theta = tan^{-1}(\frac {d_y}{d_x})<br /> <br /><br /> <br /> F_{x_{new}}= F_{x_{old}}+ Fcos(\Theta)<br /> <br /><br /> <br /> F_{y_{new}}= F_{y_{old}}+ Fsin(\Theta)<br /> <br /><br /> <br /> v_{x_{new}}= v_{x_{old}}+ F_{x_{new}}<br /> <br /><br /> <br /> v_{y_{new}}= v_{y_{old}}+ F_{y_{new}}<br /> <br /><br /> <br /> m_{ix_{new}}= m_{ix_{old}}+ v_{x_{new}}<br /> <br /><br /> <br /> m_{iy_{new}}= m_{iy_{old}}+ v_{y_{new}}<br /> <br />Rewritten in algorithm form [i.e. computational model]:<br /> <br /> 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<br /> <br /><br /> <br /> 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<br /> <br /><br /> <br /> v_{x_{new}}= v_{x_{old}}+ F_{x_{new}}<br /> <br /><br /> <br /> v_{y_{new}}= v_{y_{old}}+ F_{y_{new}}<br /> <br /><br /> <br /> m_{ix_{new}}= m_{ix_{old}}+ v_{x_{new}}<br /> <br /><br /> <br /> m_{iy_{new}}= m_{iy_{old}}+ v_{y_{new}}<br /> <br />
 

Attachments

Last edited:
Physics news on Phys.org
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.
 
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?
 
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:

F_1=G\frac{M_1M_2}{R^2}
F_2=-G\frac{M_1M_2}{R^2}
A_1=G\frac{M_2}{R^2}
A_2=-G\frac{M_1}{R^2}
 
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.
 
mfb said:
All with inconsistent units, so nearly all of them.

the only equations i can find with inconsistent are:

<br /> <br /> v_{x_{new}}= v_{x_{old}}+ F_{x_{new}}<br /> <br /><br /> <br /> v_{y_{new}}= v_{y_{old}}+ F_{y_{new}}<br /> <br />

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?:

<br /> <br /> F_{x_{new}}= F_{x_{old}}+ Fcos(\Theta)<br /> <br /><br /> <br /> F_{y_{new}}= F_{y_{old}}+ Fsin(\Theta)<br /> <br />
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?
 
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.
 
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:

<br /> <br /> m_{ix_{new}}= m_{ix_{old}}+ v_{x_{new}}<br /> <br />

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?
 
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)
 

Similar threads

Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 8 ·
Replies
8
Views
5K
  • · Replies 125 ·
5
Replies
125
Views
20K