Unstability in KeplerianOrbit / shiftedBy with very big eccentricity
We noticed a strange bug with the shiftedBy method (with 0. offset !) that occured with "weird" orbits, that became hyperbolic.
The following test is a simplified test :
- the initial orbit is a very excentric orbit, with a mean anomaly of 1 degree
- we add a big (!!) deltaV on Y, like in an impulse manoeuver, so the orbit became very excentric
- we calculate PV coordinates
- we apply a shiftedBy(0) to the orbit ->we expect it to be the same...
- we calculate PV coordinates and they are very different
Of course, this use case is not realistic, but the KeplerianOrbit.shiftedByHyperbolic method seems to be unstable...
If we increment the deltaV progressively (see the second part of the
test), we see that the PVcoordinates (computed in
KeplerianOrbit.initPVCoordinatesHyperbolic) take some incoherent values
because the "posFactor" takes suddenly a very large value.
This seems to come from the quotient "(a * (1 - e * e)) / (1 + e * cosV)" :
->a and e become very big, and suddenly, cos(true anomaly) is very close to 0.
I think the numerical instability comes from the conversions between eccentric, mean and true anomaly, because the shiftedBy() method creates a new orbit with mean anomaly, and then calls successively the methods to compute eccentric and then true anomaly (see "hyperbolicEccentricToTrue(meanToHyperbolicEccentric(anomaly))" in the KeplerianOrbit constructror).
As I said, I think this instability only occurs on very weird orbits.
They don't correspond to a realistic flight domain.
But if we can localize the instability, it would be a good idea to indicate some upper bound to orbit eccentricty, that OREKIT can manage.
(from redmine: issue id 114, created on 2012-09-21, closed on 2012-09-21)