1 Introduction

For many decades, scientists and engineers have shown interest in low-thrust trajectory optimization for its potential for future space exploration following successful missions such as the Deep Space 1 [1] and HAYABUSA [2]. The low-thrust propulsion system can help to satisfy challenging requirements in deep-space missions that traditional chemical propulsion systems cannot fulfill. It is flexible, efficient, and reliable due to its unlimited on/off switching capability and long operation duration. Its high specific impulse can increase the payload to mass ratio, bringing valuable science mass back to Earth.

One can categorize the solution methodologies for low-thrust trajectory optimization problems into three types: direct, indirect, and hybrid. A direct method [3,4,5,6] transforms a continuous optimal control problem into a parameter optimization problem (nonlinear optimization) under various constraints and boundary conditions. The direct optimization method is suitable for trajectories that do not include many revolutions (e.g., ascend and descent trajectory optimizations [7]). An indirect optimization method formulates a two-point boundary value problem based on the Euler–Lagrange equation and finds the necessary optimality condition [8,9,10]. A hybrid optimization method utilizes multiple approaches such as the indirect method, and direct method, and other heuristic methods (e.g., multi-objective hybrid optimal control [11], genetic algorithm [12], and particle swarm optimization [13]). The hybrid optimization method is suitable for generating multiple short trajectory segments (e.g., direct gravity assist trajectory, rendezvous sequence).

This study adopts the indirect method to optimize the low-thrust trajectory. The most fundamental method to perform trajectory optimization began from the primer vector theory or indirect optimization. Lion and Handelsman [14] proposed the fundamental algorithm behind solving the fixed-final time impulsive thrust trajectory optimization using the primer vector theory. Russell [8] developed an algorithm to apply the primer vector theory in the continuous-low-thrust trajectory optimization using Pontryagin’s minimum principle to sequentially determine the switching times of the thrusting and coasting arcs. Such algorithms were further applied to the circular-restricted three-body problem [15] and even to multi-body environments involving near-Earth objects.

However, there is a common drawback in these low-thrust trajectory optimization algorithms. The highly nonlinear dynamics and the long flight time with the minute thrust acceleration may cause difficulty in finding a solution that converges to a global optimum. A homotopy-based optimization approach has been studied to overcome these challenges. The term homotopy in topology represents the relationship between two functions. The homotopic condition indicates a continuous transformation between different shapes, interpreted as the transformation between different trajectories complying with given dynamic equations in this study.

The homotopic approach can solve the low-thrust trajectory optimization problem without an overly complicated search process or initial guesses. Haberkorn et al. [16] first applied the homotopy approach to obtaining the minimum-fuel low-thrust trajectory from GTO to GEO. Jiang et al. [17] further developed the homotopic algorithm to solve a final time-fixed low-thrust trajectory optimization problem involving the gravity assist. Guo et al. [18] combined the indirect homotopy approach and the pseudospectral method to solve the trajectory optimization. Their procedure adopts the initial Lagrange multiplier estimation using the Karush–Kuhn–Tucker (KKT) condition. Sullo et al. [19] solved a solar-sail trajectory optimization problem using the homotopy approach. They obtained the full three-dimensional ion-thruster trajectory based on the two-dimensional optimization results.

Previous homotopy-based trajectory optimization focuses on finding a trajectory with a given (fixed) flight time—without explicitly matching the initial acceleration level. Also, the order of magnitude of the thrust accelerations applied to the spacecraft in these case studies is not at the realistic level (order of magnitude: 10–3 m/s2 or higher) [16,17,18,19]. Previous missions (e.g., Deep Space, Hyabusa, Dawn, and Lunar Ice-Cube) were equipped with electric thrusting systems capable of providing initial thrust acceleration (order of magnitude: 10–5 m/s2). This study proposes a homotopy-based algorithm that can generate a spacecraft-tailored trajectory utilizing both fixed- and free-final time problems formulated as the two-point boundary value problems (TPBVP). Introducing the free-final time with the transversality condition provides flexibility to flight parameters (e.g., initial thrust acceleration), yielding various solutions that abide by the specific spacecraft hardware specifications, such as spacecraft mass and initial thrust acceleration capabilities.

Section 2 discusses the mathematical formulation (TPVBP) for free-/fixed-final time low-thrust trajectory optimization problems. Section 3 proposes a homotopy-based algorithm to solve the trajectory optimization problems and generate final-time-free solutions with a specified initial acceleration. Section 4 presents a case study (transfer trajectory designs from the Earth to Mars and a hazardous asteroid) to validate the proposed approach. Finally, Sect. 5 provides the conclusions of the study and discusses potential future study subjects.

