Hello everyone, I am having a bit of a trouble, trying to identify if two (or more) Maneuvers overlap. I am sharing also a chunk of code just to show the problem.
final FactoryManagedFrame eme2000 = FramesFactory.getEME2000();
final AbsoluteDate date = new AbsoluteDate(new DateComponents(2022, 01, 01),
new TimeComponents(12, 00, 00.000),
TimeScalesFactory.getUTC());
KeplerianOrbit orbit = new KeplerianOrbit(6871000, 0.00101606133264409,
FastMath.toRadians(50),
FastMath.toRadians(0), FastMath.toRadians(45),
FastMath.toRadians(0), PositionAngle.TRUE,
FramesFactory.getEME2000(), date, Constants.IERS2010_EARTH_MU);
final SpacecraftState initialState = new SpacecraftState(orbit, 250.0);
final OrbitType orbitType = OrbitType.EQUINOCTIAL;
final double[][] tol = NumericalPropagator.tolerances(1.0, orbit, orbitType);
final AdaptiveStepsizeIntegrator integrator =
new DormandPrince853Integrator(0.1,2.0,tol[0],tol[1]);
final NumericalPropagator propagator = new NumericalPropagator(integrator);
propagator.setOrbitType(orbitType);
propagator.setInitialState(initialState);
Vector3D thrustVector = new Vector3D(0,0,10);
AttitudeProvider attitudeOverride = new LofOffset(FramesFactory.getEME2000(), LOFType.VNC);
final AbsoluteDate firingDate = new AbsoluteDate(new DateComponents(2022, 01,
01),
new TimeComponents(12, 05, 00.000),
TimeScalesFactory.getUTC());
final DateDetector start_fire = new DateDetector(firingDate);
final DateDetector end_fire = new DateDetector(firingDate.shiftedBy(15));
final EventBasedManeuverTriggers triggers = new
EventBasedManeuverTriggers(start_fire,
end_fire, false);
final PropulsionModel propulsionModel =
new BasicConstantThrustPropulsionModel(thrustVector.getNorm(), 150,
Vector3D.PLUS_I,
"apogee-engine");
propagator.addForceModel(new Maneuver(attitudeOverride, triggers,
propulsionModel));
In this case I am adding to the propagator only one maneuver, but, suppose that now I add another maneuver exactly like the first one:
propagator.addForceModel(new Maneuver(attitudeOverride, triggers,
propulsionModel));
Now, If I have to decide if the maneuvers overlap, is that a simpler way than taking the maneuver triggers and check if the start trigger of the Nth maneuver is located between the start and end trigger of the first maneuver? (The example is with two maneuvers, but let’s suppose to have 100 maneuvers).
Another point, in this case I used date detectors, but what if the detectors to start/end the maneuver are not date detectors? (Consider for example apside detectors).
I hope that is clear what I want to achieve.
Thank you for your support.