# Three-Dimensional Guidance Laws for Spacecraft Propelled by a SWIFT Propulsion System
## 3 Optimal Guidance Laws
### Spacecraft State in Terms of Cartesian Components of Position and Velocity Vector  
Consider the typical case in which the spacecraft state is defined in terms of the three scalar components of the position vector \(\mathbf{r}=[r_{x},r_{y},r_{z}]^{\tau}\) and the three scalar components of the velocity vector \(\mathbf{v}=[v_{x},v_{y},v_{z}]^{\tau}\) in a Cartesian, heliocentric ecliptic, 3D, right-handed, reference frame \(\mathcal{T}_{\mathbb{C}}(O;x,y,z)\). The latter reference frame, which is accurately described in Section 2.2.1 of Ref. [26], is sketched in Figure 6, where the origin \(O\) coincides with the Sun's center of mass. In this case, the vector form of the SWIFT-propelled spacecraft equations of motion (EoMs) is given by  
\[\dot{\mathbf{r}} =\mathbf{v} \tag{17}\] \[\dot{\mathbf{v}} =-\Big{(}\frac{\mathbf{h}_{\odot}}{r^{3}}\Big{)}\mathbf{r}+\mathbf{a} \tag{18}\]  
Figure 6: SWIFT-propelled spacecraft in a Cartesian, heliocentric ecliptic, reference frame \(\mathcal{T}_{\mathbb{C}}(O;x,y,z)\). where \(\mu_{\odot}\) is the gravitational parameter of the Sun, and \(\mathbf{a}\) is the propulsive acceleration vector given by Equation (3) as a function of both the propulsion system design characteristics \(\{a_{c},K\}\) and the control (vector) term \(\mathbf{\hat{t}}\). Introducing the vector adjoint to the position \(\mathbf{\lambda}_{r}\in\mathbb{R}^{3}\) and the vector adjoint to the velocity \(\mathbf{\lambda}_{v}\in\mathbb{R}^{3}\), the Hamiltonian function \(\mathcal{H}\in\mathbb{R}\) is  
\[\mathcal{H}=\mathbf{\lambda}_{r}\cdot\mathbf{v}-\left(\frac{\mu_{\odot}}{r^{3}} \right)\mathbf{\lambda}_{v}\cdot\mathbf{v}+\mathbf{\lambda}_{v}\cdot\mathbf{a} \tag{19}\]  
Taking the SWIFT thrust vector model into account and rewriting the Lawden's primer vector \(\mathbf{\lambda}_{v}\)(28; 29; 30; 31) as  
\[\mathbf{\lambda}_{v}=\lambda_{v}\mathbf{\hat{\lambda}}_{v} \tag{20}\]  
with \(\lambda_{v}\triangleq\|\mathbf{\lambda}_{v}\|\
eq 0\) and \(\mathbf{\hat{\lambda}}_{v}\triangleq\mathbf{\lambda}_{v}/\lambda_{v}\), it is possible to enucleate the part of \(\mathcal{H}\) which explicitly depends on \(\mathbf{a}\), i.e., on the control term. In fact, substituting Equation (20) into Equation (19), one obtains the scalar function \(\mathcal{H}_{c}\), which coincides with the part of \(\mathcal{H}\) that depends on vector \(\mathbf{a}\), as  
\[\mathcal{H}_{c}=\mathbf{a}\cdot\mathbf{\hat{\lambda}}_{v} \tag{21}\]  
According to [PERSON]. [(23; 24)], the control term \(\mathbf{\hat{t}}\) is selected to maximize, at any time instant, the value of \(\mathcal{H}\). Bearing in mind that \(\mathbf{\hat{t}}\) appears in the expression of \(\mathbf{a}\) given by Equation (3), the [PERSON]'s maximum principle is more conveniently applied to the (reduced) function \(\mathcal{H}_{c}\) defined in Equation (21). In this case, comparing Equation (21) with (10), one concludes that \(\mathcal{H}_{c}\) substantially coincides with \(P\) if the unit vector \(\mathbf{\hat{d}}\) is formally substituted by the unit vector \(\mathbf{\hat{\lambda}}_{v}\). Therefore, the optimal control law, i.e., the value of \(\mathbf{\hat{t}}\) that maximizes \(\mathcal{H}\) (or, equivalently, \(\mathcal{H}_{c}\)), is directly obtained from Equations (14) and (15) as a function of the adjoint unit vector \(\mathbf{\hat{\lambda}}_{v}\) as  
\[\mathbf{\hat{t}}^{*}= \begin{cases}\mathbf{\hat{\lambda}}_{v}&\text{if}\quad\alpha_{ \lambda_{v}}\leq\alpha_{\max}\\ \dfrac{\sin(\alpha_{\lambda_{v}}-\alpha_{\max})}{\sin\alpha_{\lambda_{v}}}\, \mathbf{\hat{r}}+\dfrac{\sin\alpha_{\max}}{\sin\alpha_{\lambda_{v}}}\,\mathbf{\hat{ \lambda}}_{v}&\text{if}\quad\alpha_{\lambda_{v}}\in(\alpha_{\max},\,180\,\text {deg})\end{cases}