Propagator Parallelizer

Hi :slight_smile: ,

I am using the PropagatorParallelizer to propagate two different spacecrafts and to get an information related to a multi-satellite event (in this case I am trying to get the date where the angular separation is minimum).
I have some questions:

  1. I read on another (very helpful!) answer from you that the PropagatorParallelizer does not handle multi-satellite events, but that the Parallelizer stops whenever a single propagator in the list is stopped by its own Detector. So, for now I computed the close approach in the handleStep() method of the MultiSatHandler (actually on a class that implements that interface) but now I struggle to make a propagator stop based on this information. Is there a way I could achieve this?

  2. After creating a PropagatorParallelizer (and propagate with it), if I try to use a single propagator which was in the list of the PropagatorParallelizer it never stops running. I guess this is because the propagator is somehow still linked to the Parallelizer. Is there a way I can unlink the propagator to the Parallelizer?

Thank you very much in advance.

Hi @Giacomo

There is an interesting workaround to try. Because you have only have two spacecrafts, you can use the first one as a classical Propagator performing the orbit propagation and the second one as a PVCoordinatesProvider to compute the angular separation.

Let MinimumSeparationDetector be the detector you want. You can imagine something like that:

public class MinimumSeparationDetector extends AbstractDetector<MinimumSeparationDetector> {

    /** PV Coordinates provider for the second satellite. */
    private final PVCoordinatesProvider secondarySatellite;

    /** Constructor. */
    public MinimumSeparationDetector(final PVCoordinatesProvider secondarySatellite) {
        this(DEFAULT_MAXCHECK, DEFAULT_THRESHOLD, secondarySatellite);

    /** Constructor. */
    public MinimumSeparationDetector(final double maxCheck, final double threshold,
                                     final PVCoordinatesProvider secondarySatellite) {
        this(maxCheck, threshold, DEFAULT_MAX_ITER, new StopOnIncreasing<ElevationExtremumDetector>(),

    /** Constructor. */
    private MinimumSeparationDetector(final double maxCheck, final double threshold,
                                      final int maxIter, final EventHandler<? super ElevationExtremumDetector> handler,
                                      final PVCoordinatesProvider secondarySatellite) {
        super(maxCheck, threshold, maxIter, handler);
        this.secondarySatellite = secondarySatellite;

    public double g(final SpacecraftState s) {
        final TimeStampedPVCoordinates pvSecondary = secondarySatellite.getPVCoordinates(s.getDate(), s.getFrame());
        final FieldPVCoordinates<UnivariateDerivative1>  pvSecondaryUD1 = pvOtherInS.toUnivariateDerivative1PV();
        final FieldPVCoordinates<UnivariateDerivative1> pvPrimaryUD1 = s.getPVCoordinates().toUnivariateDerivative1PV();
        final UnivariateDerivative1 angle = ... // Compute the angle
        return angle.getDerivative(1);

Beware, I have just written this code snippet in the forum editor, it is not validated and I probably made some syntax errors.

In the code above, s represents the spacecraft state of the primary satellite, computed by the orbit propagator, and the secondary satellite is represented by the PVCoordinatesProvider. The advantage of using PVCoordinatesProvider is that this interface is implemented by all the Orekit’s orbit propagators. Therefore, you can use the orbit propagator of you second satellite to initialize the MinimumSeparationDetector.

// Initialize the propagators (the ones used in your application to initialize the PropagatorParallelizer)
final Propagator sat1 = ...
final Propagator sat2 = ...
// Add the event detector to the first propagator (you can customize the detector like any Orekit detectors before adding it to the propagator)
sat1.addEventDetector(new MinimumSeparationDetector(sat2));
// Propagate
final SpacecraftState state = sat1.propagate(targetEpoch); // this should stop a minimum angular separation detection
// Epoch of minimum separation

I never tried it but I think it can work :slight_smile:

I hope this will help you,
Best regards,


I can confirm that the principle suggested by Bryan works, having tested it in the context of closest approach detection.
But beware, it may take a bit of time if you use numerical propagators for the primary and secondary with small maxcheck and threshold for the detector. Using a BoundedPropagator for the secondary can speed up the calculation.



Hi @pascal.parraud and @bcazabonne,

Thank you very much for your answers. I will implement the method you suggested!
I guess that, as “slow” as it could be even with a numerical propagator, it will always be faster than my alternative solution of propagating both satellites in a for cycle with a small step.

Thank you!!