# Intersatellite and Downlink Agile Attitude Maneuvers
## 2 Spacecraft Attitude Dynamics  
The spacecraft is modeled as a rigid body, and has an instantaneous orientation associated with vector \(\underline{\underline{B}}\)[24],  
\[\underline{\underline{B}}= \begin{bmatrix}\hat{b}_{1}&\hat{b}_{2}&\hat{b}_{3} \end{bmatrix}  \tag{1}\]  
where \((\hat{b}_{1},\hat{b}_{2},\hat{b}_{3})\) are the unit vectors aligned with the body axes. In this study, the instantaneous attitude is referred to \(\underline{\underline{N}}\), which identifies the inertial reference frame, and is described through the direction cosine matrix. The attitude of the spacecraft is defined by \(R=\underset{N\gets B}{R}\) which is a rotation matrix such that \(\underline{\underline{N}}^{T}=\underset{N\gets B}{R}\underline{ \underline{B}}^{T}\). The kinematics equation for \(R\) is  
\[\dot{R}=R\,\tilde{\omega} \tag{2}\]  
where \(\tilde{\omega}\) is the skew-symmetric matrix associated with the components (along the body axes) of the angular velocity of the spacecraft relative to the inertial frame. This research is focused on attitude tracking maneuvers, aimed at driving the actual spacecraft orientation toward the desired (commanded) attitude, while attaining the commanded angular rate. Meaningful variables in an attitude tracking problems are  
\[\underline{\omega}_{e} =\underline{\omega}-R_{e}^{T}\,\underline{\omega}_{c}^{(C)} \tag{3}\] \[\Phi_{e} =\cos^{-1}\left(\frac{1}{2}\big{[}\text{trace}(R_{e})-1\big{]}\right) \tag{4}\]  
In Equations (3) and (4) \(R_{e}=\underset{C\gets B}{R}\) is the error matrix, which is a rotation matrix such that \(\underline{\underline{C}}^{T}=\underset{C\gets B}{R}\underline{ \underline{B}}^{T}\) while \(\underline{\omega}_{c}^{(C)}\) and \(\underline{\omega}\) are two \((3\times 1)\)-vectors that contain, respectively, the components of the desired angular velocity (in \(\underline{\underline{C}}\)) and the actual angular velocity (in \(\underline{\underline{B}}\)). The transient behavior of the system can be described using the mean (integral) values of \(\Phi_{e}\) and \(|\underline{\omega}_{c}|\). Let \(n_{p}\) be the number of visible passes; \(t_{0}\) and \(t_{f_{i}}\) denote the times at which the i-th tracking phase begins and ends, respectively. The mean values of the variables defined in Equations (3) and (4) are  
\[\tilde{\Phi}_{e_{i}} =\frac{1}{t_{f_{i}}-t_{0_{i}}}\int_{t_{0_{i}}}^{t_{f_{i}}}\Phi_{ e}(t)\,dt\quad i=1,\,\ldots,\,n_{p} \tag{5}\] \[\tilde{\omega}_{e_{i}} =\frac{1}{t_{f_{i}}-t_{0_{i}}}\int_{t_{0_{i}}}^{t_{f_{i}}}| \underline{\omega}_{e}(t)|\,dt\quad i=1,\,\ldots,\,n_{p} \tag{6}\]  
Since the center of mass C does not move during the maneuver, the attitude dynamics equations are decoupled from the trajectory equations. Expressed in terms of error angular velocity, they are given by [21]  
\[\int_{c}^{(\underline{\omega})}\underline{\omega}_{e}=\big{[}\int_{c}^{( \underline{\omega})}(\underline{\omega}_{e}+R_{e}^{T}\,\underline{\omega}_{c} ^{(C)})\big{]}^{\sim}(\underline{\omega}_{e}+R_{e}^{T}\,\underline{\omega}_{c }^{(C)})+\int_{c}^{(\tilde{\omega})}(\tilde{\omega}_{e}R_{e}^{T}\,\underline{ \omega}_{c}^{(C)}-R_{e}^{T}\,\underline{\omega}_{c}^{(C)})+\underline{\underline {T}}_{c}+\underline{\underline{M}}_{C} \tag{7}\]  
In Equation (7) \(\underline{\underline{M}}_{c}\) is the vector that contains the sum of all external torques referred to the center of mass of the spacecraft, vector \(\underline{\underline{T}}_{c}\) is the commanded torque, \(J_{c}^{(\underline{\omega})}\) is the inertia matrix, resolved in the body-fixed reference frame, with respect to the center of mass. Vectors \(\underline{\underline{M}}_{C}\), \(\underline{\underline{T}}_{c}\), and \(\underline{\omega}_{e}\) are resolved in \(\underline{\underline{B}}\), unlike \(\underline{\omega}_{c}^{(C)}\). The present research considers the satellite T\(\ddot{\text{u}}\)rksat1B as an illustrative example of medium-size satellite [25], and assumes the following inertia matrix (obtained from the inertia matrix of T\(\ddot{\text{u}}\)rksat1B):  
\[J_{c}^{(n)}=