Resetting propagator state to a previous one

Dear all,

I am writing to have a suggestion to a current issue we are facing with resetting the state of a numerical propagator after event detector.

Context: we want to perform an action some time before the beginning of a maneuver. This maneuver is started upon detection of a combination of events (boolean detector).

The solution we tried is to reset the state to the given (past) date when the event that starts the maneuver is detected. To locate the past state we interpolate a collection of spacecraft states using the Ephemeris class. This seems to work fine in the sense that we return to the correct date in the past. On the other hand, many times the propagation freezes after the reset state.

Basically, I would like to have your advice about this situation. Do you see any major flaws in what I described? If faced with a similar need would you use a rather different solution?

Thanks in advance,
Andrea

Hi,

A deadlock or infinite loop is definitely a bug. Could you provide a back trace? A failing JUnit test case would be even more helpful in diagnosing the issue.

Using Propagator.resetInitialState(...) should work for you use case, but EventHandler.resetState(...) would probably fail since the time changes. Another approach would be to use EventShifter, but make sure the assumptions in that class are valid for your use case.

If interpolation error becomes an issue you can use Propagator.setEphemerisMode(OrekitStepHandler) and OrekitStepInterpolator.is{Previous,Current}StateInterpolated() to avoid resetting the propagator to an interpolated state.

Regards,
Evan

Hi @evan.ward, thanks for your reply and suggestions. I have momentarily stopped working on this issue, but I will try to reset directly the propagator state as suggested.

Best,
Andrea

The EventShifter is what we needed. The first tests provide good results. I didn’t see any specific assumption in the class. I understand that the constraint are on the shift of state, which should be ok in our case.