Orbital modelling - best choice for initial JPL Horizons data?

I'm modelling planetary orbits using a spreadsheet and Feynman's numerical method given here. I have put together a spreadsheet (10,000 rows) to model Mars' orbit in three $$\left(x,y,z\right)$$ dimensions. I'm using SI units with a time interval of 3600 seconds. I'm using initial state vector data from JPL Horizons. I believe Feynman's method is called leapfrog integration. I've also tried the Runge-Kutta method, but with no significant improvement in accuracy.

In terms of the orbit cycle, does it matter when I take the initial JPL Horizons data? Aphelion or perihelion, for example, or some other point in the orbit?

EDIT. Just to be clear what I'm asking. The first row of my spreadsheet uses state vector data $$\left(\mathbf{x},\mathbf{y},\mathbf{z},\mathbf{v_{x}},\mathbf{v_{y}},\mathbf{v_{z}}\right)$$ from JPL Horizons for an arbitrary date and time. I've chosen 2000-Jan-01 12:00:00.0000 TDB. Will I get more accurate results if I use a date and time for a specific point in Mars' orbit? Aphelion or perihelion, for example? If the answer is yes, an explanation would be useful.

• Don't use SI units! They cause all sorts of floating point issues. AU, Solar mass, year are much better set of units for solar system modelling than metre, kg, second. Jul 18, 2022 at 7:21
• As I note in astronomy.stackexchange.com/questions/2416/… you might want to use the same initial conditions JPL does. Jul 18, 2022 at 13:38
• Yes, that's Leapfrog. There are a few variants of Leapfrog. I illustrate a couple of them here: astronomy.stackexchange.com/a/48477/16685 Jul 18, 2022 at 13:49
• @Prallax - I've edited my question to make it clearer what I'm asking. Jul 19, 2022 at 6:07
• If I were a pathological nitpicker, I'd point out that coordinates not from the "epoch" are given as polynomial approximations to the real solution and are therefore trivially less "accurate". Of course this "inaccuracy" is vastly smaller than the inaccuracy of the positions themselves. Jul 19, 2022 at 15:07

You can begin with any starting point. The numerical integration process doesn't "know" anything about ellipses, perhelion, or what the orbit is supposed to look like. The same iterative process is applied at all points on the orbit, so you can start anywhere.

It is a good idea to use astronomical units (AU, Solar mass, years) rather than SI units. With SI units, the intermediate calculations can involve very large and very small numbers and this can result in a loss of accuracy.

A symplectic integrator should do well enough, but note that the NASA values include all kinds of perturbations (by other planets, by the non-spherical sun etc) and a two-body model isn't going to match perfectly. Also remember that the sun is also moving, so if your x-y-z are relative to the centre of the sun, that is an issue. To deal with it, you would need to include other planets and the sun in your model.

For speed you probably will want to move to a "real" programming language. Spreadsheets are optimised for business calculations, rather than solving differential equations.

• Thanks for that. JPL offers the following choice of state vector units: km and seconds; AU and days; km and days. However, they give GM for the Sun in units of $\mathrm{km}^{3}\mathrm{s}^{-2}$. I've tried using this value of GM in the spreadsheet with distances in km, but the results come out exactly the same as with using metres and seconds. I haven't been able to find a figure for GM in AU and some other time units (days or years?). Jul 19, 2022 at 7:57
• in units of "sun mass, AU and years" G = GM = 4pi^2 Jul 19, 2022 at 8:12
• Well, I never saw that coming. What an amazing result. Jul 19, 2022 at 9:36
• @Peter What James said about GM is true, but it depends on how you define "AU" & "year". See en.wikipedia.org/wiki/Gaussian_year & links therein. Jul 23, 2022 at 18:23
• Yes, there is a slight of hand, If you define "Year" as the time that a body in circular 1 AU orbit around a mass of the sun, you can see how the various units are related, and so the G=4pi^2 result becomes somewhat less surprising. Astronomers conventionally take 1 year = 365.25 days (exactly) for which G is only very close to 4pi^2 Jul 23, 2022 at 19:01