Hello everyone,
I recently encountered this error:
JavaError: <super: <class 'JavaError'>, <JavaError object>>
Java stacktrace:
org.orekit.errors.OrekitException: org.orekit.propagation.events.EventSlopeFilter@4d94fc95 failed to find root between 2024-03-17T05:55:05.5923675099728Z (g=6.51925802230835E-9) and 2024-03-17T06:26:43.72339071493213Z (g=-5.943172694678251E6)
Last iteration at 2024-03-17T05:55:05.59236751003797Z (g=6.51925802230835E-9)
at org.orekit.propagation.events.EventState.findRoot(EventState.java:359)
at org.orekit.propagation.events.EventState.evaluateStep(EventState.java:222)
at org.orekit.propagation.analytical.AbstractAnalyticalPropagator.acceptStep(AbstractAnalyticalPropagator.java:297)
at org.orekit.propagation.analytical.AbstractAnalyticalPropagator.propagate(AbstractAnalyticalPropagator.java:151)
at org.orekit.propagation.AbstractPropagator.propagate(AbstractPropagator.java:276)
Caused by: org.hipparchus.exception.MathIllegalStateException: maximal count (100) exceeded
at org.hipparchus.util.Incrementor.lambda$static$0(Incrementor.java:41)
at org.hipparchus.util.Incrementor.increment(Incrementor.java:237)
at org.hipparchus.analysis.solvers.BaseAbstractUnivariateSolver.incrementEvaluationCount(BaseAbstractUnivariateSolver.java:318)
at org.hipparchus.analysis.solvers.BaseAbstractUnivariateSolver.computeObjectiveValue(BaseAbstractUnivariateSolver.java:165)
at org.hipparchus.analysis.solvers.BracketingNthOrderBrentSolver.doSolveInterval(BracketingNthOrderBrentSolver.java:297)
at org.hipparchus.analysis.solvers.BracketingNthOrderBrentSolver.solveInterval(BracketingNthOrderBrentSolver.java:427)
at org.hipparchus.analysis.solvers.BracketedUnivariateSolver.solveInterval(BracketedUnivariateSolver.java:126)
at org.orekit.propagation.events.EventState.findRoot(EventState.java:350)
4 more
For context: I’m using a NodeDetector
on an AggregateBoundedPropagator
(obtained via EphemerisGenerator
of a NumericalPropagator
). This is how I create the detector:
... other stuff ...
ephemeris = self.ephemeris
initState = ephemeris.getInitialState()
ephemeris.clearEventsDetectors()
logger = EventsLogger()
nodeCrossing = NodeDetector(initState.getOrbit(), initState.getFrame()).withHandler(ContinueOnEvent())
nodeCrossing = EventSlopeFilter(nodeCrossing, FilterType.TRIGGER_ONLY_DECREASING_EVENTS)
nodeCrossing = logger.monitorDetector(nodeCrossing)
ephemeris.addEventDetector(nodeCrossing)
ephemeris.propagate(ephemeris.getMaxDate())
nodes = list(logger.getLoggedEvents())
... other stuff ...
I don’t understand what’s happening. I also don’t understand why the two dates reported are so distant from each other. Are those the dates of the two closest ephemeris saved by the generator? Also, I feel like the first value of g reported is close enough to the real root. Is there a way to change the tolerance on the root-search?
As a side note, I’ve encountered similar issues in the past but I don’t really know how to reproduce them. Sometimes just removing the filter on the detector and filtering afterwards based on the isIncreasing
method is enough to sidestep the problem.
Best regards,
Emiliano