Skip to content

Fix issue 924: Numerical noise in ThrustPropulsionModel and tests

Maxime Journot requested to merge issue-924 into develop

Fixes #924 (closed).

@evanward1 , I put you as reviewer as you opened the issue.
I simply removed the incriminated comments.
There is indeed a numerical difference when doing:

  1. acc = new Vector3D(thrust / s.getMass(), maneuverAttitude.getRotation().applyInverseTo(direction)); (current code)
  2. acc = new Vector3D(1. / s.getMass(), maneuverAttitude.getRotation().applyInverseTo(thrustVector)); (better code?)
    (or the Field equivalent of these)

It's a small difference due to the usage of getNorm() for the module (about 1e-17/18 on the acceleration norm in the tests I have checked).

The thing is, before we changed the maneuvers package it was like (1) and we left it like this.
Mostly because some tests in PolynomialAccelerationTest and HarmonicAccelerationModelTest compare the outputs of propagation to a propagation with an equivalent maneuver.
Since the definition of the forces is given like (1) in PolynomialAcceleration and HarmonicAccelerationModel tests, the differences are all zeros.
If we use (2) in ThrustPropulsionModel, numerical differences appear because of integration of the acceleration during propagation.
(See for example PolynomialAccelerationTest#testEquivalentTangentialManeuver)

Maybe the tolerances are too tight but I don't feel like changing all the tolerances of the tests for this small change.
Tell me what you think.

Merge request reports