4
$\begingroup$

I’m building an $N$-body simulator, and I have everything ready to begin simulating. But my issue is is that I have no idea how to get all the starting positions and velocities for the celestial bodies in the Solar System, such as the planets and their moons. I suppose that if I knew their periods and their positions, I might be able to find out their velocities, but I don’t know how. Is there a source or database that can give me all this data?

Also, the point of this simulator is to simulate the trajectory of the Asteroid Apophis. If you know of any sources to find the data for its position and velocity vector, that would be very helpful. Otherwise, I’ll have to figure out some other way to find the velocity vectors/positions.

$\endgroup$
4
  • 2
    $\begingroup$ JPL/NASA has a wealth of information here. $\endgroup$ Commented Jun 23, 2018 at 22:59
  • $\begingroup$ You might try looking at the source code of open-source planetarium software. $\endgroup$
    – user4552
    Commented Dec 25, 2019 at 15:17
  • 2
    $\begingroup$ You can use HORIZONS software by NASA to calculate positions and velocities to high accuracy. See my answer here $\endgroup$ Commented Sep 1, 2021 at 7:12
  • $\begingroup$ HiddenBabel's link leads to Approximate Positions of the Planets $\endgroup$
    – PM 2Ring
    Commented Sep 7, 2022 at 21:20

2 Answers 2

0
$\begingroup$

Once very nice tool that NASA provides is the Horizons system. The default is to give apparent location from Earth, but this default choice is very flexible; you could change it to the sun, etc. It also comes with a manual/tutorial to get a wide variety of data.

https://ssd.jpl.nasa.gov/horizons/app.html#/

If you want vectors, go to the "Table Settings" and select the "select output quantities" pulldown.

$\endgroup$
-1
$\begingroup$

https://nssdc.gsfc.nasa.gov/planetary/factsheet/earthfact.html

There is links for the planets, it is also in basic text/html which makes it good to automatically parse, don't know how often updated though?

Seems to have velocities and then mean elements to choose from, don't see Cartesian position though. But all info is there to constrain the positions to some accuracy.

The plain orbital elements give velocities if that's what you want. I personally deal with the mean orbital elements which basically just treat each planet as two body, averaging in perturbations and using least square to give average keplarian orbit. I assume this might not work for you, you could solve for mean velocity at any time as well as mean position, however this will have some error that is more than if you used the regular elements above the mean elements. I'm not clear how you would get an epoch and position from them though.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.