Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Gravitational equations used in model of orbiting bodies

  1. Feb 17, 2015 #1

    nearc

    User Avatar
    Gold Member

    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, modified


    using Finite difference; Euler's method. with the time step is built into the gravitational constant, G


    valuenew=valueold + time step*differential equation


    mi, 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]
     

    Attached Files:

    Last edited: Feb 17, 2015
  2. jcsd
  3. Feb 17, 2015 #2

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    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.
     
  4. Feb 17, 2015 #3

    nearc

    User Avatar
    Gold Member

    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?
     
  5. Feb 17, 2015 #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]
     
  6. Feb 18, 2015 #5

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    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.
    See TurtleMeister, but I'm surprised your formulas lead to anything reasonable at all. Maybe some lucky coincidence for specific time steps.
     
  7. Feb 18, 2015 #6

    nearc

    User Avatar
    Gold Member

    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?

    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]


    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?
     
  8. Feb 18, 2015 #7

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    - 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.

    One mass is just floating in space?

    Do you get a stable ellipsis in any setup?

    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.
     
  9. Feb 24, 2015 #8

    nearc

    User Avatar
    Gold Member

    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?
     
  10. Mar 2, 2015 #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)
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Gravitational equations used in model of orbiting bodies
  1. Equations of orbit (Replies: 5)

Loading...