Have you tried reducing the detector’s threshold
first?
Yes, I have changed the detector setting to set the threshold to 1e-10 and the descrptancy still exists.
I have used PropagationStepRecorder to record the date of each integration step and deduced the integration step just before the first detector’s condition is satisfied.
For withThreshold(1e-10), last integ step 3.637968e-12 sec
For default, last integ step 7.29503881296e-07 sec
After this detector’s condition is satisfied and its switched to the second detector and the propagation is resumed with initial integration step of 1 second (which is set by default).
# adL detector + uM detector + two manoeuvres
after_detector = orekitDetectors.adLDetector(5000, Client_TRUTH_file_path).withHandler(handlers.StopOnEvent()).withThreshold(1e-10)
print(after_detector.getThreshold())
myPropagator_Servicer_TRUE.propagator.addEventDetector(after_detector)
after_state = myPropagator_Servicer_TRUE.propagator.propagate(epoch0+dt.timedelta(hours=48))
orbital_period = after_state.getKeplerianPeriod()
epoch_after = after_state.getDate()
last_propagation_epoch = epoch_after
myPropagator_Servicer_TRUE.propagator.clearEventsDetectors()
dV_execution_detector = orekitDetectors.uM_Detector(4).withHandler(handlers.StopOnIncreasing()).withThreshold(1e-10)
print(dV_execution_detector.getThreshold())
myPropagator_Servicer_TRUE.propagator.addEventDetector(dV_execution_detector)
dV_execution_state_REF = myPropagator_Servicer_TRUE.propagator.propagate(absolutedate_to_datetime(last_propagation_epoch)+dt.timedelta(seconds=orbital_period))
epoch_dV_start_REF = dV_execution_state_REF.getDate()
@luc @Serrof @Vincent
To solve the issue, I have then set the initial integration step of the second propagation to match the last integration step used for the first propagation.
The descreptancy between the two scenarios (one without stopping the propagation and another stopping the propagation when one detector’s condition is satisfied) have been RESOLVED!
#adL detector + uM detector
after_detector = orekitDetectors.adLDetector(5000, Client_TRUTH_file_path).withHandler(handlers.StopOnEvent()) #.withThreshold(1e-10)
print(after_detector.getThreshold())
myPropagator_Servicer_TRUE.propagator.addEventDetector(after_detector)
after_state = myPropagator_Servicer_TRUE.propagator.propagate(epoch0+dt.timedelta(hours=48))
steps = integ_step_handler.copyStates()
last_integ_step = steps[-1].getDate().durationFrom(steps[-2].getDate())
print('last integ step',last_integ_step)
epoch_after = after_state.getDate()
# myPropagator_Servicer_TRUE.min_integ_step = 1e-12
myPropagator_Servicer_TRUE.init_integ_step = last_integ_step
orbital_period = after_state.getOrbit().getKeplerianPeriod()
last_propagation_epoch = epoch_after
myPropagator_Servicer_TRUE.propagator.clearEventsDetectors()
dV_execution_detector = orekitDetectors.uM_Detector(4).withHandler(handlers.StopOnIncreasing()) #.withThreshold(1e-10)
print(dV_execution_detector.getThreshold())
myPropagator_Servicer_TRUE.propagator.addEventDetector(dV_execution_detector)
dV_execution_state_REF = myPropagator_Servicer_TRUE.propagator.propagate(absolutedate_to_datetime(last_propagation_epoch)+dt.timedelta(seconds=orbital_period))
epoch_dV_start_REF = dV_execution_state_REF.getDate()
The list below shows the absolute date of each integration until the first detector’s condition (adL = 5000m) is satisfied.
2027-08-17T00:00:01.000Z
2027-08-17T00:00:11.000Z
2027-08-17T00:01:51.000Z
2027-08-17T00:04:42.057234974229800176Z
2027-08-17T00:04:54.662971882642352768Z
2027-08-17T00:12:38.987424993614013146Z
2027-08-17T00:20:29.3271816078242864Z
2027-08-17T00:28:24.822525075061776064Z
2027-08-17T00:35:58.036396197687736272Z
2027-08-17T00:43:27.432449206285127744Z
2027-08-17T00:50:08.535096437840365952Z
2027-08-17T00:56:42.699102822489749056Z
2027-08-17T01:04:05.703248036535114816Z
2027-08-17T01:10:28.540165458343835776Z
2027-08-17T01:10:41.315173362538189376Z
2027-08-17T01:18:16.450299052178706944Z
2027-08-17T01:26:04.660265914857518528Z
2027-08-17T01:33:39.582116291603597376Z
2027-08-17T01:35:56.920731615611657616Z
2027-08-17T01:35:56.920732345115538912Z
I have two questions:
-
By default, the minimum integration step for my propagator/integrator is set to be 0.0001. I have not touched this setting, but the last integration step observed is in the order of 1e-7. Why does this happen? If the threshold of the detector is set to default of 1e-6, does the integration step required to achieve this threshold override the default minimum integration step set? This causes an error during propagation as some integration step used is below the minimum integration set. This is not a big problem as reducing the minimum integration step from 1e-4 to 1e-6 would not change the computational cost as small integration step is already used for computation. However, I would like to know why.
-
I use two step handler simultaneously, one to record the spacecraft state every 60 seconds, and one to record every integration step.
myStepHandler = orekit_interfaces.OrekitStepHandler()
integ_step_handler = PropagationStepRecorder()
# myPropagator_Servicer_TRUE.propagator.setStepHandler(60., myStepHandler, ) # Stores the state every 60 s eventhough propagator uses variable stepsize.
Step_handler_multiplexer = StepHandlerMultiplexer()
Step_handler_multiplexer.add(integ_step_handler)
Step_handler_multiplexer.add(60., myStepHandler)
myPropagator_Servicer_TRUE.propagator.setStepHandler(Step_handler_multiplexer)
When a propagation is stopped, the PropagationStepRecorder stops recording and do not resume automatically.
This is a problem when I have 3 detectors for 3 consecutive propagations where I have to set the initial integration step of the third propagation to equal the last integration step for the second propagator.
Do I have to add a new integ_step_handler like below to resume recording?
Step_handler_multiplexer.add(integ_step_handler)
myPropagator_Servicer_TRUE.propagator.setStepHandler(Step_handler_multiplexer)
This causes a problem where the fixed step handler starts recording from the epoch where the second detector’s condition is satisfied. This is because the code below also resets the fixed step handler from the epoch at which the propagation has been stopped by a detector, which is not what I want. Ideally, I just want to resume or reconfigure this integ_step_handler WITHOUT effecting the fixed_step_handler. Is there any way around this problem?