IT 18 010 Examensarbete 30 hp Augusti 2018
High-Thrust Interplanetary Spacecraft Trajectory Optimization Using Cuda
Viktor Wase
Institutionen för informationsteknologi Department of Information Technology
Abstract High-Thrust Interplanetary Spacecraft Trajectory Optimization Using Cuda Viktor Wase
Teknisk- naturvetenskaplig fakultet UTH-enheten Global optimization applied to the design of high-thrust interplanetary space trajectories is a computationally expensive task. This thesis investigates the feasibility Besöksadress: of combining the Multiple Gravity Assist model of spacecraft trajectory with periodic Ångströmlaboratoriet Lägerhyddsvägen 1 Lyapunov orbits. The trajectories are designed by optimization, enabled by the Hus 4, Plan 0 computational power of a high-end graphics processing unit.
Postadress: Box 536 751 21 Uppsala
Telefon: 018 – 471 30 03
Telefax: 018 – 471 30 00
Hemsida: http://www.teknat.uu.se/student
Handledare: Nils Höglund Ämnesgranskare: Stefanos Kaxiras Examinator: Jarmo Rantakokko IT 18 010 Tryckt av: Reprocentralen ITC
Contents
1 Introduction 3 1.1 PaperOverview...... 3 1.2 PaperStructure...... 3
2 Background 3 2.1 GenerativeDesign ...... 3 2.2 Parallelization ...... 4 2.2.1 SIMD ...... 5 2.2.2 CPUvsGPU...... 5 2.2.3 CUDA ...... 5
3 Models of Celestial Dynamics 5 3.1 2-BodyProblem ...... 6 3.1.1 Lambert’s Problem ...... 6 3.1.2 MultipleGravityAssistModel ...... 7 3.1.3 Radius of Planets ...... 9 3.2 Restricted3-BodyProblem ...... 10 3.2.1 Planar Circular Restricted 3-body Problem ...... 10 3.2.2 Lagrange Points ...... 10 3.2.3 Periodic Lyapunov Orbits ...... 12 3.2.4 Generation of Periodic Lyapunov Orbits ...... 12
4 Purpose and Scope 12
5 Algorithms 13 5.1 Integrators ...... 13 5.1.1 Adaptive time-step Runge-Kutta ...... 13 5.2 Optimizers ...... 14 5.2.1 Particle Swarm Optimization ...... 14 5.2.2 Self-Adaptive Di↵erential Evolution ...... 15 5.2.3 Ant Colony Optimization ...... 15 5.3 RootFinders ...... 17 5.3.1 Newton-Raphson ...... 17 5.3.2 Halley’s Method ...... 17 5.3.3 Ad Hoc Root Finder ...... 18
6 First Attempt 19
7 Details of Implementations 20 7.1 Planetary Positions ...... 20 7.2 Discrete-Continous Optimization ...... 20 7.3 ObjectiveFunction ...... 21 7.4 Implementation of Periodic Lyapunov Orbit Generation . . . . . 22 7.4.1 Theory of Optimization ...... 22 7.4.2 Troubleshooting Lyapunov Orbits ...... 23 7.4.3 Implementation ...... 23 7.5 Approximations and Reliability of Results ...... 24
1 8 Experiments 24 8.1 Hardware Setup ...... 24 8.2 Compiler and Flags ...... 24 8.3 Root Finders for Calculation of Closest Approach ...... 25 8.4 PeriodicLyapunovOrbits ...... 25 8.5 Massively Parallel Multiple Gravity Assists ...... 25 8.5.1 Continuous optimization only ...... 25 8.5.2 Discrete/continuous Optimization ...... 26 8.6 Conical Arcs And Lyapunov Orbits Combined ...... 26
9 Results 27 9.1 Root Finders for Calculation of Closest Approach ...... 27 9.2 PeriodicLyapunovOrbits ...... 27 9.3 Massively Parallel Multiple Gravity Assists ...... 27 9.3.1 Continuous optimization ...... 27 9.3.2 Discrete and Continuous Optimization ...... 27 9.4 Conical Arcs And Lyapunov Orbits Combined ...... 27
10 Analysis 32 10.1RootFinders ...... 32 10.2 Periodic Lyapunov Orbits ...... 32 10.3 Massively Parallel Multiple Gravity Assists ...... 32 10.3.1 Continuous optimization ...... 32 10.3.2 Discrete and Continuous Optimization ...... 32 10.4 Conical Arcs And Lyapunov Orbits Combined ...... 32 10.5 Conclusions ...... 32
11 Further Research 33
2 1 Introduction
Humans have been sending space probes into the far reaches of space since the early 60’s with programs such as USA’s Pioneer Program and Soviet’s Sputnik Program and Venera Program. Most notable however is perhaps the Voyager Program from the late 70’s, in which two robotic probes were sent in a trajec- tory that visited most of the outer planets. As of this writing Voyager 1 remains the only human made object to leave our solar system [22], although its twin is expected to enter interstellar space soon as well.
While the physical reach of humans has yet to extend beyond the Earth’s moon our robotic probes have gone to a wide variety of celestial objects, each with a di↵erent set of challenges and each providing a di↵erent set of scientific insights; from the complex organic compounds found by Rosetta [5] to the hexagonal shaped storm on Saturn’s north pole [11] to the fact that Pluto is still geolog- ically active [36]. None of these discoveries, or the theories they inspire, would have been possible without the work of the countless men and women designing the complex trajectories of the space probes.
1.1 Paper Overview This study describes the software C.A.S.S.A.N.D.R.A, an acronym for Chaos Assisted Sling Shots And Non-linear Dynamical gRavity Assists. The goal of Cassandra is to automatically generate trajectories that would allow laymen (or at least non-experts in spacecraft trajectory design) to test out the feasibility of high-thrust low-fuel space missions. This is achieved using the power of mas- sively parallel graphics cards.
A high-thrust trajectory simply refers a path through space that can be achieved using a finite number of short (on the timescale of seconds) bursts of the engine.
1.2 Paper Structure This paper has the following structure: section 2 gives a background on design by optimization, a.k.a. Generative Design as well as a primer on parallelization. Section 3 describes di↵erent mathematical models of celestial motion and their advantages and drawbacks. This is of vital importance since part of the novelty of this study arises from the combination of several models. Section 4 discusses which e↵ects are deemed to be out of scope. Section 5 describes all algorithms that are used, separately. Section 6 describes a failed first attempt. Section 7 describes how the algorithms are combined as well as details of implementation. Section 8,9 and 10 describe the experiments, their results and what conclusions that can be drawn, respectively. Section 11 is about possible further research.
2 Background 2.1 Generative Design The use of evolutionary algorithms in space mission design is common practice nowadays [40, 28, 15, 20]. The approach is a new one, it was not even mentioned
3 in Betts’ classical survey from ’98 [4], which instead focused on Nonlinear Pro- gramming and Optimal Control. The rough idea is that the user defines some quantity (such as time of flight, fuel usage, or number of celestial bodies visited) and the Generative Design software designs a trajectory which optimizes this quantity while still making sure that the trajectory is within the parameters of the mission.
There are many advantages to using the approach of Generative Design, but perhaps the most convincing one is that of simplicity; instead of having a team of experts developing the trajectory anyone can let the software generate an ap- proximate trajectory and inspect the required mission parameters to determine if it is possible. A contrast to this is the Voyager program, where the engineers had to plot tens of thousands pork chop plots and use these to decide which trajectories were viable [26].
Another advantage is that computers can come up with designs that humans are unlikely to ever think of, such as the partition door Autodesk developed for Airbus using generative design [3]. It was twice as light as the one developed by humans. Another example is the antenna designed by an evolutionary algo- rithm by NASA [13]. Its shape was highly unintuitive, but it outperformed the antennas designed by humans.
2.2 Parallelization Parallel programming is the practice of running software on multiple computa- tional units at the same time [1]. This is, however, not as simple as it might sound. In order to turn serial code, running on only one core, into parallel code one has to be able to divide the problem into smaller sub-problems, to be distributed over the available cores. This is not always possible. For example if the input data of one of the sub-problems is based on the output data of one of the other sub-problems, then these two need to be done sequentially and are therefore not parallelizable.
Another di culty of parallelization is load balancing of tasks [39] It is rather common for sub-problems to vary in di culty and execution time, which means that the sub-problems should be distributed over the the available cores in such a way that no core is idle. This is of course often impossible, but finding a good load balance reduces running time and is therefore nonetheless important.
However, even if the load balance is perfect, this will not mean that the speedup achieved is perfectly linear; it is restricted by Amdahl’s law [2]. Speedup is de- fined as the the running time of the parallel code divided by the running time of the serial code. It is usually given as a function of the number of cores. Sometimes a small part of the problem is sequential and cannot be parallelized. Denote the fraction of the running time of this part by rs. This means that the fraction that is parallelizable is 1 rs. Hence the speed up of the running time is restricted by 1 s(n) r +(1 r )/n s s
4 where n is the number of cores. Taking this to its limit gives s 1/rs as 1 ! n , thus placing a theoretical ceiling of r on the speed up. !1 s 2.2.1 SIMD There are di↵erent types of parallel programming. The one used in this thesis is the Single Instruction Multiple Data (SIMD), also known as Single Program Multiple Data (SPMD). This means that even though the cores run in parallel, they have to execute the same operations at the same time [30]. Meaning that they have to do the same thing.
2.2.2 CPU vs GPU The cores of a computer is sometimes referred to as a Computational Processing Unit (CPU). In contrast, the computational unit that handle graphics in a com- puter is called Graphical Processing Unit (GPU). (k¨alla h¨ar)There is a rather vast di↵erence in the hardware of these processing units; the GPU is made up of 100’s to 1000’s cores which are all running in parallel and while there might be several cores in a computer their numbers very rarely surpass 8.
Another di↵erence is that the cores on a GPU are grouped together in such a way that every group of cores is executed in a SIMD fashion.
2.2.3 CUDA CUDA is a parallel computing platform and programming model developed by Nvidia to program Graphical Processing Units (a.k.a. graphics cards or GPUs) [24]. The platform allows high-level coding in C (and to a broadening extend in the newer versions, even C++) with APIs that allow for control of the GPU functionality. The computationally expensive parts of the software is acceler- ated using an Nvidia GPU device and CUDA.
In this study it is always mentioned when an algorithm is o↵-loaded to the GPU.
3 Models of Celestial Dynamics
Humans have developed models describing the movements of the celectial bodies ever since the dawn of the scientific era. It was almost 400 years ago that Kepler developed his three laws based on the observations of Tycho Brahe. And this e↵ort continues to this day, even though Newton’s theory of gravity together with Einstein’s theory of relativity describe the movement of common objects such as moons, planets, comets and stars rather well. One of the reasons this is still an ongoing field of study is that Newton’s theory of gravity, in all but the simplest of cases, lacks analytic solutions. It is therefore prudent to cover some of the most common approximations of spacecraft and planetary trajectories.
5 3.1 2-Body Problem The problem of finding the trajectories of two celestial bodies that only a↵ect each other is often referred to as the 2-body Problem. It is often the case that the mass of one of these bodies is orders of magnitude greater than the mass of the other. If this is the case a reasonable assumption to make is to ignore the gravitational e↵ects of the smaller body on the larger one. This is referred to as the Restricted 2-body Problem, and is often a good approximation of star- planet, star-comet and planet-moon interactions.
The heart and soul of the restricted 2-body problem is Keplerian dynamics, which is based on Kepler’s three laws of planetary motion [35]. These are The orbit of each planet is an ellipse with the Sun occupying one focus. • The line joining the Sun to a planet sweeps out equal areas in equal inter- • vals of time. A planet’s orbital period is proportional to the mean distance between the • 3 Sun and the planet, raised to the power of 2 . These laws holds true for any two bodies where one of the masses is orders of magnitude larger than the other with the caveat that the trajectory of the smaller body is any type of conic section, and not necessarily an ellipse.
The only time the Keplerian 2-body system is used in this study is in the Multiple Gravity Assist model.
3.1.1 Lambert’s Problem One of the fundamental problems in astrodynamics is the so called Lambert’s problem [16]. Given two points in space r ~ 1,r~ 2, a time of flight ttof and a central body with a standard gravitational parameter µ, the objective is to find a Keplerian trajectory that intercept both points and have a flight time of ttof . The problem is formalized as d2~r rˆ = µ dt2 ~r 2 | | ~r (t1)=r ~ 1
~r (t2)=r ~ 2 where ~rˆ is a unit-vector in the direction of ~r , and t1 and t2 are the start and end times.
According to Lambert’s Theorem the time of flight of a Keplerian orbit is a function of the semi-major axis a, of the sum of the distances from the focal point of start and end points r1 +r2, and of the chord c which has r ~ 1 and r ~ 2 as its sides[16]. The only variable which is non-trivial to calculate is the semi-major axis a.
It should be noted that the solution might not be unique, since the direction of the orbit might be either clock-wise or counter clock-wise around the body. The orbit might also contain more than one revolution.
6 3.1.2 Multiple Gravity Assist Model The Multiple Gravity Assist (MGA) model is a global optimization approach to spacecraft trajectory design based on patched conic sections [15]. The whole trajectory is separated into legs, where each leg is an instance of Lambert’s problem with the position of some planets as boundary conditions. This means that each leg has a starting planet and a destination planet and a time of flight, with simple Keplerian orbital mechanics during the flight.
The power of the MGA model lies in it’s implementation of V ’s. The naive way of describing a V requires 4 parameters: time as well as a 3D vector for size and magnitude. However Oberth’s e↵ect [25] states that the the most e cient way of gaining kinetic energy when falling down a gravitational well is to accelerate in the tangential direction when the spacecraft is closest to the celestial body. This is included into the V ’s of the MGA by assuming that the accelerators only burn when the spacecraft is closest to the planet it is passing.
The magnitude and direction of the V ’s can be deduced from the positions of the planets and the time of flight of the legs. Two consecutive Lambert legs requires three planets P1,P2,P3, which need not be distinct, and three times t1,t2,t3. Each solution to Lambert’s problem generates a velocity at the starting point and end point, and for two consecutive legs there might be a discontinuity between the end point velocity of the first leg and the starting point velocity of the second leg. Unfortunately this discontinuity in velocity does not represent the desired e↵ect of a high thrust burn, since the gravitational pull of the planet has an influence on the velocity as well. A good approximation of the planet induced V is therefore needed.
During a gravitational assist the trajectory of the spacecraft with respect to the planet will be hyperbolic, since it is assumed to have enough energy to leave the planetary system. However, since there is a V thrust when the spacecraft is at its closest to the planet, the outward and inward trajectories will not be the same. The powered flyby is therefore modeled as two patched hyperbolic trajectories.
Call the velocity at infinity of the inward hyperbolic trajectory V and the velocity at infinity of the outward hyperbolic trajectory V +. Note1 that both these velocities are planetocentric, and not heliocentric. These1 velocities are approximated as the inward and outward velocities of the Lambert legs (after they are transformed to planetocentric velocities).
The velocity at infinity and the semi-major axis a of a hyperbola are connected by the formula µ v = p 1 a r where µp is the standard gravity parameter of the planet [35]. Hence µ a = p v2 1 Call the closest distance between the spacecraft and the planet rc. This can be
7 Figure 1: Hyperbolic trajectory showing the angle ✓. calculated by r = a(e 1) c where e is the eccentricity of the trajectory [35]. By introducing the angle ✓ as the angle between the y-axis and the velocity at infinity of a east-west hyperbola (See figure 2), e can be defined as [35] 1 e = cos ✓ This gives 1 r = a 1 c cos ✓ ✓ ◆ Solving for ✓ gives
a 1 ✓ = arccos = arccos r a r /a 1 ✓ c ◆ ✓ c ◆
We now that the inward and outward hyperbolic trajectories have the same value for rc, but the semi-major axis and ✓ might di↵er. To avoid confusion they are referred to as ain,aout and ✓in,✓out. Call the angle between the plan- etocentric inward and outward velocities ✓diff .Then
✓diff + ✓in + ✓out =2⇡ ~ ~ The simplest way of finding the angle ✓diff between the vectors V 1 and V+1 is with the formula ~ ~ V 1 V+1 ✓ = arccos · diff ~ ~ V 1 V+1 ! | || | Since the closest approach rc is equal for the inward and outward trajectories we get 1 1 arccos + arccos = r /a 1 r /a 1 ✓ c in ◆ ✓ c out ◆ where is defined as =2⇡ ✓ . diff
8 Planet Radius 5 Mercury 1.65 10 AU · 5 Venus 4.09 10 AU · 5 Earth 4.30 10 AU · 5 Mars 2.29 10 AU · 4 Jupiter 4.72 10 AU · 4 Saturn 3.93 10 AU · 4 Uranus 2.71 10 AU · 4 Neptune 1.66 10 AU · Table 1: The radii of the planets as used in the code.
To find the correct rc a root finder is required. In this case Newton-Raphson was used. However, this does not answer the initial question of the size of the V . The vis-viva equation [35] for a Kepler trajectory is
v2 µ ✏ = 2 r and by using this in combination with the fact that µ ✏ = a for hyperbolic trajectories [35] on can solve for the velocity at the at rc.Ifthisis done for the inward trajectory as well as the outward trajectory the magnitude V is simply the di↵erence, since the direction of the V is assumed to be tangential to the velocity.
2 1 v(rc)=pµp + r a r c thus giving 2 1 2 1 V = pµp + + r a r a r c in r c out These results correspond to the ones given in [15]. 3.1.3 Radius of Planets
The value of the closest approach rc is not only used when calculating the V ; it is also needed to make sure that the spacecraft doesn’t crash into the planet. In order do make such a comparison the radii of the planets are needed. They are found at ssd.jpl.nasa.gov/?planet phys par
The mean radii are used, but increased with 1% in order to make sure that the found trajectory can be trusted.
9 3.2 Restricted 3-Body Problem The problem of analytical trajectory calculation goes from simple to all but impossible when a third body is involved. It is a well-known fact that general 3-body problem is chaotic in nature, but even simplifications such as the Planar Circular Restricted 3-body Problem (PCR3BP) is gives rise to chaotic behavior [31].
3.2.1 Planar Circular Restricted 3-body Problem
The PCR3BP assumes that the smallest mass m3 is orders of magnitudes smaller than the other two masses m1and m2,wherem1 >m2 [20]. The motion of the larger masses is assumed to be circular, which is almost the case with the planets and the Sun. The motion of all three bodies is assumed to be confined to a plane.
In order to simplify the governing equations of the CPR3BP the coordinate sys- tem is a synodic system, meaning that it rotates with the two larger bodies[28]. Without loss of generality the largest body can be assumed to lie on the x-axis at µ,whereµ is defined by µ Gm m µ = 2 = 2 = 2 µ2 + µ1 Gm2 + Gm1 m2 + m1 with G being Newton’s gravitational constant.
By normalizing the system in such a way that the unit of length is the dis- tance between the larger bodies, and the unit of time is is their orbit period divided by 2⇡ one gets the system[28]
x˙ = vx
y˙ = vy @⌦ v˙ = +2v x @x y @⌦ v˙ = 2v y @y x where x2 + y2 1 µ µ ⌦= + + 2 (x + µ)2 + y2 (x + µ 1)2 + y2 and thus p p @⌦ (µ 1)(x + µ) µ(x + µ 1) = x + 3 + 3 @x (x + µ)2 + y2 (x + µ 1)2 + y2 @⌦ p (µ 1)y p µy = y + 3 + 3 @y (x + µ)2 + y2 (x + µ 1)2 + y2 p p 3.2.2 Lagrange Points There exists equilibrium points in the Restricted 3-Body Problem where the smaller body can in theory can stay indefinitely. These points are called La- grangian points after the French mathematician Joseph-Louis Lagrange. In
10 Figure 2: Position of the Lagrangian points. The iso-lines represent levels of constant potential energy. Image credit: NASA (Listed under Creative Com- mons 3.0 license). reality these points are highly unstable and the smallest of perturbations on the small body will kick it away from the equilibrium [35].
There are five of these points, referred to as L1 to L5 [18]. The first three lie on the line going through the two massive bodies, and L4 and L5 lie in the plane of motion and are mirror symmetrical over the x-axis. See figure 3 for a visualization.
In order to derive the position of these points in the CPR3BP one has only to find the points where
x˙ =0 y˙ =0
v˙x =0
v˙y =0 which is to say @⌦ @⌦ = =0 @x @y Unfortunately calculating the position these points involve finding the roots of a third function, which is a task to be avoided by all but the foolishly brave. It is, however, simple to find very accurate approximations to these points using root finders such as Newton-Raphson and Halley’s method. Only the L1,L2
11 and L3 points are of interest in this study, and as such y can be assumed to be zero. This reduces the equation to
(µ 1)(x + µ) µ(x µ 1) x + + =0 x + µ 3 x + µ 1 3 | | | | which divides the x-axis into three segments depending on the sign of x + µ and x + µ 1. Each segment have a slightly altered equation of their own: (µ 1) µ x + + =0ifx + µ 1 0 (x + µ)2 (x + µ 1)2 (µ 1) µ x + + =0ifx + µ 1 < 0 and x + µ 0 (x + µ)2 (x + µ 1)2 (µ 1) µ x + + =0ifx + µ<0 (x + µ)2 (x + µ 1)2
The L1, L2 and L3 Lagrange points can be found from these three equations.
3.2.3 Periodic Lyapunov Orbits
There exists periodic orbits in the plane defined in CPR3BP around the L1, L2 and L3 Lagrange Points. These are called Periodic Lyapunov Orbits [28]. These are highly unstable orbits, but allow for a spacecraft to follow the path of a planet without falling far into its gravitational well.
These orbits lack analytic solutions and finding them is a great area of study. The most common approaches of finding these orbits is to linearize the system around the Lagrange point in question and find decent approximations[32], use shooting methods[14], or use generating functions [12]. Each of these methods have their disadvantages: the approximations are quick but rough, the shooting methods are sensitive to initial conditions [20], and the generating functions have limited spatial range of applicability [20].
3.2.4 Generation of Periodic Lyapunov Orbits In recent years a new approach surfaced. By defining a function that calculates the fitness of each orbit approximation, one can simply apply a continuous op- timizer to the problem. This approach has been implemented successfully using a PSO on the Earth-Moon system [28].
This is the approach that Cassandra will use as well, since it allows for a great reuse of code. Since the continuous optimizers used in Cassandra have been written in CUDA this generation will hopefully receive a speedup compared to previous studies.
4 Purpose and Scope
The purpose of this study is to create a Generative Design software that com- bines simplicity of the Keplerian trajectories with the low-fuel trajectories of the 3-body problem.
12 In order to limit the scope of the study it will not include:
Aero-breaking • Relativistic E↵ects • Low Thrust trajectories • Moons and planetoids • Any solar system but our own • Sensitivity Analysis • Radiation Analysis • Cassandra will hopefully be of use to anyone who wants to quickly try out deep space mission ideas, even without these additions.
5 Algorithms
The algorithms in this paper are used for two things: approximating solutions to mathematical equations, both di↵erential equations and regular equations, were an analytic solution is lacking or for optimization.
5.1 Integrators A numerical integrator is used to approximate the solution of an Ordinary Dif- ferential Equation (ODE) when an analytic solution is unavailable. All ODE’s described in this study will be initial condition ODE’s, meaning that the initial state of the problem is known. A numerical integrator approximates the deriva- tive (sometimes referred to as the right hand side of the ODE) over an interval and approximates the integral of the derivative over the specified interval. The value of the calculated integral is then added to the current state of the ODE, thus approximating a new state. The details of this integration varies from in- tegrator to integrator.
The integrators will be used to numerically approximate a solution to the re- stricted 3-body problem.
5.1.1 Adaptive time-step Runge-Kutta The adaptive time-step Runge-Kutta is a method of integration based on the idea that the di↵erence between a step of lower order integrator and a higher order integrator can be used as an error estimation [9]. The so called Runge- Kutta-Fehlberg is a Runge-Kutta based method that calculates the p:th and (p + 1):th order approximations each iteration. A fixed step Runge-Kutta of order p needs to evaluate the right-hand side function at p points. In order to improve e ciency the Runge-Kutta-Fehlberg method uses the same points for both the p:th order approximation and the (p + 1):th order approximation, thus the cost of the adaptive time-step is roughly one right-hand side evaluation per
13 iteration.
The method is given a local tolerance ✏, and if the di↵erence between the two approximations is greater than ✏, then the step-size is decreased and the approxi- mations are recalculated. Usually a minimum time-step is supplied to make sure that the method terminates.
5.2 Optimizers There are two types of optimizers used in this study: continuous optimiz- ers and a discrete optimizer. A continuous optimizer is used for minimiz- ing/maximizing function with real values as input, and a discrete one is used to minimize/maximize a function which uses integers as input.
In this study the discrete optimizer will only be used to decide which plan- ets that the spacecraft should do a flyby of, and in what order. The continuous optimizer will be used to find periodic orbits in the restricted 3-body problem as well as actually designing the Keplerian orbits between the planetary flybys.
5.2.1 Particle Swarm Optimization Particle Swarm Optimization (PSO) is one of the more common swarm based optimization methods. It is widely used in spacecraft trajectory optimization [40, 28, 15]. In it there are N particles, each with a position and velocity (these particles, and therefore their position and velocity, only exist in the so- lution space; it is not a physical position or velocity), where each position must uniquely represent a solution to the problem to be optimized [33]. These parti- cles then travel over the fitness landscape in search of a good solution.
The particles interact with each other in a way that loosely resembles the move- ment of flocks of birds and schools of fish. Denote the position of particle t t t t number i at time index t by Xi , and its velocity by Vi . Both Xi and Vi are d- dimensional vectors, where d is the dimensionality of the optimization problem at hand. During each iteration the velocity is updated according to the formula
V t+1 = ↵ V t + u (P Xt)+ u (N Xt) i i 1 1 i i 2 2 i i where Pi is the best position that the particle in question has visited, and Ni is the best position that any particle in the neighborhood has visited, and ↵, 1 and 2 are tuning parameters. The position is then updated by the formula
t+1 t t+1 Xi = Xi + Vi There are multiple ways to define the neighborhood of a particle. A global neighborhood means that every particle can interact with every other particle, and while this seems intuitive enough this method often gets trapped in local minima since all particles tend to flock around the best solution so far. The neighborhood used in this study is a ring topology, meaning that each parti- cle has a left and a right neighbor and all particles are connected to each other through their neighbors. Although other topologies might have proved superior, the ease of implementing this on in a CUDA block far outweighed any slight
14 Figure 3: Visualization of a ring topology. potential gains. See figure 1 for a visualization.
1+r1 The parameters are set as ↵ = 2 , 1 =1.49445r2 and 2 =1.49445r3, where ri is a uniformly random number in the range [0, 1), in accordance with [33]. The particles therefore have di↵erent values for these tune-able parameters.
5.2.2 Self-Adaptive Di↵erential Evolution Di↵erential Evolution (DE) is a continuous optimizer, that uses the di↵erence between individuals to create a new o↵spring. The classical di↵erential evo- lution algorithm requires two parameters, usually referred to as p and f [40]. During each iteration all individuals in the population are updated according to these rules: Step one is to select 3 random but distinct individuals A, B, C from the iteration before. Call the new individual Y . It is an o↵spring of these three individuals defined byY = A+f(B C), where f is a tuneable parameter. These o↵-springs will be created until all a new population of the same size as the original is created. Each of these new individuals will cross over with an old individual. The old individual is replaced if and only if the fitness of the individual created using the cross over mutation is higher than the fitness of the old individual.
In this study an exponential crossover is utilized, which means that a random point q is chosen uniformly such that 0 q The self-adaptive version of Di↵erential Evolution tunes the parameters f and p automatically. Each individual contains the original gene as well as values for f and p. Before calculating the next iteration there is a 10% chance that either of them are mutated. During this mutation, fi is sampled randomly from a uniform distribution on [0.1, 1] while pi is drawn from a uniform distribution on [0, 1]. These new values are then used in the computation of the next iteration. 5.2.3 Ant Colony Optimization Ant Colony Optimization (ACO) is a swarm based discrete optimization tech- nique based on the collective movements of ants searching for food using pheromones 15 [8]. It is used to find good solutions to combinatorial optimization problems and has been applied favorably to the Traveling Salesman Problem [7], the Multidi- mensional Knapsack Problem [17] and the construction of minimum spanning trees [23]. For each iteration every ant walks a path (a set of edges) which represents a solution to the discrete problem to be optimized. The ant leaves a trail of pheromones in the path to signal how good the solution (or food source, in the case of actual ants) is. When other ants chose their paths they are more likely to walk along an edge where the pheromones signal good solutions. Given N nodes with fully connected edges between them, where all the ants start at node 0 with the objective of getting to an end node in such a way that minimizes an arbitrary function f, the ants leave pheromones in the edges be- tween these nodes. The construction of paths is random, where the probability distribution is determined by the pheromones. The precise nature of the of this distribution varies depending on the type of ACO [8], in this study the min-max version is used. The min-max version of ACO finds the minimum fitness fmin and maximum fitness fmax of all paths that were traversed during an iteration. An intermedi- ate value ci is calculated by linearly mapping the fitness fi of an ant between 0 and 1, where fmin maps to 0 and fmax maps to 1. The ci value is calculated for every path. The intensity of the pheromones created each iteration between two arbitrary nodes is proportional to the sum of all c values who’s path traversed the edge between these nodes. When a new ant has to decide which edge to traverse next, the probability of each edge is proportional to its pheromone level. The pheromones from the previous iterations linger into the subsequent iter- ations according to the formula M p =(1 ↵)p + ↵ c /M i+1 i i i=0 X where piis the intensity of the pheromone at iteration i, ↵ is the rate at which the pheromones diminish due to evaporation and M is the number of ants. The rough outline of the ACO is defined below: Set parameters; Initialize pheromone trails; while termination conditions not met do ConstructAntSolutions; ApplyLocalSearch (optional); UpdatePheromones; end Algorithm 1: Rought outline of the Ant Colony Optimization. 16 5.3 Root Finders Root finders are algorithms used to find the solution to f(x) = 0 for complex and sometimes multi-dimensional functions. In this study they will only be used for finding a solution to Lambert’s problem, but this will prove to be a bottleneck. It is therefore of utmost importance that these are as e cient as possible. 5.3.1 Newton-Raphson Newton-Raphson is perhaps the most known root finder algorithm. Given a function f(x), which could be either a scalar or vector function Newton- Raphson’s method finds an approximation to the root. The function f(x) must be di↵erentiable. A linear approximation of the function at point x⇤ is f(x) f 0(x⇤)(x x⇤)+f(x⇤) ⇡ thus giving an approximate root f 0(x⇤)(x x⇤)+f(x⇤)=0 f(x⇤) x x⇤ = f 0(x⇤) f(x⇤) x = x⇤ f 0(x⇤) Using an initial guess x0 it is then simple to iteratively use these tangential approximations to improve the root approximation by f(xi) xi+1 = xi f 0(xi) 5.3.2 Halley’s Method Halley’s method work on the same principle as Newton-Raphson; it also uses a point-based approximation in order to iteratively improve the root approxima- tion. The di↵erence is that Halley’s method uses a rational linear-over-linear function approximation instead of a linear one. A linear-over-linear function is defined as ↵ + x + x for some ↵, , , R. 2 Using the same procedure as Newton-Raphson’s method Halley’s method is defined by 2f(x )f (x ) x = x i 0 i i+1 i 2f (x)2 f(x )f (x ) 0 i 00 i Note that for small values the second derivative the formula approximates Newton-Raphson’s method rather well. 17 5.3.3 Ad Hoc Root Finder An equation that shows up in section 4.1.2 is 1 1 g(x) = arccos + arccos =0 x/↵ 1 x/ 1 where ↵, < 0 and 0 <