Code covered by the BSD License  

Highlights from
Optimal Impulsive Orbital Transfer

Optimal Impulsive Orbital Transfer


David Eagle (view profile)


27 Nov 2012 (Updated )

MATLAB script for the solution of the one and two impulse orbit transfer between two Earth orbits.

svprint1(fid, r, v)
function svprint1(fid, r, v)

% print position and velocity vectors and magnitudes to file

% input

%  r = position vector (kilometers)
%  v = velocity vector (kilometers/second)

% Orbital Mechanics with MATLAB


% position magnitude (kilometers)

rmag = norm(r);

% velocity magnitude (kilometers)

vmag = norm(v);

% print state vector and magnitudes

fprintf (fid, '\n        rx (km)                 ry (km)                rz (km)                rmag (km)');

fprintf (fid, '\n %+16.14e  %+16.14e  %+16.14e  %+16.14e  \n', r(1), r(2), r(3), rmag);

fprintf (fid, '\n        vx (kps)                vy (kps)               vz (kps)               vmag (kps)');

fprintf (fid, '\n %+16.14e  %+16.14e  %+16.14e  %+16.14e  \n\n', v(1), v(2), v(3), vmag);

Contact us