2 Two-Point Boundary Value Problem Formulation

The dynamic equations describing the motion of the spacecraft in a spherical coordinate system are presented using seven state variables as follows

$$ {\dot{\mathbf{x}}} = \left[ {\begin{array}{*{20}c} {\dot{r}} \\ {\dot{\theta }} \\ {\dot{\phi }} \\ {\dot{V}_{{\text{r}}} } \\ {\dot{V}_{\theta } } \\ {\dot{V}_{\phi } } \\ {\dot{a}_{{\text{T}}} } \\ \end{array} } \right] = {\mathbf{f}}({\mathbf{x}},{\mathbf{u}}) = \left[ {\begin{array}{*{20}c} {V_{{\text{r}}} } \\ {\frac{{V_{\theta } }}{r}} \\ {\frac{{V_{\phi } }}{r\sin \theta }} \\ {\frac{{V_{\theta }^{2} }}{r} + \frac{{V_{\theta }^{2} }}{r} - \frac{\mu }{{r^{2} }} + a_{{\text{T}}} \sin \alpha \cos \beta } \\ {\frac{{V_{\phi }^{2} }}{r\tan \theta } - \frac{{V_{\theta } V_{{\text{r}}} }}{r} - a_{{\text{T}}} \sin \beta } \\ { - \frac{{V_{\phi } V_{\theta } }}{r\tan \theta } - \frac{{V_{r} V_{\theta } }}{r} + a_{{\text{T}}} \cos \alpha \cos \beta } \\ {\frac{{a_{{\text{T}}}^{2} }}{{I_{{{\text{sp}}}} g_{{\text{o}}} }}} \\ \end{array} } \right]. $$
(1)

Note that the expression presented in Eq. (1) assumes the central gravitational field. In the equation, r (\(= \left[ {r,\theta ,\phi } \right]\)) and v (\(= \left[ {V_{{\text{r}}} ,V_{\theta } ,V_{\phi } } \right]\)) represent the position and velocity vectors, and aT is the thrust acceleration acting upon the spacecraft. The control variable vector \({\mathbf{u}}( = \left[ {\alpha ,\beta } \right]^{{\text{T}}} )\) comprises the in-plane (\(\alpha\)) and out-of-plane (\(\beta\)) thrust pointing angles. Figure 1 presents the coordinate system and definitions of the state and control variables used for the dynamic equations. Note that units of length and time used in this study are AU and TU, making the numerical value of \(\mu\) (gravitational parameter of the Sun) as unity.

Fig. 1
figure 1

Definition of coordinate system and control angles for describing the spacecraft dynamics

The trajectory optimization problem, or equivalently the optimal control problem, aims to find the state and control histories that minimize the performance index. In this study, the performance index minimizes the terminal thrust acceleration (aT(tf)), which is equivalent to maximizing the terminal spacecraft mass (m(tf)). The Bolza-form expression of the performance index is as follows

$$ \min J = \phi \left( {{\mathbf{x}}_{{\text{f}}} ,t_{{\text{f}}} } \right) + \int_{{t_{{\text{o}}} }}^{{t_{{\text{f}}} }} {L({\mathbf{x}},{\mathbf{u}},t){\text{d}}t} = a_{{\text{T}}} \left( {t_{{\text{f}}} } \right). $$
(2)

In Eq. (2), \(\phi ({\mathbf{x}}_{{\text{f}}} ,t_{{\text{f}}} )\;( = a_{{\text{T}}} (t_{{\text{f}}} ))\) is the terminal cost and \(L({\mathbf{x}},{\mathbf{u}},t)\;( = 0)\) is the Lagrangian. Then we impose the terminal constraint (\({{\varvec{\Psi}}}({\mathbf{x}}_{{\text{f}}} ,t_{{\text{f}}} ) = {\mathbf{0}}\)) and the dynamic constraint (\({\dot{\mathbf{x}}} - {\mathbf{f}}({\mathbf{x}},{\mathbf{u}}) = {\mathbf{0}}\)) to obtain the following equation.

$$ \min J = \phi \left( {{\mathbf{x}}_{{\text{f}}} ,t_{{\text{f}}} } \right) + {{\varvec{\upnu}}}^{T} {{\varvec{\Psi}}}\left( {{\mathbf{x}}_{{\text{f}}} ,t_{{\text{f}}} } \right) + \int_{{t_{{\text{o}}} }}^{{t_{{\text{f}}} }} {\{ L\left( {{\mathbf{x}},{\mathbf{u}},t} \right) + {{\varvec{\uplambda}}}^{{\text{T}}} ({\mathbf{f}}({\mathbf{x}},{\mathbf{u}},t) - {\dot{\mathbf{x}}})\} } {\text{d}}t. $$
(3)

