File Exchange

image thumbnail

A MATLAB Script for Propagating Trajectories from the Earth to the Moon

version (861 KB) by David Eagle
Integrate n-body trajectories from the Earth to the Moon. Includes non-spherical Earth gravity.


Updated 28 May 2014

View License

PDF document and a MATLAB script called pprop_lunar that can be used to numerically integrate the geocentric orbital equations of motion of a trajectory from the Earth to the Moon. This scientific simulation begins at a user-defined epoch and geocentric state vector (position and velocity vectors) representing the point of trans-lunar injection (TLI) and ends at (1) closest approach to the Moon, (2) a user-defined Moon-centered (selenocentric) distance, or (3) at a user-defined final epoch.

Cite As

David Eagle (2020). A MATLAB Script for Propagating Trajectories from the Earth to the Moon (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (2)

Vincenzo Capuano

I soleved the problem; it didn't work because I didm't dwonload the JPL binary ephemeris file.

Anyway, I have another question; have you any idea about the accuracy in position and velocity of this propagator?

Thank you very much,

Vincenzo Capuano


I tried to run your script, but it doesn't work:

Error using fread
Invalid file identifier. Use fopen to generate a valid file identifier.

Error in jplephem (line 71)
ttl = fread(fid, 252);

Error in pprop_eqm (line 44)
svsun = jplephem(jdate, 11, 3);

Error in odearguments (line 88)
f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.

Error in ode45 (line 114)
[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, ...

Error in findca (line 33)
[t, ysol, tevent, yevent, ie] = ode45(@pprop_eqm, [0 tend], [ri vi], options);

Error in pprop_lunar (line 101)
[jdtdb_ca, re2sc, ve2sc, rm2sc, vm2sc] = findca(jdtdb_tli, ri, vi);

Can you help me please?


Includes new option to model the effect of the Moon on the trajectory using non-spherical lunar gravity.

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