use of org.orekit.propagation.events.NodeDetector in project Orekit by CS-SI.
the class EcksteinHechlerPropagatorTest method stopAtTargetDate.
@Test
public void stopAtTargetDate() throws OrekitException {
final KeplerianOrbit orbit = new KeplerianOrbit(7.8e6, 0.032, 0.4, 0.1, 0.2, 0.3, PositionAngle.TRUE, FramesFactory.getEME2000(), AbsoluteDate.J2000_EPOCH, 3.986004415e14);
EcksteinHechlerPropagator propagator = new EcksteinHechlerPropagator(orbit, provider);
Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
propagator.addEventDetector(new NodeDetector(orbit, itrf).withHandler(new ContinueOnEvent<NodeDetector>()));
AbsoluteDate farTarget = orbit.getDate().shiftedBy(10000.0);
SpacecraftState propagated = propagator.propagate(farTarget);
Assert.assertEquals(0.0, FastMath.abs(farTarget.durationFrom(propagated.getDate())), 1.0e-3);
}
use of org.orekit.propagation.events.NodeDetector in project Orekit by CS-SI.
the class ImpulseManeuverTest method testInclinationManeuver.
@Test
public void testInclinationManeuver() throws OrekitException {
final Orbit initialOrbit = new KeplerianOrbit(24532000.0, 0.72, 0.3, FastMath.PI, 0.4, 2.0, PositionAngle.MEAN, FramesFactory.getEME2000(), new AbsoluteDate(new DateComponents(2008, 06, 23), new TimeComponents(14, 18, 37), TimeScalesFactory.getUTC()), 3.986004415e14);
final double a = initialOrbit.getA();
final double e = initialOrbit.getE();
final double i = initialOrbit.getI();
final double mu = initialOrbit.getMu();
final double vApo = FastMath.sqrt(mu * (1 - e) / (a * (1 + e)));
double dv = 0.99 * FastMath.tan(i) * vApo;
KeplerianPropagator propagator = new KeplerianPropagator(initialOrbit, new LofOffset(initialOrbit.getFrame(), LOFType.VVLH));
propagator.addEventDetector(new ImpulseManeuver<NodeDetector>(new NodeDetector(initialOrbit, FramesFactory.getEME2000()), new Vector3D(dv, Vector3D.PLUS_J), 400.0));
SpacecraftState propagated = propagator.propagate(initialOrbit.getDate().shiftedBy(8000));
Assert.assertEquals(0.0028257, propagated.getI(), 1.0e-6);
}
use of org.orekit.propagation.events.NodeDetector in project Orekit by CS-SI.
the class DSSTPropagatorTest method testImpulseManeuver.
@Test
public void testImpulseManeuver() throws OrekitException {
final Orbit initialOrbit = new KeplerianOrbit(24532000.0, 0.72, 0.3, FastMath.PI, 0.4, 2.0, PositionAngle.MEAN, FramesFactory.getEME2000(), new AbsoluteDate(new DateComponents(2008, 06, 23), new TimeComponents(14, 18, 37), TimeScalesFactory.getUTC()), 3.986004415e14);
final double a = initialOrbit.getA();
final double e = initialOrbit.getE();
final double i = initialOrbit.getI();
final double mu = initialOrbit.getMu();
final double vApo = FastMath.sqrt(mu * (1 - e) / (a * (1 + e)));
double dv = 0.99 * FastMath.tan(i) * vApo;
// Set propagator with state
setDSSTProp(new SpacecraftState(initialOrbit));
// Add impulse maneuver
dsstProp.setAttitudeProvider(new LofOffset(initialOrbit.getFrame(), LOFType.VVLH));
dsstProp.addEventDetector(new ImpulseManeuver<NodeDetector>(new NodeDetector(initialOrbit, FramesFactory.getEME2000()), new Vector3D(dv, Vector3D.PLUS_J), 400.0));
SpacecraftState propagated = dsstProp.propagate(initialOrbit.getDate().shiftedBy(8000));
Assert.assertEquals(0.0028257, propagated.getI(), 1.0e-6);
}
use of org.orekit.propagation.events.NodeDetector in project Orekit by CS-SI.
the class KeplerianPropagatorTest method ascendingNode.
@Test
public void ascendingNode() throws OrekitException {
final KeplerianOrbit orbit = new KeplerianOrbit(7.8e6, 0.032, 0.4, 0.1, 0.2, 0.3, PositionAngle.TRUE, FramesFactory.getEME2000(), AbsoluteDate.J2000_EPOCH, 3.986004415e14);
KeplerianPropagator propagator = new KeplerianPropagator(orbit);
propagator.addEventDetector(new NodeDetector(orbit, FramesFactory.getITRF(IERSConventions.IERS_2010, true)));
AbsoluteDate farTarget = AbsoluteDate.J2000_EPOCH.shiftedBy(10000.0);
SpacecraftState propagated = propagator.propagate(farTarget);
PVCoordinates pv = propagated.getPVCoordinates(FramesFactory.getITRF(IERSConventions.IERS_2010, true));
Assert.assertTrue(farTarget.durationFrom(propagated.getDate()) > 3500.0);
Assert.assertTrue(farTarget.durationFrom(propagated.getDate()) < 4000.0);
Assert.assertEquals(0, pv.getPosition().getZ(), 2.0e-6);
Assert.assertTrue(pv.getVelocity().getZ() > 0);
}
use of org.orekit.propagation.events.NodeDetector in project Orekit by CS-SI.
the class KeplerianPropagatorTest method stopAtTargetDate.
@Test
public void stopAtTargetDate() throws OrekitException {
final KeplerianOrbit orbit = new KeplerianOrbit(7.8e6, 0.032, 0.4, 0.1, 0.2, 0.3, PositionAngle.TRUE, FramesFactory.getEME2000(), AbsoluteDate.J2000_EPOCH, 3.986004415e14);
KeplerianPropagator propagator = new KeplerianPropagator(orbit);
Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
propagator.addEventDetector(new NodeDetector(orbit, itrf).withHandler(new ContinueOnEvent<NodeDetector>()));
AbsoluteDate farTarget = orbit.getDate().shiftedBy(10000.0);
SpacecraftState propagated = propagator.propagate(farTarget);
Assert.assertEquals(0.0, FastMath.abs(farTarget.durationFrom(propagated.getDate())), 1.0e-3);
}
Aggregations