LunarTargeting:

% Generate transfer orbit elements for a lunar mission.

 Uses the JPL Ephemerides for the Earth and moon. The target is the
 perigee altitude of the hyperbolic passage of the moon. The function
 propagates the resulting trajectory using ode113. It propagates to the
 target point. You can specify radius of perigee and orbit inclination.

 The spacecraft starts in any orbit.

 Requires fmincon in the optimization toolbox. See fmincon for the
 definition of the argument opts.

 Type LunarTargeting for a demo.

--------------------------------------------------------------------------
   Form:
   [x0,eL,dVm,jD0] = LunarTargeting( date, a0, rP, inc, opts )
--------------------------------------------------------------------------

   ------
   Inputs
   ------
   date    (1,:)  Date [yy mm dd hh mm ss] or Julian date
                  of lunar encounter
   el0     (1,5)  Parking orbit elements [semi-major inc lon arg e]
   rP      (1,1)  Periselenium distance (km)
   inc     (1,1)  Lunar orbit inclination (rad)
   opts    (.)    Optimization tolerance data structure

   -------
   Outputs
   -------
   x0      (1,6)  Initial state
   elL     (6,1)  Lunar elements
   dV      (3,1)  Insertion vector
   jD0     (1,1)  Start Julian date

--------------------------------------------------------------------------

Children:

Common: General/HasOptimizationToolbox
Common: Graphics/Plot3D
Common: Graphics/TimeLabl
Common: Time/Date2JD
Math: Linear/Mag
Orbit: OrbitMechanics/APlanet
Orbit: OrbitMechanics/LambertTOF
Orbit: Visualization/EarthMoon
OrbitMiniToolbox: Support/El2RV
SC: BasicOrbit/RV2El
SC: Ephem/PlanetPosJPL