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
Model
mSS = [5000];
thrust = [00];
Isp = 405;
mFuel = 0;
rocket = CreateRocketModel(mSS, mFuel, thrust, Isp, 'demo', 'l' );
d = LaunchRHSData( 3, rocket );
d.cDA = 2.7*2;
Simulation
r = [1;0;0]*(d.Rp + 70);
v = [0;1;0]*sqrt(d.mu/r(1));
x = [r;v;0];
nSim = 2400;
dT = 1;
x = [x zeros(length(x),nSim)];
for k = 1:nSim
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));
t = (0:nSim)*dT;
jD = JD2000 + t/86400;
OrbTrack( x(1:3,:), jD, '3d', d.planet );
[t, tL] = TimeLabl( t);
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');