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

3D N-Body Problem (Solar System) C#

  1. Jan 10, 2014 #1
    Hey there, first time posting, I have casually browsed this forum for a while.

    Anyway on to the question, I am trying to solve in the best way possible the N-Body problem, I am at a complete loss, I have no idea what I can do, I have tried figuring out my self different integrators such as Verlet and RK4, but I cannot figure out anything.

    What I need to be able to do is simulate our solar system in 3D, I have seen many implementations in 2D, but I cant find out how to calculate velocity, force and position as a function of time.

    Any help would be amazing, and I would be eternally grateful.

    EDIT: I should point the orbital bodies to be simulated.

    Sun is Static in the center, 0,0,0
    Mercury, Venus, Earth, Moon, Mars, Jupiter, Saturn, Uranus, Neptune and Pluto
  2. jcsd
  3. Jan 10, 2014 #2


    User Avatar

    Staff: Mentor

    Start from the equations of motion for each planet. Convert this to a system of first-order differential equations, and you should be able to use that with any general-purpose integrator, such as Runge-Kutta.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook