arenstorf_ode, a MATLAB code which sets up an ordinary differential equation (ODE) which defines a stable periodic orbit of a spacecraft around the Earth and the Moon.

Although the orbit should be periodic, and repeats after a time interval of a little more than 17 units, most ODE solvers will have difficulty coming close to periodicity.


The computer code and data files described and made available on this web page are distributed under the MIT license


arenstorf_ode is available in a MATLAB version and an Octave version and a Python version.

Related Data and codes:


matlab_ode, MATLAB codes which set up various ordinary differential equations (ODE).


  1. Richard Arenstorf,
    Periodic solutions of the restricted three body problem representing analytic continuations of Keplerian elliptic motions,
    American Journal of Mathematics,
    Volume 85, Number 1, pages 27-35, January 1963.
  2. John D Cook,
    The orbit that put men on the moon,
    Posted 08 February 2020.
  3. Ernst Hairer, Syvert Norsett, Gerhard Wanner,
    Solving Ordinary Differential Equations I: Nonstiff Problems,
    Springer, 1987,
    ISBN: 3540566708,
    LC: QA372.H16.

Source Code:

Last revised on 10 June 2021.