Search in sources :

Example 1 with FieldNodeDetector

use of org.orekit.propagation.events.FieldNodeDetector in project Orekit by CS-SI.

the class FieldEcksteinHechlerPropagatorTest method doStopAtTargetDate.

private <T extends RealFieldElement<T>> void doStopAtTargetDate(Field<T> field) throws OrekitException {
    T zero = field.getZero();
    FieldAbsoluteDate<T> date = new FieldAbsoluteDate<>(field);
    final FieldKeplerianOrbit<T> orbit = new FieldKeplerianOrbit<>(zero.add(7.8e6), zero.add(0.032), zero.add(0.4), zero.add(0.1), zero.add(0.2), zero.add(0.3), PositionAngle.TRUE, FramesFactory.getEME2000(), date, 3.986004415e14);
    FieldEcksteinHechlerPropagator<T> propagator = new FieldEcksteinHechlerPropagator<>(orbit, provider);
    Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
    propagator.addEventDetector(new FieldNodeDetector<>(orbit, itrf).withHandler(new FieldContinueOnEvent<FieldNodeDetector<T>, T>()));
    FieldAbsoluteDate<T> farTarget = orbit.getDate().shiftedBy(10000.0);
    FieldSpacecraftState<T> propagated = propagator.propagate(farTarget);
    Assert.assertEquals(0.0, FastMath.abs(farTarget.durationFrom(propagated.getDate()).getReal()), 1.0e-3);
}
Also used : Frame(org.orekit.frames.Frame) TopocentricFrame(org.orekit.frames.TopocentricFrame) FieldNodeDetector(org.orekit.propagation.events.FieldNodeDetector) FieldContinueOnEvent(org.orekit.propagation.events.handlers.FieldContinueOnEvent) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) FieldKeplerianOrbit(org.orekit.orbits.FieldKeplerianOrbit)

Example 2 with FieldNodeDetector

use of org.orekit.propagation.events.FieldNodeDetector in project Orekit by CS-SI.

the class FieldKeplerianPropagatorTest method doTestStopAtTargetDate.

private <T extends RealFieldElement<T>> void doTestStopAtTargetDate(Field<T> field) throws OrekitException {
    T zero = field.getZero();
    final FieldKeplerianOrbit<T> orbit = new FieldKeplerianOrbit<>(zero.add(7.8e6), zero.add(0.032), zero.add(0.4), zero.add(0.1), zero.add(0.2), zero.add(0.3), PositionAngle.TRUE, FramesFactory.getEME2000(), new FieldAbsoluteDate<>(field), 3.986004415e14);
    FieldKeplerianPropagator<T> propagator = new FieldKeplerianPropagator<>(orbit);
    Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
    propagator.addEventDetector(new FieldNodeDetector<>(orbit, itrf).withHandler(new FieldContinueOnEvent<FieldNodeDetector<T>, T>()));
    FieldAbsoluteDate<T> farTarget = orbit.getDate().shiftedBy(10000.0);
    FieldSpacecraftState<T> propagated = propagator.propagate(farTarget);
    Assert.assertEquals(0.0, FastMath.abs(farTarget.durationFrom(propagated.getDate()).getReal()), 1.0e-3);
}
Also used : Frame(org.orekit.frames.Frame) TopocentricFrame(org.orekit.frames.TopocentricFrame) FieldNodeDetector(org.orekit.propagation.events.FieldNodeDetector) FieldContinueOnEvent(org.orekit.propagation.events.handlers.FieldContinueOnEvent) FieldKeplerianOrbit(org.orekit.orbits.FieldKeplerianOrbit)

Aggregations

Frame (org.orekit.frames.Frame)2 TopocentricFrame (org.orekit.frames.TopocentricFrame)2 FieldKeplerianOrbit (org.orekit.orbits.FieldKeplerianOrbit)2 FieldNodeDetector (org.orekit.propagation.events.FieldNodeDetector)2 FieldContinueOnEvent (org.orekit.propagation.events.handlers.FieldContinueOnEvent)2 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)1