In Eq. (3), \({{\varvec{\upnu}}}\) and \({{\varvec{\uplambda}}}\) are the Lagrange multiplier vectors associated with the terminal and dynamic constraints, respectively. This equation is further modified as

$$ \min J = \Phi \left( {{\mathbf{x}}_{{\text{f}}} ,t_{{\text{f}}} } \right) + \int_{{t_{0} }}^{{t_{{\text{f}}} }} {H\left( {{\mathbf{x}},{\mathbf{u}},t} \right) - {{\varvec{\uplambda}}}^{{\text{T}}} {\dot{\mathbf{x}}}\left( {{\mathbf{x}},{\mathbf{u}},t} \right){\text{d}}t} , $$
(4)

where \(\Phi\) and H (Hamiltonian) are defined as

$$ \Phi \left( {{\mathbf{x}}_{{\text{f}}} ,t_{{\text{f}}} } \right) \equiv \phi \left( {{\mathbf{x}}_{{\text{f}}} ,t_{{\text{f}}} } \right) + {{\varvec{\upnu}}}^{{\text{T}}} {{\varvec{\Psi}}}\left( {{\mathbf{x}}_{{\text{f}}} ,t_{{\text{f}}} } \right), $$
(5)
$$ H \equiv L\left( {{\mathbf{x}},{\mathbf{u}},t} \right) + {{\varvec{\uplambda}}}^{{\text{T}}} {\dot{\mathbf{x}}}\left( {{\mathbf{x}},{\mathbf{u}},t} \right). $$
(6)

A total derivative of Eq. (4) is expressed as

$$ {\text{d}}J = \left( {\frac{\partial \Phi }{{\partial {\mathbf{x}}}} - {{\varvec{\uplambda}}}^{{\text{T}}} } \right){\text{d}}{\mathbf{x}}_{{\text{f}}} + \left( {\frac{\partial \Phi }{{\partial t}} + H} \right){\text{d}}t_{{\text{f}}} - H{\text{d}}t_{{\text{o}}} + {{\varvec{\uplambda}}}^{{\text{T}}} {\text{d}}{\mathbf{x}}_{o} + \int_{{t_{{\text{o}}} }}^{{t_{{\text{f}}} }} {\left\{ {\left[ {\frac{\partial H}{{\partial {\mathbf{x}}}} + {\dot{\boldsymbol{\lambda }}}^{{\text{T}}} } \right]\delta {\mathbf{x}} + \left[ {\frac{\partial H}{{\partial {\mathbf{u}}}}\delta {\mathbf{u}}} \right]} \right\}{\text{d}}t} . $$
(7)

For the solution to be optimal, the differential cost presented in Eq. (7) must be zero, leading to the following Euler–Lagrange equations for the co-state vector (\({\dot{\boldsymbol{\lambda }}} = - (\partial H/\partial {\mathbf{x}})^{{\text{T}}}\)) and the optimality condition for the control vector (\(\partial H/\partial {\mathbf{u}} = {\mathbf{0}}\)) as follows:

