## 2 Orbital Simulator
### Spacecraft Position Dynamics  
The complete description of the derivation of [PERSON]'s equations from inertial equations is extensively described in [22], while in the following it is reported as the final formulation. [PERSON]'s equations describe the relative motion between two objects orbiting in slightly different orbits. [PERSON]'s equations are computed with respect to the origin of a Local-Vertical-Local-Horizontal (LVLH) reference frame (Figure 2), usually coincident with the center of mass of the Target. The reference object may also be taken as a virtual point as the origin of the LVLH frame orbiting the Earth, where the position dynamics of more spacecraft can be propagated with respect to it. Some assumptions have to be formulated. 1. The orbit of the reference object must be circular. However, a modified formulation of [PERSON]'s equations for non-circular orbits can be found in literature [23]. 2. The validity of the approximation of [PERSON]'s equations is limited to few kilometers of distance along each axes. Introduction of curvilinear \(x\) and \(y\) coordinates may partially extend the validity of [PERSON]'s equations, mitigating position error due to the curvature of the Earth. In this paper, curvilinear coordinates are not implemented. Figure 1: Complete rendezvous and docking maneuver in Hill frame. Figure 2: LVLH (Local-Vertical-Local-Horizontal) frame definition. X\({}_{\text{LVLH}}\), Y\({}_{\text{LVLH}}\) and Z\({}_{\text{LVLH}}\) are also named respectively V\({}_{\text{var}}\), H\({}_{\text{var}}\) and R\({}_{\text{var}}\). [PERSON]'s equations for circular orbit  
\[ \begin{split}\dot{x}&=\frac{F_{x}}{m_{c}}+2\omega_{0 }\dot{z}\\ \dot{y}&=\frac{F_{y}}{m_{c}}-\omega_{0}y\\ z&=\frac{F_{z}}{m_{c}}-2\omega_{0}\dot{x}+3\omega_{0 }^{2}z,\end{split}  \tag{1}\]  
where \(\dot{x}\), \(\dot{y}\) and \(\dot{z}\) are accelerations in the LVLH frame; \(\dot{x}\), \(\dot{y}\) and \(\dot{z}\) are velocities with respect to the LVLH frame; \(x\), \(y\), and \(z\) are Hill positions; \(m_{c}\) is the mass of the spacecraft; and \(\omega_{0}\) is the orbital angular velocity of the reference LVLH frame. \(F=[F_{x},F_{y},F_{z}]^{T}\in\mathbb{R}^{3}\) is the total force acting on the spacecraft and it includes both forces due to the thrusters system and external disturbances  
\[F=F_{\text{thr}}+F_{\text{ext}}, \tag{2}\]  
where \(F_{\text{thr}}\in\mathbb{R}^{3}\) is the thruster force and \(F_{\text{ext}}\in\mathbb{R}^{3}\) is the external disturbances perturbation, both expressed in the LVLH frame. The main disturbance affecting Low Earth Orbits (LEO), in terms of magnitude, is the drag force due to the residual atmosphere. For this maneuver, since oblateness of the Earth affects orbital parameters of the reference object and the relative position dynamics is computed with respect to the Target, the J2 effect can be usually considered one order of magnitude smaller than the drag force. Hence, the force due to external disturbance can be reduced to a constant atmospheric drag and to a random force due to J2 effect. The drag force is designed as  
\[F_{\text{ext}}=\left\{ \begin{matrix}-\frac{1}{2}\rho V^{2}SC_{D}\\ 0\\ 0\end{matrix} \right\}, \tag{3}\]  
where \(\rho\) is the density of the atmosphere, \(V\) is the orbital velocity of the spacecraft, \(S\) is the frontal section, and \(C_{D}\) is the drag coefficient of the spacecraft. The negative sign of \(F_{\text{ext}}\) is due to the drag force is opposing the motion along +V-bar. Basically, the RCS model is defined in Body frame, hence, to obtain the thrust force in the LVLH frame, a rotation has to be applied  
\[F_{\text{thr}}=R_{LVLHb}(\phi,\theta,\psi)F_{\text{thr}}^{b},\]  
where \(F_{\text{thr}}^{b}\in\mathbb{R}^{3}\) is the thrust force expressed in body frame (related to the actuation system) and \(R_{LVLHb}(\phi,\theta,\psi)\) is the rotation matrix from body frame to LVLH frame.