Code covered by the BSD License  

Highlights from
A MATLAB Script for Propagating Interplanetary Trajectories from Earth to Mars

A MATLAB Script for Propagating Interplanetary Trajectories from Earth to Mars

by

 

Numerically integrate the orbital equations of motion of an Earth to Mars interplanetary trajectory.

display1(jdtdb, cbmu, r, v)
function display1(jdtdb, cbmu, r, v)

% display time, orbital elements and state vector

% Orbital Mechanics with MATLAB

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

global dutet

% compute and display tdb calendar date and time

[date_tdb, time_tdb] = jd2str(jdtdb);

fprintf('\ncalendar date      ');

disp(date_tdb);

% utc calendar date and time

jdutc = jdtdb - dutet / 86400.0d0;
    
[date_utc, time_utc] = jd2str(jdutc);
    
fprintf('\nUTC time           ');
  
disp(time_utc);

% display utc julian date

fprintf('\nUTC julian date    %12.8f\n', jdutc);

fprintf('\nTDB time           ');

disp(time_tdb);

% display tdb julian date

fprintf('\nTDB julian date    %12.8f\n', jdtdb);

% compute and display classical orbital elements

oev = eci2orb1 (cbmu, r, v);

oeprint1(cbmu, oev);

% display state vector

svprint(r, v);

Contact us