GuidedLaunchOpt2D:

--------------------------------------------------------------------------
   Compute the parameters to perform a 2D launch into a circular orbit.
   Uses fminsearch on the cost function in options, then performs a final
   simulation with the selected parameters. Includes a demo for Pegasus 
   air launch.

   Tunable parameters:
   1. initial flight path angle
   2. Last stage mass (fraction of original, keep structural ratio)
   3. DATO: coast time before last stage ignition
      SATO/HATO: thrust angle for last stage

   The vehicle is simulated using GuidedLaunch2DSim, then the specified
   upper stage is used to perform a circularization burn.

   Since version 1.0
--------------------------------------------------------------------------
   Form:
   data = GuidedLaunch2D( name, scale, options, p0 );
--------------------------------------------------------------------------

   ------
   Inputs
   ------
   name          (:)   Name of the launch vehicle model to use.
                          Stored in "RocketDatabase.m"
   scale         (1)   Scale to apply to that model.
   options       (.)   Set of launch options, including
                         .costFun, i.e. GuidedLaunch2DCost
                         .rhsFun,  i.e. GuidedLaunch2DRHS
                         .direct   Flag: (1) direct or (0) indirect
                       Can specify with "LaunchOptions.m"
   p0           (3,1)  Initial guess at parameters.
                       1. initial flight path angle (rad)
                       2. last stage mass scaling factor
                       3. coast time before last stage ignites (minutes)
                          OR last stage thrust angle, for indirect

   -------
   Outputs
   -------
   data          (.)   Data structure with launch results.

--------------------------------------------------------------------------
   See also LaunchOptions, GuidedLaunch2DRHS, GuidedLaunch2DCost,
   GuidedLaunch2DSim, LaunchSummary
--------------------------------------------------------------------------

Children:

Common: Graphics/NewFig
LaunchVehicle: LVDatabase/RocketDatabase
LaunchVehicle: LaunchOpt/LaunchOptions
LaunchVehicle: VehicleModels/RemoveStage
LaunchVehicle: VehicleModels/ScaleVehicle