Low-thrust manoeuvre only when not in eclipse

Hi, I am quite new to Orekit and Java programming in general and I am trying to figure out how to propagate an orbit including low-thrust manoeuvres, which should be performed only when the spacecraft is not in eclipse. Is there a way to combine the eclipse event hander and the manoeuvre triggers in order to achieve this?

I think I managed to get a minimum working example by using the EclipseDetector and its Negate as a start and stop event of an EventManeuverTrigger. This is an outline of my code.

    EclipseDetector eclipseDetector =
            new EclipseDetector(sun, Constants.SUN_RADIUS, earth).withPenumbra();
    propagator.addEventDetector(eclipseDetector);

    EventBasedManeuverTriggers triggers = new EventBasedManeuverTriggers(eclipseDetector, new NegateDetector(eclipseDetector));
    propagator.setAttitudeProvider(
            new LofOffset(kontext.getEME2000(), LOFType.VNC));
    final PropulsionModel propulsionModel =
            new BasicConstantThrustPropulsionModel(thrust, isp, thrustDirection);

    propagator.addForceModel(new Maneuver(null, triggers, propulsionModel));

    propagator.propagate(orbit.getDate(), orbit.getDate().shiftedBy(propagationDuration));

However, in this way, the thrust is applied for the entire arc during which the spacecraft is in sunlight. I was wondering if there is the possibility to define custom start and stop date of the manoeuvres, that are also inside the trajectory arcs not in eclipse.

Hello Mirko,
you could store the events when the satellite enters/exits eclipse (using an EventLogger), get the dates corresponding to these events and, setting a time-offset from these dates, use them to create a DateBasedManeuverTriggers instance to use for your maneuver.
In this way you’d have to run a first propagation to get the eclipse events though.

Best regards,
Emiliano