$$ {\dot{\boldsymbol{\lambda }}} = - \left( {\frac{\partial H}{{\partial {\mathbf{x}}}}} \right)^{{\text{T}}} = \left[ {\begin{array}{*{20}c} {\frac{1}{{r^{2} }}\left( {\lambda_{\theta } V_{\theta } + \lambda_{{V_{{\text{r}}} }} \left( {V_{\phi }^{2} + V_{\theta }^{2} } \right) - \lambda_{{V_{\theta } }} V_{\theta } V_{{\text{r}}} - \lambda_{{V_{\phi } }} V_{{\text{r}}} V_{\phi } } \right) + \frac{1}{{r^{2} \sin \theta }}\left( {\lambda_{\phi } V_{\phi } + \lambda_{{V_{\theta } }} V_{\phi }^{2} \cos \theta - \lambda_{\phi } V_{\phi } V_{\theta } \cos \theta } \right) - \frac{2\mu }{{r^{3} }}} \\ {\frac{1}{r\sin \theta }\left( {\lambda_{\phi } V_{\phi } \cos \theta + \lambda_{{V_{\theta } }} V_{\phi }^{2} - \lambda_{{V_{\phi } }} V_{\phi } V_{\theta } } \right)} \\ 0 \\ { - \lambda_{{\text{r}}} + \lambda_{{V_{\theta } }} \left( {\frac{{V_{\theta } }}{r}} \right) + \lambda_{{V_{\theta } }} \left( {\frac{{V_{\phi } }}{r}} \right)} \\ {\frac{1}{r}\left( { - \lambda_{\theta } - 2\lambda_{{V_{{\text{r}}} }} V_{\theta } + \lambda_{{V_{\theta } }} V_{{\text{r}}} + \lambda_{{V_{\phi } }} \frac{{V_{\phi } }}{\tan \theta }} \right)} \\ {\frac{1}{r}\left( { - 2\lambda_{{V_{{\text{r}}} }} V_{\phi } + \lambda_{{V_{\phi } }} V_{{\text{r}}} } \right) - \frac{1}{r\sin \theta }\left( {\lambda_{\phi } + 2\lambda_{{V_{\phi } }} V_{\theta } \cos \theta - \lambda_{{V_{\phi } }} V_{\theta } \cos \theta } \right)} \\ {\lambda_{{V_{{\text{r}}} }} \cos \beta \sin \alpha + \lambda_{{V_{\theta } }} \sin \beta - \lambda_{{V_{\phi } }} \cos \alpha \cos \beta - \lambda_{{a_{{\text{T}}} }} \left( {\frac{{2a_{{\text{T}}} }}{{I_{{{\text{sp}}}} g_{{\text{o}}} }}} \right)} \\ \end{array} } \right], $$
(8)
$$ \alpha = \arctan \left( {\frac{{ - \lambda_{{V_{{\text{r}}} }} }}{{ - \lambda_{{V_{\phi } }} }}} \right), $$
(9)
$$ \beta = \arctan \left( {\frac{{\lambda_{{V_{\theta } }} }}{{ - \lambda_{{V_{{\text{r}}} }} \sin \alpha - \lambda_{{V_{\theta } }} \cos \alpha }}} \right). $$
(10)

We can obtain the boundary conditions to determine the solution of the TPBVP from Eq. (7), presented in Table 1.

Table 1 Boundary conditions for TPBVP

This paper focuses on free-final time problems, whose formulations and boundary conditions are further discussed in the next subsections.

2.1 Free Final-Time TPBVP Formulation

We transform the free-final-time TPBVP described in Eq. (4) into a fixed-final time formulation by introducing a final time parameter (\(t_{{\text{f}}}\)) and a normalized time (\(\tau \equiv t/t_{{\text{f}}} \in [0,1][0,1]\)) as follows

$$ \min J = \Phi \left( {{\mathbf{x}}_{{\text{f}}} ,t_{{\text{f}}} } \right) + t_{{\text{f}}} \int_{0}^{1} {H\left( {{\mathbf{x}}\left( \tau \right),{\mathbf{u}}\left( \tau \right),\tau } \right) - {{\varvec{\uplambda}}}^{{\text{T}}} {\dot{\mathbf{x}}}\left( {{\mathbf{x}}\left( \tau \right),{\mathbf{u}}\left( \tau \right),\tau } \right){\text{d}}\tau } . $$
(11)

Note that the problem becomes easier to handle by this conversion because the integral interval of the normalized time is fixed. Then the differential equation for the co-state vector (Eq. 8) is modified as

$$ {\dot{\boldsymbol{\lambda }}}(t) = - \frac{{\partial H\left( {{\mathbf{x}}\left( \tau \right),{\mathbf{u}}\left( \tau \right),\tau } \right)}}{{\partial {\mathbf{x}}}} \cdot t_{{\text{f}}} . $$
(12)

The total derivative expressed in Eq. (7) provides the necessary boundary conditions for the final-time-free TPBVP. Equation (12) indicates the use \(\tau\) and \(t_{{\text{f}}}\) to express the time in an optimized time unit. The number of necessary boundary conditions for solving the TPBVP now becomes 15 since each of seven state variables (x) requires two and the free parameter (\(\tau\)) requires one.

2.2 Boundary Conditions

The final-time-free low-thrust trajectory with a specified initial acceleration obtained using the proposed algorithm requires three sets of initial and final boundary conditions associated with the following design loops: (1) Energy/Acceleration Matching Loop, (2) Orbit Reshaping Loop, and (3) Rendezvous Loop. The Energy/Acceleration Matching Loop alters the mission’s final time while changing the semi-major axis (or the orbital energy) of the initial and final states. The desired final classical orbital elements and the initial thrust acceleration are specified in this loop. The Orbit Reshaping Loop changes the orbital shapes defined by the initial and final states. Finally, The Rendezvous Loop matches the arrival position of the final orbit. Table 2 lists the boundary conditions associated with these loops.

Table 2 Initial and final boundary conditions

