tudat-team / tudat

A C++ platform to perform astrodynamics and space research.
BSD 3-Clause "New" or "Revised" License
17 stars 27 forks source link

final_residuals returning best residuals, not final #198

Closed FDahmani closed 6 months ago

FDahmani commented 7 months ago

I have noticed that when using the following function https://py.api.tudat.space/en/latest/estimation.html#tudatpy.numerical_simulation.estimation.EstimationOutput.final_residuals ,the values you get are from the 'best', i.e. lowest printed 'Current residual' in the estimation process, not of the actual final residual. In the added output in the txt file, you can also see that the claimed final residual is in fact the first one, that just happens to be the best one, which is likely a coupled problem. In the images you can see the residuals in the first and fith iteration. The final image demonstrates the residuals from the function mentioned earlier, which is the same as the first, not the last iteration, as it is supposed to be. residuals.txt 0_720 4_720 residuals_720

FDahmani commented 7 months ago

To provide some more context, and perhaps a more clear case to reproduce:

  1. Residuals from final_residuals
  2. Residuals at iteration 1 from residual_history
  3. Residuals at iteration 5 from residual_history
  4. The difference in position between estimated orbit and SPICE benchmark, very bad fit

Thus note that the final_residuals in fact are the same as the ones from the first iteration. Both input files and the file to run can be found in the zip. Make sure to change line 83 to the correct directory and to have the correct Spice kernel available(jup344.bsp)

Residuals 0 4 PosDifference Inputfiles.zip

DominicDirkx commented 6 months ago

Issue corrected in documentation (to be built)