I want to use Kepler element to propagate the orbit, and then use ApsideDetector to detect the orbit apogee, perigee time and the corresponding orbit height. After I run, there is no output from the console. Would you please help me check if there is any problem with the event generator I wrote? Here is the event generator code I wrote.
ApsideDetector apsideDetector = new ApsideDetector(initialOrbit)
.withHandler((state, detector, increasing) → {
// Print the apside time and altitude
if (increasing) {
System.out.println("apogeeTime: "+state.getDate() + "apogeeAltitude: "+ (state.getOrbit().getA()(1 - state.getOrbit().getE()) -
Constants.EIGEN5C_EARTH_EQUATORIAL_RADIUS));
} else {
System.out.println("perigeeTime: "+state.getDate() + "perigeeAltitude: "+ (state.getOrbit().getA()(1 - state.getOrbit().getE()) -
Constants.EIGEN5C_EARTH_EQUATORIAL_RADIUS));
}
return Action.CONTINUE;
});
// Add event to be detected
numericalPropagator.addEventDetector(apsideDetector);
This issue is my problem solved
1 Like