Spacecraft Trajectory Optimization

Trajectory optimization using AI

Spacecraft mission will become more common. There are relevant open projects such that Mars colonization and exploring missions outside the Solar System.

These missions require high accuracy calculations because the error propagates in time and would be able to modify the trajectory.

There are many ways to face this problem: analytical or numerical approaches.

The analytical approaches could only be used for simplified problems, and thus it is really restrictive.

The numerical approaches commonly used and include metaheuristics and nonlinear programming. I have used genetic algorithms to solve a basic problem which consists of optimizing trajectory to travel to Mars from the Earth.



The algorithm optimizes the fuel for the trip and achieves a 99.99% accuracy in 1000 generations.

Reached Velocity0.99918320
Reach Distance0.9999754


    \[ \frac{d\vec{r}}{dt}=\vec{v} \]

    \[ m\frac{d\vec{v}}{dt}=\vec{F} \]

N-Body Problem

    \[m\frac{d\vec{v}}{dt}=\sum^n F\]



Euler’s Method

    \[x'=\lim_{\Delta t\rightarrow 0}\frac{x(t+\Delta t)-x(t)}{\Delta t}\]

    \[\vec{v}^{t+1}=\vec{v}^{t}+G*\Delta t*\sum_{j=1}^n\frac{m_j}{r_{ij}^3}\vec{r_{ij}}\]

    \[ \vec{r}^{t+1}=\vec{r}^t+v^{t+1}*\Delta t \]

Genetic Algorithm

The genetic algorithm is very well known here. [ Genetic Algorithm ]


Once we have optimized our space trip, we obtained the direction of the impulse for every second.


The direction is given in discratized values, but we interpolate the values and get an uniform function that smooths the changes.

Leave a Reply

Your email address will not be published. Required fields are marked *