The user inputs associated with the initial orbit parameters determine the initial position and velocity. The initial thrust acceleration is free (\(\lambda_{{a_{T} }} \left( 0 \right) = 0\)) during the Energy/Acceleration Matching Loop but fixed afterward, characterizing the propulsion system for the spacecraft. The flight time (fixed within the step) increases until the optimized initial thrust acceleration matches with \(a_{{{\text{T}},{\text{d}}}}\) during this step. Note that the terminal cost and the terminal boundary conditions described in Eq. (5) are independent of time. Therefore, the transversality condition forces the Hamiltonian at the terminal time to be zero (\(H\left( {t_{{\text{f}}} } \right) = - \partial \Phi /\partial t_{{\text{f}}} = 0\)). The orbital reshaping loop sets the arrival true anomaly value as free (\(\lambda_{\phi } \left( {t_{{\text{f}}} } \right) = 0\)). When the arrival state of the spacecraft matches with the target orbit condition, we begin the rendezvous loop where the true anomaly at arrival is fixed. Assuming that the departure orbit is circular, the initial departure location is free (\(\lambda_{\phi } \left( 0 \right) = 0\)), which minimizes the final thrust acceleration by altering the departure time and location.

3 Homotopy Based Optimization Algorithm

A homotopy-based trajectory optimization algorithm addresses a complex problem by sequentially constructing and solving easier but related problems. The proposed algorithm consists of three elements: (1) user inputs, (2) preliminary calculations, and (3) the homotopy-based optimization loop. Figure 2 shows the proposed homotopy-based approach to calculate a final-time-free low-thrust trajectory with a specified initial acceleration.

Fig. 2
figure 2

Proposed homotopy-based optimization procedure for complex low-thrust trajectory design

3.1 User Input and Preliminary Calculation

The first step of the algorithm begins by creating user inputs based on the target mission. The user inputs are the spacecraft mass (\(m_{{{\text{sat}}}}\)), the thrust (\(T\)), the specific impulse (\(I_{{{\text{sp}}}}\)), and the desired initial (i)/final (f) orbital elements (p) for the problems at the beginning (B) and the end (E) of the outer homotopy loop (\({\mathbf{p}}_{{\text{i}}}^{{\text{B}}} ,{\mathbf{p}}_{{\text{f}}}^{{\text{B}}} ,{\mathbf{p}}_{{\text{i}}}^{{\text{E}}} ,{\mathbf{p}}_{{\text{f}}}^{{\text{E}}}\)). This study uses the classical six elements (p = \([a,e,i,\Omega ,\omega ,\theta ]\)) to represent the initial/final orbital parameters. Then we determine the desired initial thrust acceleration (\(a_{{{\text{T}},{\text{d}}}}\)) and its time derivative (\(\dot{a}_{{\text{T}}}\)) as follows:

$$ a_{{{\text{T}},{\text{d}}}} = \frac{T}{{m_{{{\text{sat}}}} }}, $$
(13)
$$ \dot{a}_{{\text{T}}} = \frac{{a_{{\text{T}}}^{2} }}{{I_{{{\text{sp}}}} \cdot g_{{\text{o}}} }}. $$
(14)

Equation (14) is integrated to yield the final thrust acceleration, which determines the final spacecraft mass.

The homotopy-based algorithm matches the desired initial thrust acceleration and its time derivative to generate an optimal trajectory for a given spacecraft. The next step determines the orbital element change sequence. The optimizer modifies the trajectory at each sequence segment to satisfy the orbital element constraint at the initial/final time. Figure 3 presents a sample optimization sequence using the homotopy-based approach. The optimization sequence was generated with linear increments from (\({\mathbf{p}}_{{\text{i}}}^{{\text{B}}} ,{\mathbf{p}}_{{\text{i}}}^{{\text{E}}}\)) to (\({\mathbf{p}}_{{\text{f}}}^{{\text{B}}} ,{\mathbf{p}}_{{\text{f}}}^{{\text{E}}}\)). The black dash and red dash lines represent the initial and desired orbits, respectively. The proposed algorithm solves a series of TPBVPs while changing the boundary conditions. It first matches the semi-major axis (plotted in black), then the inclination (plotted in blue), and finally the eccentricity (plotted in red). The initial problem is a simple co-planar, circular to circular low-thrust orbital transfer trajectory optimization. The final TPBVP is a complicated rendezvous trajectory optimization problem involving various orbital parameter changes. While a small orbital parameter change between the adjacent segments of the optimization sequence improves the convergence property, it may result in a high computational cost. Therefore, the proposed algorithm adopts a sensitivity reduction loop to address the challenge of selecting the proper parameter change value between segments (will be discussed later).

Fig. 3
figure 3

Optimization sequence: homotopy-based approach

