Contents

LSQ launch demo

Use least squares approach to compute launch conditions. In order to achieve orbit, the final states are a vRatio of 1 and a flight path angle of 0. The demo is for Pegasus. The parameters are the initial flight path angle and the size of the third stage.

------------------------------------------------------------------------- See also LSQLaunch, LSQLaunchSim -------------------------------------------------------------------------

%--------------------------------------------------------------------------
%	Copyright (c) 2014 Princeton Satellite Systems, Inc.
% All rights reserved.
%--------------------------------------------------------------------------

Initialization

% LSQ parameters [gamma; scale], where:
%      gamma:   Initial flight path angle
%      scale:   Scale of 3rd stage
p0G = [0.94;1];
% Final states to match. [vRatio; gamma]
zM = [1;0];
% Diagonal weighting matrix
W  = [1 0;0 10];

% load launch vehicle data
rocket = RocketDatabase( 'Pegasus' );
rocket = ScaleVehicle( rocket, 0.65 );
% remove all non-fueled stages
kNF = find(rocket.eS==1);
for i=kNF
  rocket = RemoveStage(rocket,i);
end
rocket = SetPayloadMass( rocket, 200 );

% RHS data structure
d = LaunchRHSData( 2, rocket );
d.coast = [0 0 292.764]; % coast times (sec)
d.cDA   = [0;0;0];  % drag coefficients

% additional launch data
d.simFun    = @LSQLaunchSim;
d.direct    = 1;        % 2 possible launch methods: direct (1) OR indirect (0)
d.h0        = 11.9;     % initial altitude (km)
d.v0        = 0.242;    % initial velocity (km/s)

Calculate

[p0,z] = LSQLaunch( p0G, zM, W, d );
disp('Parameters')
disp(p0')
disp('Target and Achieved Conditions')
disp([zM z])
Norm of perturbation (dp0)    Norm of error (zM-z)
        0.0240303091013275        0.0315550446017846

        0.0441098529278571        0.0163450620531837

        0.0878882511025563        0.0308266336064912

        0.0547020006620178        0.0247427888743289

        0.0411885041169771        0.0259508765673048

        0.0544166002824552        0.0153664604528374

         0.111126554674725        0.0118782736893577

        0.0113611565685022        0.0079050463628379

       0.00136888311154851       0.00633447930705636

       0.00874971615867564       0.00622392031416528

Parameters
         0.892355365017794          0.91777213189229

Target and Achieved Conditions
                         1           1.0061624941682
                         0      0.000872266991241002

Simulate and Plot

[~,xS,time] = LSQLaunchSim( p0, d );
Plot2D(xS(1,:),xS(2,:),'Range (km)','Altitude (km)');
Plot2D(time',xS(3,:),'Time (s)','Velocity (km/s)')
Plot2D(time',xS(4,:),'Time (s)','Flight Path Angle')


%--------------------------------------
% PSS internal file version information
%--------------------------------------