Brouwer-Lyddane OrekitInternalError w/ retrograde orbit, event detector

Long-time user of Orekit, both in Java and the Python wrapper. Thank you for developing and maintaining this amazing suite.

While recently trying out BrouwerLyddanePropagator with an altitude detector, I encountered an OrekitInternalError. Some details:

  • Error was reproduced on Orekit 13.1.7 (Java) and Orekit 12.2 (Python JPype wrapper).
  • My states are statistically sampled offsets from a mean state, so I’m treating them as mean states, not osculating. This should be fine, because…
  • … the code fails only if an event detector is attached. I’ve tried the built-in AltitudeDetector as well as several FunctionalDetector replacements; I suspect any event detector will fail, because this orbit is at no risk of decaying. Propagation succeeds without an event detector.
  • The internal error is thrown during evaluateStep in EventState. findRoot is called, and this check call fails.
  • My suspicion is numerical error accumulating in the root-finding due to an inclination close to 180 degrees. (The right ascension is also close to 180 degrees, which is ambiguous for equatorial orbits.) I show that propagating to the same timestamp in multiple chunks results in different results, including a NaN inclination(!) and the OrekitInternalError being thrown.

Attached below is a minimal example in the Python wrapper. Am I misusing the propagator, or is this a bug?

brouwer_lyddane_propagation.py (3.4 KB)

To make analysis easier, I’ve made a simpler orbital state:

  • Timestamp 2007-01-13T00:00.00Z
  • Semimajor axis 8600km
  • Eccentricity 0.2
  • Inclination 179deg
  • Argument of periapsis, right ascension, true anomaly all 0

Propagating for 1 second results in the output state

Keplerian parameters: {a: 8604560.199743822; e: 0.20127185180228424; i: NaN; pa: -0.5075080183169866; raan: -0.5113762343665195; v: 0.06417123722581786;}

which shows the NaN inclination. (If you keep propagating this state, the calculation breaks down further… all elements become NaN, and by the 24-hour mark, the event detector gets a false positive root as described earlier.)

Hi,

Brouwer lyddane uses equinoctial elements internally and the latter have a singularity for inc=180deg (orekit’s implémentation doesn’t cover this special case), so it might be that the perturbations make you reach this value and give you a NaN.

Cheers,
Romain.

That makes complete sense, thank you Romain!

I don’t expect Orekit to implement retrograde equinoctial elements to support retrograde equatorial orbits. My backup option for these orbits is numerical propagation in Cartesian elements, I suppose.

Does Orekit have an analytic propagator that tolerate retrograde equatorial states?