# Three-Dimensional Guidance Laws for Spacecraft Propelled by a SWIFT Propulsion System
## 3 Optimal Guidance Laws
### Spacecraft Dynamics in Terms of Variation of the [PERSON]'s Modified Equinoctial Orbital Elements  
The use of nonsingular orbital elements [35] is a common choice in the design and optimization of the spacecraft transfer trajectory both in a heliocentric and in a planetocentric scenario [36; 37]. In this context, we describe the spacecraft dynamics in terms of the six equinoctial elements \(\{p,f,g,h,k,L\}\) proposed by [PERSON] et al. [25]. In particular, the geometric interpretation of the Walker's elements, together with the calculation of both the classical orbital elements and the Cartesian state vector components, are summarized in the last part of Ref. [38]. From the spacecraft dynamics point of view and using the nomenclature described in a recent author's work [39], the EoMs in the heliocentric mission scenario are given by the following (vector) nonlinear differential equation:  
\[\left[\hat{p},\,\hat{f},\,\hat{g},\,\hat{h},\,\hat{k},\,L\right]^{\mathrm{ T}}=\mathbb{M}\,\mathbf{a}+\left[0,\,0,\,0,\,0,\,\sqrt{\mu_{\odot}\,p}\left(\frac{1+f \,\cos L+g\,\sin L}{p}\right)^{2}\right]^{\mathrm{ T}} \tag{33}\]  
where the components of the vector \(\mathbf{a}\) are expressed in the RTN reference frame illustrated in Section 2, that is, \(\mathbf{a}=[a_{\mathrm{R}},\,a_{\mathrm{T}},\,a_{\mathrm{N}}]^{\mathrm{ T}}\), while \(\mathbb{M}\in\mathbb{R}^{6\times 3}\) is a matrix defined as [40]  
\[\mathbb{M}\triangleq \begin{bmatrix}0&\frac{2\,p}{1+f\,\cos L+g\,\sin L}\,\sqrt {\frac{p}{H_{\odot}}}&0\\ \sin L\,\sqrt{\frac{p}{H_{\odot}}}&\frac{(2+f\,\cos L+g\,\sin L)\,\cos L+f}{1+f \,\cos L+g\,\sin L}\,\sqrt{\frac{p}{H_{\odot}}}&-\frac{g\,(h\,\sin L-k\,\cos L )}{1+f\,\cos L+g\,\sin L}\,\sqrt{\frac{p}{H_{\odot}}}\\ -\,\cos L\,\sqrt{\frac{p}{H_{\odot}}}&\frac{(2+f\,\cos L+g\,\sin L)\,\sin L+g}{1 +f\,\cos L+g\,\sin L}\,\sqrt{\frac{p}{H_{\odot}}}&\frac{f\,(h\,\sin L-k\,\cos L )}{1+f\,\cos L+g\,\sin L}\,\sqrt{\frac{p}{H_{\odot}}}\\ 0&0&\frac{\left(1+h^{2}+k^{2}\right)\,\cos L}{2\,(1+f\,\cos L+g\,\sin L)}\, \sqrt{\frac{p}{H_{\odot}}}\\ 0&0&\frac{\left(1+h^{2}+k^{2}\right)\,\sin L}{2\,(1+f\,\cos L+g\,\sin L)}\, \sqrt{\frac{p}{H_{\odot}}}\\ 0&0&\frac{h\,\sin L-k\,\cos L}{1+f\,\cos L+g\,\sin L}\,\sqrt{\frac{p}{H_{ \odot}}}\end{bmatrix}  \tag{34}\]In this scenario, the (scalar) Hamiltonian function \(\mathcal{H}\) can be easily expressed by introducing the six costates \(\{\lambda_{p},\lambda_{f},\lambda_{g},\lambda_{h},\lambda_{k},\lambda_{L}\}\) so that, taking Equations (33) and (34) into account, one has  
\[\mathcal{H}= \begin{bmatrix}\lambda_{p},\,\lambda_{f},\,\lambda_{g},\,\lambda_{h},\,\lambda_{k},\,\lambda_{L}\end{bmatrix}\begin{bmatrix}\hat{p}\\ \hat{g}\\ \hat{h}\\ k\\ L\end{bmatrix} \equiv \begin{bmatrix}\lambda_{p},\,\lambda_{f},\,\lambda_{g}, \,\lambda_{h},\,\lambda_{k},\,\lambda_{L}\end{bmatrix} (\mathbb{M}\,\mathbf{a})+ \lambda_{L}\,\sqrt{\mu_{\odot}\,p}\,\bigg{(}\frac{1+f\,\cos L+g\,\sin L}{p} \bigg{)}^{2} \tag{35}\]  
According to the previous equation, the part \(\mathcal{H}_{c}\) of the Hamiltonian function can be obtained by introducing the auxiliary vector \(\mathbf{\lambda}_{W}\in\mathbb{R}^{3}\) defined as  
\[\mathbf{\lambda}_{W}\triangleq\mathbb{M}^{\mathrm{ T}} \begin{bmatrix}\lambda_{p}\\ \lambda_{f}\\ \lambda_{g}\\ \lambda_{h}\\ \lambda_{k}\\ \lambda_{L}\end{bmatrix}  \tag{36}\]  
with  
\[\lambda_{W}\triangleq\|\mathbf{\lambda}_{W}\|\qquad\text{and}\qquad\mathbf{\lambda} _{W}=\frac{\mathbf{\lambda}_{W}}{\lambda_{W}} \tag{37}\]  
In particular, the expressions of the components of \(\mathbf{\lambda}_{W}\) in the RTN reference frame are  
\[\mathbf{\lambda}_{W}= \begin{bmatrix}M_{21}\,\lambda_{f}+M_{31}\,\lambda_{g}\\ M_{22}\,\lambda_{f}+M_{32}\,\lambda_{g}+M_{12}\,\lambda_{p}\\ M_{63}\,\lambda_{L}+M_{23}\,\lambda_{f}+M_{33}\,\lambda_{g}+M_{43}\,\lambda_{h }+M_{53}\,\lambda_{k}\end{bmatrix}  \tag{38}\]  
where \(M_{ij}\) is the entry of matrix \(\mathbb{M}\) at the \(i\)th row and \(j\)th column.