# 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 Velocity 0.999183 Reach Distance 0.999975

N-Body Problem

Euler’s Method

#### Genetic Algorithm

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

#### Result

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

 Angle(0-2) 0.19 0.32 0.82 1.45 1.94

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