# Interpolate the ephemerides of the Earth

I have a table of state vectors generated from ephemerides of the Earth with time steps of 1 minute.

Now I would like to interpolate this to a finer time increments in order to use it as part of an orbit integration for another body, with time steps of the order of 1 second. They could be equally spaced or not, depending on the integration method used. How to proceed, and What might be the most accurate way to do this?

• A question about interpolation methods is a question about Computational Science and is precisely on-topic there! scicomp.stackexchange.com/help/on-topic It's not on-topic here though.
– uhoh
Mar 3 '18 at 15:38
• There's nothing wrong with asking questions on multiple SE sites even if it's the same subject. You can add a link there to one or more questions and answers here in order to give them more background and avoid having to explain twice. You should explain the actual level of accuracy you need and mention that the velocity is also available, because that makes the interpolation much easier! I received a fantastic answer when I asked a question there!
– uhoh
Mar 3 '18 at 15:42
• Thanks. I thought, it's better to be posted here. I would also ask this question in Computational Science, and if answered, post the answer also here. Mar 3 '18 at 16:04
• The "best" interpolation method is the method that gets you the accuracy within the bounds you need within a level of effort you deem acceptable. A plain old linear interpolation of position for a typical 90-minute period circular orbit will get you a position error not much more than 5 km (if you interpolate linearly in cartesian coordinates -- if you interpolate in polar coordinates, even less error). Depending on what you are going to do with the data, that may be good enough. Mar 6 '18 at 17:41
• @TarlanMammadzada How accurate do you think the real data is? Linear interpolation of earth ephemerides between fiducial points spaced 60 seconds apart gives errors no higher than one part in 100 billion. That's right at about the uncertainty for $\mu_{sun}$, from which the ephemerides are calculated! Mar 6 '18 at 18:13

Interpolation is only as accurate as its source data. Striving for the "most accurate" interpolation, absent an understanding of the uncertainty of the data being interpolated, is an academic exercise at best.

For orbital ephemerides, linear interpolation in cartesian coordinates,i.e.,

$$q(t) \approx \frac{t_1 - t}{t_1 - t_0}q(t_0) + \frac{t - t_0}{t_1 - t_0} q(t_1),\:t_0 \leq t \leq t_1$$

where $q(\cdot)$ is any quantity of interest (velocity, position, whatever), will give you a relative position error proportional to the second time derivative of that quantity in that time period. For positions in an orbit, the error is approximately proportional to the versine of half of the true anomaly angle subtended between fiducial points at periapsis. The same is more or less true for orbital velocity. In the case of the ephemeris data for Earth's orbit around the sun, one-minute intervals correspond to a subtended angle of approximately 12 microradians, giving a relative error of $O(10^{-11})$.

Given that the gravitational parameter of the sun is only known to a relative precision of about $8 \times\ 10^{-11}$, unless you are really relying on something that will guarantee continuity of higher level derivatives, a linear interpolation will provide you with an accuracy commensurate with your source data. Using a "more accurate" interpolation method would be wasted effort -- inaccurate data interpolated accurately is still inaccurate.

• Could you add description of how to linearly interpolate the coordinates in a time interval using Velocities? Mar 6 '18 at 19:04
• You would just ignore the velocities for the purposes of linearly interpolating the position. If you want velocities, you linearly interpolate them as well. Mar 6 '18 at 19:44
• @Tristan excellent answer! In this and this comment I mentioned using the velocities that are included in the Spice kernels and Horizons output. These are (obviously) the first derivatives of the positions, and having derivative information makes better interpolation possible I believe, but I don’t know how to say it in mathematese.
– uhoh
Mar 7 '18 at 5:46
• (continued...) precisely, I believe it is used when generating the Hermite polynomial as described in this question's "twin posting" so I'm not sure why you are being asked again here.
– uhoh
Mar 7 '18 at 5:52
• I'm hoping the OP is interpolating the position of the Earth in the Earth-Moon barycenter (for which ephemeris accuracies can be as good as centimeters) rather than the Solar System barycenter, because if it's the latter, there will be huge errors unless the Sun's gravitational effect on the spacecraft is also considered.
– uhoh
Mar 7 '18 at 6:30

One orbit of the Earth around the Sun takes about 365 days or 525,960 minutes. Therefore the difference of the state vectors from one minute to the next should should not change much. If this is true, linear interpolation is no problem. What about comparing the difference of some adjacent state vectors to verify the assumption?

• Your advice about actually checking how much is needed is of course very good advice. The part about "not much" is a bit subjective though.The only gauge for how much is not much would be a real test.
– uhoh
Mar 7 '18 at 6:05

The points may be interpolated using Hermite interpolation. An answer is given in Computational Science.

• To post an answer to your question you would need to explain why Hermite interpolation is the "most accurate way to do this?" and not for example Chebychev polynomials as suggested in the comment above. Just posting a link is called a link-only answer and this is frowned upon, (as is of course cross-posting the identical question in two places to begin with).
– uhoh
Mar 6 '18 at 11:59
• I know you are trying to be helpful here by sharing information, and that's great! But without writing a proper answer, you should just leave a comment instead. It may be hard to get used to the rules and practices used in Stack Exchange, but it's worth it.
– uhoh
Mar 6 '18 at 12:02