The algorithm also requires a preliminary solution, an orbital transfer trajectory involving the orbital parameter change (\({\mathbf{p}}_{{\text{i}}}^{{\text{B}}} \to {\mathbf{p}}_{{\text{i}}}^{{\text{E}}}\)). Figure 4 presents an example of the initial guess trajectory obtained using a simple shooting method with various initial thrust acceleration values. The Lagrange multiplier history associated with each trajectory is obtained by guessing/updating its value at the final time and integrating backward. The initial states of the Lagrange multipliers for the simple shooting method are trivial and is set to zero. The inner-loop optimization routine solves the fixed-final time TPBVP using the stored trajectory and guessed Lagrange multiplier history to minimize the final thrust acceleration. The homotopic optimization loop (outer loop) uses the inner-loop result as the preliminary solution (\({\mathbf{x}}^{\left( 0 \right)} ,{{\varvec{\uplambda}}}^{\left( 0 \right)} ,{\mathbf{t}}^{\left( 0 \right)}\)).

Fig. 4
figure 4

Initial guess and preliminary solution trajectory (simple shooting)

3.2 Homotopic Optimization Loop

The homotopic optimization loop consists of four steps. The first step is the orbital energy matching loop. The orbital energy (E) is the function of the semi-major axis (a) expressed as

$$ E = - \frac{\mu }{2a}. $$
(15)

In addition, the loop matches the right ascension of ascending node (\(\Omega\)) together with the semi-major axis to fix the angular momentum vector after matching the inclination in the orbital reshaping loop. The optimal solution obtained in the previous optimization loop (\({\mathbf{x}}^{\left( 0 \right)} ,{{\varvec{\uplambda}}}^{\left( 0 \right)} ,{\mathbf{t}}^{\left( 0 \right)}\)) is used as the initial guess of the trajectory for the optimization problem with a new semi-major axis. The orbital energy matching loop uses the same boundary conditions as the acceleration matching loop, resulting in the free initial thrust acceleration (\(a_{{{\text{T}},{\text{d}}}}\)).

The second step (acceleration matching loop) aims to make a spacecraft-tailored optimal trajectory by determining the initial thrust acceleration (\(a_{{{\text{T}},{\text{d}}}}\)) and its derivative (\(\dot{a}_{{{\text{T}},{\text{d}}}}\)) presented in Eqs. (13) and (14). The boundary conditions shown in Table 2 indicate that aT,d decreases as tf increases, which aligns with the intuition that a smaller thrust value will require a longer transfer time. The final-time-free TPBVP is formulated by adding a free-final-time parameter (\(t_{{\text{f}}}\)) and a normalized time vector (\({{\varvec{\uptau}}}\)) to the final-time fixed problem as

$$ {{\varvec{\uptau}}} = \frac{{\mathbf{t}}}{{t_{{\text{f}}}^{{}} }}. $$
(16)

Dividing the optimal time vector by tf normalizes the time vector while keeping the mesh spacing consistent with the previous optimal states/co-states histories. We change tf until the initial and final constraints, including the boundary condition on the initial acceleration, are satisfied.

The third optimization step is the orbit reshaping loop. The orbit reshaping loop utilizes the optimization sequence created in the preliminary calculation section. The classical orbital elements change sequentially—the inclination angle (i), the argument of periapsis (\(\omega\)), and the eccentricity (e)—modifying the terminal boundary conditions (shown in Table 2) gradually until the initial and terminal orbital elements reach the desired values. The spacecraft departs from the initial orbit while the departure time is free (a decision variable). When the departure orbit is circular, the initial x–y plane angle (\(\phi_{o}\)) is free (\(\lambda_{\phi } \left( {t_{o} } \right) = 0\)), resulting in the free departure position, too. Varying the initial positions change the initial Lagrange multipliers of the optimal trajectory, hence, having a smaller convergence window than the fixed-final time TPBVP used in previous steps. A sensitivity reduction loop enlarges the convergence window. The sensitivity reduction loop decreases the difference between the terminal boundary conditions (the previous optimal solution versus the current solution) by choosing a set of new classical orbital elements. The previous optimal solution with the tighter relative/absolute tolerance has a higher probability of convergence with the chosen classical orbital elements. The new sets of classical orbital elements were generated from (\({\mathbf{p}}_{{\text{i}}}^{{\text{B}}} ,{\mathbf{p}}_{{\text{i}}}^{{\text{E}}}\)) to (\({\mathbf{p}}_{{\text{f}}}^{{\text{B}}} ,{\mathbf{p}}_{{\text{f}}}^{{\text{E}}}\)) with linear increments.

