Code covered by the BSD License

# Two-dimensional, Low-thrust Earth-to-Mars Trajectory Analysis with MATLAB

### David Eagle (view profile)

27 Jun 2013 (Updated )

Determines optimal, two-dimensional low-thrust Earth-to-Mars interplanetary trajectories.

ilt_eqm (t, y)
```function ydot = ilt_eqm (t, y)

% two-dimensional low-thrust polar equations of motion

% required by ilt_opt.m

% input

%  t    = non-dimensional simulation time
%  y(1) = radial distance (r)
%  y(2) = radial component of velocity (u)
%  y(3) = tangential component of velocity (v)
%  y(4) = polar angle (radians)

% output

%  ydot(1) = r-dot
%  ydot(2) = u-dot
%  ydot(3) = v-dot
%  ydot(4) = theta-dot
%  ydot(5) = propellant mass flowrate
%  ydot(6) = thrust acceleration

% Orbital Mechanics with MATLAB

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

global alpha_wrk acc_thrust mp_dot throttle

% current non-dimensional thrust acceleration

accm = throttle * acc_thrust / (1.0 - mp_dot * t);

% evaluate equations of motion at current conditions

r = y(1);

u = y(2);

v = y(3);

% r-dot

ydot(1) = u;

% u-dot

ydot(2) = (v^2 / r) - (1.0 / r^2) + accm * sin(alpha_wrk);

% v-dot

ydot(3) = -(u * v / r) + accm * cos(alpha_wrk);

% theta-dot

ydot(4) = v / r;

% propellant mass flowrate

ydot(5) = throttle * mp_dot;

% thrust acceleration

ydot(6) = accm;

```