## 3 Results and Discussions
### Alfacrux Digital Twin Pilot
#### 3.2.1 Attitude Reconstruction and Dynamic Analysis  
The attitude reconstruction system is responsible for the spacecraft pose determination using the in-orbit data stored in the DT database, generating an offline time-series of the attitude parameters. This feature allows the assessment of onboard sensors performance and their characterization; the analysis of filtering methods, such as Kalman filter and its derivations; the study of environment models; and the estimation of perturbations. For the reconstruction, not only the attitude sensors, for instance gyroscopes, magnetometers, and Sun sensors, can be considered but also other onboard data that may be affected by the satellite orientation, such as solar panels, optical payloads, or even the antenna signal power received by the ground station. For the AlfaCrux attitude estimation, the onboard sensors available are one gyroscope and one magnetometer, both with tree-axis measurements. In order to improve the filter performance, the solar-panel-related data are also considered so that the Sun line-of-sight can be estimated as a Sun sensor. Specifically, the AlfaCrux CubeSat has a total of six solar panels, each one mounted on one spacecraft face. Solar panels from opposite sides are connected in parallel and the onboard system collects one current and voltage measurements from each pair along with individual temperature measurements. As shown in [27], the Sun vector can be estimated through computations with individual current measurements. However, in the AlfaCrux case, the power is considered instead of the current, and the highest temperature of one solar panel pair indicates which one is generating such power. Once the measurements are available, an initial attitude determination method is executed in order to compute the full attitude profile. The simplest one is the Triaxial Attitude Determination (TRIAD), which is based on finding an attitude matrix that rotates an orthonormal base in the inertial frame to the base expressed in the spacecraft body frame from two not aligned vector measurements, such as, for instance, the Sun position and the Geomagnetic field [27]. After the definition of the initial attitude, stochastic filtering techniques provide the solution for the attitude propagation over time through the dynamical model and sensor data. Such a filtering problem consists of a sub-optimal estimation of the attitude state along with related parameters, such as sensor biases, misalignment, and orthogonality. In this context, the state vector and sensor observations are defined as random variables, so that their statistics represent the confidence degree in both estimated and measured quantities in the form of error covariance. The filter structure for AlfaCrux attitude estimation is formulated in [28], called Unscented Quaternion Estimator (USQUE), which is based on the Unscented Kalman Filter, a nonlinear filter that uses selected samples from the state probability density function instead of computing a first-order linear approximation using the Jacobian matrix, as in the Extended Kalman Filter. The USQUE algorithm considers the multiplicative quaternion approach, where a global attitude state is the spacecraft estimated pose, and a local attitude state represents the error to be computed in the filtering process. After an iteration, the global attitude is updated with the estimated error from the filter. The system is modeled by the following equations:  
\[ \begin{split}\mathbf{x}_{k}&=\mathbf{f}(\mathbf{x}_{k-1} )+G_{k}\mathbf{w}_{k},\\ \mathbf{y}_{k}&=\mathbf{h}(\mathbf{x}_{k})+\mathbf{v}_ {k},\end{split}  \tag{1}\]  
where \(\mathbf{x}\) is the \(6\times 1\) state vector; \(\mathbf{y}\) is the \(6\times 1\) output vector; \(\mathbf{f}(\cdot)\) is the attitude kinematic equation; \(\mathbf{h}(\cdot)\) is the measurement model equation; \(\mathbf{w}\) and \(\mathbf{v}\) are the process and observation errors, both modeled as uncorrelated Gaussian random variables with zero mean; and Q and R are covariance matrices, respectively.