The last optimization step is the rendezvous loop that matches the true anomaly (\(\theta\)) of the spacecraft at the final time. Completion of the orbit reshaping loop places spacecraft on the orbit defined by \({\mathbf{p}}_{{\text{f}}}^{{\text{E}}}\) at the final time. However, the arrival position must be altered so that the arrival position of the spacecraft matches the target position at tf within given tolerances for the position (\(\delta_{{\text{r}}}\)) and the true anomaly (\(\Delta_{\theta }\)). The algorithm terminates when the obtained states/co-states satisfy the convergence criterion, creating the optimal solution (\({\mathbf{x}}^{*} ,{{\varvec{\uplambda}}}^{*} ,\tau^{*} ,t_{{\text{f}}}^{*}\)). Note that the multiplying optimal normalized time vector (\(\tau^{*}\)) with the optimal free-flight-time parameter (\(t_{{\text{f}}}^{*}\)) yields the optimal unnormalized time vector (\({\mathbf{t}}^{*}\)) [5]. Algorithm 1 presents the pseudocode for the homotopic optimization algorithm.

figure a

4 Case Study

We conducted a case study to demonstrate the effectiveness of the proposed homotopy-based trajectory optimization procedure. The problem is implemented with an Intel i5-8500 CPU with 16 GB of RAM using MATLAB. The TPBVP is solved using the bvp5c function in MATLAB Optimization Toolbox [4]. The tolerance value used to determine the termination of the iteration for both cases (δr) is selected as 10–6.

4.1 Case 1: Earth to Mars Trajectory

The first case study subject is an Earth to Mars continuous low-thrust trajectory optimization. The departure and arrival time for the Mars transfer trajectory is set to be free. Table 3 presents the optimization parameters (spacecraft specification and orbital element sets) for this case study.

Table 3 Optimization parameters for case 1 (earth-to-mars trajectory)

The initial guess for the departure time is Jan. 1, 2024, and the desired initial acceleration (\(a_{{{\text{T}},{\text{d}}}}\)) is 3E−5 m/s2. The arbitrary and desired initial orbits for the Earth departure are identical. Therefore, only the arrival classical orbital elements were changed homotopically from their arbitrary to desired values. A linear increment schedule is used for the optimization sequence: 0.05 AU for the semi-major axis (a), 1 degree for the right ascension of ascending node (RAAN), 2.1 TU for the flight time, 0.05 deg for the inclination angle (i), 0.05 deg for the argument of periapsis (\(\omega\)), and 0.003 for the eccentricity (e). The orbital reshaping loop changes the true anomaly at arrival to match the terminal spacecraft position with Mars. Figures 5 and 6 present the control histories and trajectories obtained during the proposed homotopy-based optimization procedure, respectively. The objective function (aT(tf)) obtained by the proposed procedure is 4.1∙10–5 m/s2, with the optimized terminal flight time (tf) of 1993 days (departure: Aug. 21, 2023) and spent propellant mass of 633 kg.

Fig. 5
figure 5

Homotopically changing control history plot for Earth–Mars transfer

Fig. 6
figure 6

Homotopically changing control history plot for Earth–Mars transfer

4.2 Case 2: Earth to (4953) 1990 MU Trajectory

The second case study deals with a trajectory from the Earth to (4953) 1990 MU, a potentially hazardous near-Earth asteroid with a relatively high impact probability. The departure time is free, with an initial guess of Jan. 1, 2024. The final (arrival) time is also free during the rendezvous step (orbit reshaping loop). This setting allows the free-flight time parameter (\(t_{{\text{f}}}\)) to converge to the optimal flight time.

The value of the desired initial acceleration (\(a_{{{\text{T}},{\text{d}}}}\)) is 9E−5 m/s2. After the acceleration matching, the orbital parameter matching procedure follows: (1) semi-major axis (a) and right ascension of ascending node (\(\Omega\)), (2) inclination (i) and argument of periapsis (\(\omega\)), (3) eccentricity (e), and (4) true anomaly (\(\theta\)). Note that the flight-time adjustment after the first optimization segment is conducted considering the initial thrust acceleration (\(a_{{{\text{T}},{\text{d}}}}\)).

Table 4 exhibits the spacecraft parameters and the initial/target orbital elements used for the second case study. Figures 7 and 8 exhibit the control variable profiles and spacecraft trajectories for Case 2, respectively.

Table 4 Optimization parameters for Case 2: Earth to (4953) 1990 MU trajectory
Fig. 7
figure 7

Control history plots for Earth-(4953) 1990 MU transfer

Fig. 8
figure 8

Homotopically changing control history plot for Earth-(4953) 1990 MU transfer

