## 3 Results and Discussions
### Alfacrux Digital Twin Pilot
#### 3.2.1 Attitude Reconstruction and Dynamic Analysis
The state vector is composed of attitude-error angles parameterized using the Generalized Rodrigues Parameters (GRP) and the gyroscope bias, as follows: \(\mathbf{x}\equiv[\boldsymbol{\phi}\mathbf{p}^{T}\;\;\boldsymbol{\beta}^{T}]^{T}\). The GRP represents the local attitude-error that will be incorporated in the global representation, once \(\parallel\boldsymbol{\varphi}\parallel\) is equal to the rotation angle, \(\boldsymbol{\vartheta}\), for small errors. The sigma-points, \(\boldsymbol{\chi}(i)\) for \(i=0,1,\cdots,12\), are generated according to the following equations:  
\[\boldsymbol{\sigma}_{i}\longleftarrow\text{i-th column of }\pm\sqrt{(n+\lambda)(P_{k-1}^{+}+\tilde{Q}_{k-1})}, \tag{2}\]  
\[ \begin{split}\boldsymbol{\chi}(0)&=\hat{\mathbf{x}} ^{+},\\ \boldsymbol{\chi}(i)&=\boldsymbol{\sigma}_{i}+\hat{ \mathbf{x}}^{+},\end{split}  \tag{3}\]  
where \(P_{k-1}^{+}\) is the state error covariance, \(\tilde{Q}_{k-1}\) is the process error covariance, and \(\lambda\) is a scalar chosen arbitrarily. For the prediction step where the state vector is propagated from time instant \(k-1\) to \(k\), the attitude kinematic equation is considered. The GRP vector of each sigma-point is converted to an error-quaternion, \(\boldsymbol{\delta}\mathbf{q}(i)\), and incorporated to the full attitude representation, \(\hat{\mathbf{q}}\), through a quaternion multiplication operation. Then, the attitude kinematic for the sigma-points quaternions, \(\mathbf{q}(i)\), is executed using the gyroscope angular velocities measurements for propagation in time. After the prediction, the sigma-points in GRP representation are retrieved from the propagated quaternions. The mean predicted state vector is computed along with the predicted state error covariance matrix:  
\[\hat{\mathbf{x}}_{k}^{-}=\frac{1}{n+\lambda}\Bigg{\{}\lambda\boldsymbol{\chi} _{k}(0)+\frac{1}{2}\sum_{i=1}^{2n}\boldsymbol{\chi}_{k}(i)\Bigg{\}}, \tag{4}\]  
\[P_{k}^{-}=\frac{1}{n+\lambda}\Bigg{\{}\lambda[\boldsymbol{\chi}_{k}(0)-\hat{ \mathbf{x}}_{k}^{-}][\boldsymbol{\chi}_{k}(0)-\hat{\mathbf{x}}_{k}^{-}]^{T} \quad+\frac{1}{2}\sum_{i=1}^{2n}[\boldsymbol{\chi}_{k}(i)-\hat{\mathbf{x}}_{k }^{-}][\boldsymbol{\chi}_{k}(i)-\hat{\mathbf{x}}_{k}^{-}]^{T}\Bigg{\}}+\tilde{ Q}_{k}. \tag{5}\]  
The correction step is performed once the mean state vector and covariance are available. This procedure considers the observation model, where reference vectors (such as Sun line-of-sight and geomagnetic field) in the inertial frame are transformed to the spacecraft body frame and compared with the magnetometer and solar panels data observations in order to compute the innovation vector, \(\boldsymbol{v}\). Such measurement model is given by  
\[\hat{\mathbf{y}}_{k}=\big{[}A(\mathbf{q})\mathbf{r}_{1}\quad A(\mathbf{q}) \mathbf{r}_{2}\quad\ldots\quad A(\mathbf{q})\mathbf{r}_{n}\big{]}^{T}+\big{[} \boldsymbol{v}_{1}\quad\boldsymbol{v}_{2}\quad\ldots\quad\boldsymbol{v}_{n} \big{]}^{T}, \tag{6}\]  
where \(A(\mathbf{q})\) is the attitude matrix built with the quaternion obtained from the GRP, \(\mathbf{r}_{j}\) is a reference vector observation provided by a environment model, and \(\boldsymbol{v}_{j}\) is the respective measurement error.