A reentry simulation in Cartesian coordinates using LaunchVehicle3D.

The vehicle has one stage since propulsion is not modeled. The vehicle
starts 70 km up. This reentry is totally passive and no control is
employed.
------------------------------------------------------------------------
See also RHSLaunchVehicle3D, Plot2D, TimeLabl, Mag, RK4, JD2000,
FlightPathAngle, OrbTrack, Gamma
------------------------------------------------------------------------

Contents

%-------------------------------------------------------------------------------
%    Copyright (c) 2007, 2015 Princeton Satellite Systems, Inc.
%    All Rights Reserved.
%-------------------------------------------------------------------------------

Model

mSS       = [5000];      % Dry mass of each stage
thrust    = [00];        % Thrust of each stage
Isp       = 405;        % Specific inpulse
mFuel     = 0;
rocket    = CreateRocketModel(mSS, mFuel, thrust, Isp, 'demo', 'l' );
d         = LaunchRHSData( 3, rocket );
d.cDA     = 2.7*2;       % Drag coefficient of stage times area

Simulation

%------------
r     = [1;0;0]*(d.Rp + 70);
v     = [0;1;0]*sqrt(d.mu/r(1));
x     = [r;v;0]; % Last number is mass of fuel

nSim  = 2400;
dT    = 1;

% Store plot points in x
%-----------------------
x  = [x zeros(length(x),nSim)];
for k = 1:nSim

  % Propagate one step
  %-------------------
  x(:,k+1) = RK4( @RHSLaunchVehicle3D, x(:,k), dT, 0, d );

  if( Mag(x(1:3,k+1)) - d.Rp <= eps )
    break;
  end

end

Plotting

nSim = k;
x    = x(:,1:(nSim+1));

% Plot the trajectory
%--------------------
t  = (0:nSim)*dT;
jD = JD2000 + t/86400;
OrbTrack( x(1:3,:), jD, '3d', d.planet );

% Create the time array and label
%--------------------------------
[t, tL] = TimeLabl( t);

% Plot the states
%----------------
yL = {'X (km)' 'H (km)' 'V (km/s)' '\gamma (rad)'};
gamma = FlightPathAngle( x(1:6,:) );

h = Mag(x(1:3,:)) - d.Rp;
p = Mag(Unit(x(1:3,:)) - repmat(Unit(x(1:3,1)),1,nSim+1))*d.Rp;
Plot2D( t, [p;h;Mag(x(4:6,:));gamma], tL, yL, 'LV 2D States');
yL = {'X (km)' 'Y (km)' 'Z (km)' 'V_x (km/s)' 'V_y (km/s)' 'V_z (km/s)'};
Plot2D( t, x(1:6,:), tL, yL, 'LV States');


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