The boundary condition for the acceleration matching loop is applied during \(a\)/\(\Omega\) increment as well. Therefore, the loop assumes the fixed-final time (\(t_{{\text{f}}}\)) and obtains the free initial thrust acceleration (\(a_{{\text{T}}} \left( 0 \right)\)) to minimize the final thrust acceleration (\(a_{{\text{T}}} \left( {t_{{\text{f}}} } \right)\)). Figure 9 shows the change in the initial thrust acceleration (left y-axis) and the varying free total flight time (right y-axis) versus the homotopy-based optimization process (x-axis). The initial thrust acceleration increases during the semi-major axis changes because of increased orbital energy, requiring a larger thrust level for arriving at the target orbit within the given flight time. Similarly, the initial thrust acceleration decreases during the acceleration matching loop as the total flight time increases to minimize the final thrust acceleration (\(\lambda_{{a_{{\text{T}}} }} \left( 0 \right) = 0\)). The orbit reshaping loop solves the free-final-time problem by changing the orbital elements (i, e, \(\theta\)) to desired values and satisfying the transversality condition. As Fig. 9 indicates, the loop adjusts the departure time to help the spacecraft reach the target near the periapsis of the target orbit. Once the loop completes the orbital shaping, it then modifies the true anomaly for rendezvous. The optimal solution for the Earth to 1990 MU asteroid trajectory has converged to the objective function (final acceleration) of 2.1∙10–4 m/s2, initial departure date of Jul. 2, 2023, and total flight time of 1976 days. The arrival true anomaly has converged to 178\(^\circ \).

Fig. 9
figure 9

Change in initial thrust acceleration

4.3 Algorithm Validation

The proposed homotopy-based optimization algorithm was compared with the direct collocation method (obtained using GPOPS-II). The parameters of the collocation nodes were updated using either the SNOPT or IPOPT. Table 5 compares the optimal departure time, total flight time, final spacecraft mass, and total computation time obtained from the three algorithms. The collocation method did not converge with a single shooting trajectory due to the complexity of the problem. To compare the performance, the optimal solution obtained at the end of each proposed homotopy loop (energy matching loop, acceleration matching loop, and orbit reshaping loop) was used as the initial condition for direct optimizers. When the trajectory after the acceleration matching loop was used as the initial guess, the direct optimizers started to converge—but to a local optimum. The direct optimizers performed better using the orbital reshaping loop as the initial guess, but the converged solution is still worse than that obtained using the proposed algorithm. The direct optimizers converged to the identical solution when the fully optimized (\({\mathbf{p}}_{{\text{f}}}^{{\text{B}}}\) to \({\mathbf{p}}_{{\text{f}}}^{{\text{E}}}\)) trajectory using the homotopy algorithm was used as the initial guess. However, the homotopy algorithm obtained an optimal converged solution solely based on the initial guess generated by the single shooting method from \({\mathbf{p}}_{{\text{i}}}^{{\text{B}}}\) to \({\mathbf{p}}_{{\text{i}}}^{{\text{E}}}\), which the collocation method solver failed to converge with, showing the advantages in performance and operational simplicity (Fig. 10). Figures 11 and 12 show the optimal trajectories and control input histories obtained based on the three algorithms using the trajectory after acceleration matching as the initial guess trajectory.

Table 5 Performance comparison
Fig. 10
figure 10

Initial Guesses for SNOPT and IPOPT

Fig. 11
figure 11

Optimal trajectories for Case 2 obtained by SNOPT, IPOPT, and proposed algorithm (acceleration matching loop)

Fig. 12
figure 12

Optimal control histories for Case 2 obtained by SNOPT, IPOPT, and proposed algorithm (acceleration matching loop)

5 Conclusion

A novel homotopy-based algorithm is proposed to solve an optimal spacecraft trajectory design problem for complex interplanetary missions. The proposed algorithm solves a two-point boundary value problem with free-flight time with four homotopy optimization steps. The four steps match different flight characteristics sequentially—initial thrust accelerations and orbital elements, finally generating the optimal solution for the trajectory design problem. The proposed homotopy-based procedure addresses the challenge of convergence for complex low-thrust trajectory optimization problems. In addition, the proposed procedure can produce a low-thrust trajectory with a specified initial acceleration while setting the total flight time and the departure and arrival true anomaly free. Interplanetary trajectory optimization case studies (from Earth to Mars and from Earth to an asteroid) and comparison with other direct optimization methods demonstrate the effectiveness of the proposed method. The presented optimization algorithm could be integrated with the previous homotopic algorithm with PMP conditions to generate bang-bang solutions starting from given initial orbital elements, avoiding the challenge of solution convergence and the associated initial guess.