# Nanosatellite Autonomous Navigation via Extreme Learning Machine Using Magnetometer Measurements
## 5 Results  
The algorithm was tested on the following scenario, assuming knowledge of the satellite's attitude. This assumption was made to simulate the best possible performance of the EKF to further emphasize the improvement brought by the SLFN application. For six days, GPS data were available to the spacecraft as well as the state estimates provided by the magnetometer-based EKF. The first day of measurements was excluded from the training data in order to avoid data contamination due to the initial transitory phase of the EKF. The errors of each state estimate with respect to the state provided by the GPS-based EKF were sequentially computed and stored as training targets. After six days, the GPS was no longer available, the SLFN was trained using the stored data, and its prediction was used to perform orbit determination for the following 51 days of the run. The prediction scheme of the algorithm is shown in Figure 6.  
Figure 5: The geomagnetic field magnitude difference between the CHAOS-7 and IGRF-13 models at a fixed altitude of 567 km with a 5\({}^{\circ}\) resolution. The red line represents the satellite ground track from the beginning to the end of the simulation (from 3 January to 3 May 2019). The test was performed on the following hardware:  
* CPU: AMD Ryzen Threadripper PRO 3975 WX 32 Cores 3.50 GHz;
* RAM: 128 GB. Table 5 shows the comparison between the ELM-trained SLFN and the EKF in terms of the state RSSE and standard deviation. The training phase was carried out from the second to the sixth day, while the prediction phase went from the seventh days onwards. The error was computed with respect to the true propagated orbit. The prediction of the SLFN reduced the errors in the state estimate by a factor of 2.39 for the position and 2.36 for the velocity, with the respective mean RSSE decreasing from 16.51 km to 6.90 km and from \(2.07\times 10^{-2}\) km/s to \(8.76\times 10^{-3}\) km/s. Moreover, the sparseness of the RSSE was reduced by a factor of 2.06 for the position and 1.71 for the velocity. Figure 7 shows the state RSSE over time. While the SLFN yielded a better state estimate than the EKF on average, the predictive capacity of the network started to decrease with time and could eventually lead to a divergence in the prediction. This was due to the fact that the SLFN was trained on an extremely small percentage of data and, in the long run, it struggled to handle never-seen-before data points given by the pseudo-periodic behavior of the orbit. This pseudo-periodic feature could also be seen in the RSSE as it showed a periodic trend itself, due to the difference between the real and simplified magnetic field models. A greater error in the state estimate corresponded to a region in which the discrepancy between the two models was deeper. An extended simulation of 120 days was carried out in order to study the behavior of the SLFN's mean RSSE over time. Figure 8 shows the mean RSSE for both algorithms computed over each day of the simulation. While the position error clearly diverges, the velocity error stabilizes after approximately 100 days. Nonetheless, looking at the figure, it can be seen that the SLFN errors are inside the range determined by the EKF errors. Therefore, the SLFN approach yielded better or comparable results for up to 120 days. After this period, the SLFN did not represent an improvement over the EKF. Figure 6: EKF-SLFN algorithm prediction scheme.