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.

soi_event(t, y)
function [value, isterminal, direction] = soi_event(t, y)

% sphere-of-influence event function

% input

%  t = current simulation time
%  y = current spacecraft geocentric state vector (km & km/sec)

% output

%  value = difference between current position and soi (kilometers)

% global

%  rsoi = Earth sphere-of-influence (kilometers)

% Orbital Mechanics with MATLAB

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

global rsoi_target

% difference between current geocentric distance and soi (kilometers)

value = norm(y(1:3)) - rsoi_target;

isterminal = 1;

direction =  [];

Contact us