JPL Horizons Ephemeris Interpolants

Downloads a JPL Horizons ephemeris using the API and creates coordinate interpolating functions.


Updated 28 Jul 2022

View License

The Jet Propulsion Laboratory (JPL) Horizons ephemeris service provides positions and velocities of major and minor solar system bodies based on a fit of essentially all observational data to an evolving elaborate relativistic solar system model. The results of such fits are represented by coefficients of Chebyshev polynominals for each object. The Aerospace Toolbox function planetEphemeris provides ephemeris predictions based on the Chebeyshev coefficients only for major bodies and not the most recent ephemeris. To study motions of minor bodies such as asteroids and moons with the latest ephemeris, programmatic access to the JPL ephemeris is needed.
This script illustrates how to access the JPL ephemeris through the API service from MATLAB and how to extract object position and velocity information from the returned text data. It also illustrates how to represent each coordinate by a lookup-table interpolant function and explores the accuracy and speed of such interpolants. Such interpolants may be useful for efficient numerical integration of the motion of an object through the solar system subject to the JPL physics model with an adaptive time algorithm such as ode45. It is shown that ephemeris sampling of the motion Mars over times of order 1000 minutes is sufficient to achieve interpolant accuracy comparable to the JPL ephemeris accuracy (of order 1 m for major bodies).
The speed of the interpolant functions are compared to the speed of calls planetEphemeris and dated planetEphemeris position coordinates are compared to the current JPL ephemeris.
This script may interest students, educators, and researchers in physics, astronomy, and space engineering. 'Try this' suggestions for further exploration are provided.

Cite As

Duncan Carlsmith (2023). JPL Horizons Ephemeris Interpolants (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2022a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!


Version Published Release Notes

Spell check


Includes comparison of planetEphemeris to current JPL Horizons ephemeris and a few more options.


Summary update.