[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orekit Users] Propagation from start to target date with event detection

Dear André,

It seems it is indeed a bug and the code does not correspond to the intended behaviour described in the Javadoc.
Thank you for finding it and for the test code!
I'll open a new issue for it.
The behaviour will be the one described in the Javadoc; the event detection mechanism will be switched off outside the interval of start and target date.


Le 03/05/2018 à 11:31, André Oeschger a écrit :

Dear Colleagues,


I am using the Propagators method propagate(AbsoluteDate start, AbsoluteDate target)
to do a propagation between start and target date.
The initial state of the propagator is before the start date.
According to the description of the method which can be found here

the event detection mechanism should be switched off outside the interval of start and target date.

In my example below also events outside the specified interval are detected.

I would expect that 0 events are reported instead of 3.

What is the intended behaviour?


Many Thanks,




public class App {


    public static void main(String[] args) throws OrekitException {


        // Mostly copied from the examples found in:

        // https://www.orekit.org/static/tutorial/propagation.html

        DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(args[0])));


        Vector3D position = new Vector3D(-6142438.668, 3492467.560, -25767.25680);

        Vector3D velocity = new Vector3D(505.8479685, 942.7809215, 7435.922231);

        PVCoordinates pvCoordinates = new PVCoordinates(position, velocity);

        AbsoluteDate initialDate = new AbsoluteDate(2004, 01, 01, 12, 00, 00.000, TimeScalesFactory.getUTC());

        Frame inertialFrame = FramesFactory.getEME2000();


        double mu = 3.986004415e+14;

        Orbit initialOrbit = new CartesianOrbit(pvCoordinates, inertialFrame, initialDate, mu);

        SpacecraftState initialState = new SpacecraftState(initialOrbit);


        double minStep = 0.001;

        double maxstep = 1000.0;

        double positionTolerance = 10.0;

        OrbitType propagationType = OrbitType.CARTESIAN;

        double[][] tolerances = NumericalPropagator.tolerances(positionTolerance, initialOrbit, propagationType);

        AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(minStep, maxstep, tolerances[0], tolerances[1]);


        NumericalPropagator propagator = new NumericalPropagator(integrator);



        // Code showing the issue starts here


        // The propagator's initial state is set



        // Dates for the Event detector

        AbsoluteDate dateOne = initialDate.shiftedBy(10);

        AbsoluteDate dateTwo = initialDate.shiftedBy(20);

        AbsoluteDate dateThree = initialDate.shiftedBy(30);


        // Start and stop date for the propagation

        AbsoluteDate startDate = initialDate.shiftedBy(40);

        AbsoluteDate stopDate = initialDate.shiftedBy(50);


        RecordAndContinue<DateDetector> recordAndContinue = new RecordAndContinue<>();

        DateDetector dateDetector = new DateDetector(1, 1E-1, dateOne, dateTwo, dateThree).withHandler(recordAndContinue);




         *  A propagation from startDate to stopDate is requested.

         *  The starting date is not the initial date

         *  and the propagation interval is outside of the DateDetectors dates.


        SpacecraftState finalState = propagator.propagate(startDate, stopDate);


        System.out.println("Final date: " + finalState.getDate());


        //The expected result is 0 events as event detection should not be activated outside the interval of start and stop date.

        System.out.println("Number of events: " + recordAndContinue.getEvents().size());






André Oeschger
Flight Dynamics Software Engineer
SCISYS Deutschland GmbH
T:  +49 6151 4285346 | F:  +49 6151 4285399
E:  andre.oeschger@scisys.de | http://www.space.scisys.de
SCISYS Deutschland GmbH, Darmstadt Office, Europaplatz 4, 64293 Darmstadt, Germany
Management Board: Prof. Dr.-Ing. Klaus-G. Meng (Chairman), Sandra Krewerth, Ulli Leibnitz, Dr. Karl-W. Pieper, Dr. Horst Wulf
Registered Office Bochum HRB 13694, VAT-Id-No. DE 813242674, WEEE-Reg.-No. DE 74530735