# Three-Dimensional Guidance Laws for Spacecraft Propelled by a SWIFT Propulsion System
## 3 Optimal Guidance Laws
### Spacecraft Dynamics in a Heliocentric Spherical Reference Frame  
Introduce a heliocentric spherical reference frame \(\mathcal{T}_{S}(O;r,\theta,\gamma)\), illustrated in Figure 7, where \(\theta\) is the azimuthal angle measured (counterclockwise) into the ecliptic plane from the direction of the \(x\) axis of the Cartesian reference frame \(\mathcal{T}_{C}\), and \(\gamma\) is the elevation angle, which gives the spacecraft angular position with respect to the ecliptic plane \((x,y)\). The unit vectors of the spherical reference frame \(\mathcal{T}_{S}\) are \(\mathbf{\hat{t}}_{r}\), \(\mathbf{\hat{t}}_{\theta}\), and \(\mathbf{\hat{t}}_{\gamma}\), that is, the radial unit vector, the transverse (or azimuthal) unit vector, and the normal unit vector, respectively. In particular, \(\mathbf{\hat{t}}_{\gamma}\) points towards the north celestial pole, the direction of \(\mathbf{\hat{t}}_{r}\) is radial (i.e., \(\mathbf{\hat{t}}_{r}\equiv\mathbf{\hat{r}}\)), and the plane \((\mathbf{\hat{t}}_{\theta},\mathbf{\hat{t}}_{\gamma})\) coincides with the local horizontal plane. In the spherical reference frame \(\mathcal{T}_{S}(O;r,\theta,\gamma)\), the components of the spacecraft state vector are \(\{r,\theta,\gamma,v_{r},v_{\theta},v_{\gamma}\}\), where \(\{v_{r},v_{\theta},v_{\gamma}\}\) are the three components of the spacecraft inertial velocity, i.e., \(\mathbf{v}=v_{r}\mathbf{i}_{r}+v_{\theta}\mathbf{i}_{\theta}+v_{\gamma}\mathbf{i}_{\gamma}\), while the position vector is simply given by \(\mathbf{r}=r\mathbf{i}_{r}\). Using the procedure detailed in Ref. [33], the six scalar EoMs of the SWIFT-propelled spacecraft are  
\[\dot{r}=v_{r}\quad,\quad\dot{\theta}=\frac{v_{\theta}}{r\,\cos\gamma}\quad, \quad\dot{\gamma}=\frac{v_{\gamma}}{r}\quad,\quad\dot{v}_{r}=\frac{v_{\theta} ^{2}+v_{\gamma}^{2}}{r}-\frac{\mu_{\odot}}{r^{2}}+\mathbf{a}\cdot\mathbf{\dot{i}}_{r} \quad,\]  
\[\dot{v}_{\theta}=\frac{v_{\theta}\,v_{\gamma}\,\tan\gamma-v_{r}\,v_{\theta}}{ r}+\mathbf{a}\cdot\mathbf{\dot{i}}_{\theta}\quad,\quad\dot{v}_{\gamma}=-\frac{v_{ \theta}^{2}\,\tan\gamma+v_{r}\,v_{\gamma}}{r}+\mathbf{a}\cdot\mathbf{\dot{i}}_{\gamma} \tag{25}\]  
where the vector \(\mathbf{a}\) is given by Equation (3). Introducing the six adjoint variables \(\{\lambda_{r},\lambda_{\theta},\lambda_{\gamma},\lambda_{v_{\theta}},\lambda_ {v_{\gamma}},\lambda_{v_{\theta}},\lambda_{v_{\gamma}}\}\) in this case, the expression of the scalar Hamiltonian function [34] is  
\[\mathcal{H}=\lambda_{r}\,v_{r}+\frac{\lambda_{\theta}\,v_{\theta}}{r\,\cos \gamma}+\frac{\lambda_{\gamma}\,v_{\gamma}}{r}+\lambda_{v_{r}}\Bigg{(}\frac{v _{\theta}^{2}+v_{\gamma}^{2}}{r}-\frac{\mu_{\odot}}{r^{2}}+\mathbf{a}\cdot\mathbf{ \dot{i}}_{r}\Bigg{)}+\\ +\lambda_{v_{\theta}}\Bigg{(}\frac{v_{\theta}\,v_{\gamma}\,\tan \gamma-v_{r}\,v_{\theta}}{r}+\mathbf{a}\cdot\mathbf{\dot{i}}_{\theta}\Bigg{)}+ \lambda_{v_{\gamma}}\Bigg{(}-\frac{v_{\theta}^{2}\,\tan\gamma+v_{r}\,v_{ \gamma}}{r}+\mathbf{a}\cdot\mathbf{\dot{i}}_{\gamma}\Bigg{)} \tag{26}\]  
while the Euler-Lagrange equations, which give the time variation of the generic adjoint variable, are obtained through the following relationships:  
\[\dot{\lambda}_{r}=-\frac{\partial\mathcal{H}}{\partial r}\quad,\quad\dot{ \lambda}_{\theta}=-\frac{\partial\mathcal{H}}{\partial\theta}\quad,\quad\dot{ \lambda}_{\gamma}=-\frac{\partial\mathcal{H}}{\partial\gamma}\quad,\\ \dot{\lambda}_{v_{\gamma}}=-\frac{\partial\mathcal{H}}{\partial v_{ r}}\quad,\quad\dot{\lambda}_{v_{\theta}}=-\frac{\partial\mathcal{H}}{ \partial v_{\theta}}\quad,\quad\dot{\lambda}_{v_{\gamma}}=-\frac{\partial \mathcal{H}}{\partial v_{\gamma}}\quad, \tag{27}\]  
Figure 7: SWIFT-propelled spacecraft in a heliocentric spherical reference frame \(\mathcal{T}_{S}(O;r,\theta,\gamma)\).