LunarOrbitInsertion:

Path: LunarMissions/LunarMission

% Computes parameters for a lunar orbit insertion.
 Computes the total velocity change, the vector direction for the burn
 and the duration of the burn. This always burns in the direction of the
 velocity error. You should approach the moon in the right direction
 so that the resulting orbit is achieved.

 If your input is elements dR must be part of the orbit track otherwise
 it won't work. The moon relative position must be at the point in the
 orbit specified by the mean anomaly.

 Type LunarOrbitInsertion for a demo.

--------------------------------------------------------------------------
	Form:
	[deltaV, uECI, tBurn] = LunarOrbitInsertion( hLunarOrbit, dR, dV, mI, uE, thrust )
--------------------------------------------------------------------------

   ------
   Inputs
   ------
   hLunarOrbit	(1,:)	Perigee altitude or lunar orbital elements
   dR          (3,1)	Relative position vector at start (km)
   dV          (3,1)	Relative velocity vector at start (km/s)
   mI          (1,1)	Initial mass (kg)
   uE          (1,1) Exhaust velocity (m/s)
   thrust      (1,1) Thrust (N)

   -------
   Outputs
   -------
   deltaV  (1,1)   Velocity change (km/s)
   uECI    (3,1)   Vector for burn
   tBurn   (1,1)   Burn duration (sec)

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