Search in sources :

Example 1 with NodeDetector

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);
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) Frame(org.orekit.frames.Frame) TopocentricFrame(org.orekit.frames.TopocentricFrame) ContinueOnEvent(org.orekit.propagation.events.handlers.ContinueOnEvent) NodeDetector(org.orekit.propagation.events.NodeDetector) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 2 with NodeDetector

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);
}
Also used : KeplerianPropagator(org.orekit.propagation.analytical.KeplerianPropagator) SpacecraftState(org.orekit.propagation.SpacecraftState) Orbit(org.orekit.orbits.Orbit) CartesianOrbit(org.orekit.orbits.CartesianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) NodeDetector(org.orekit.propagation.events.NodeDetector) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) DateComponents(org.orekit.time.DateComponents) TimeComponents(org.orekit.time.TimeComponents) LofOffset(org.orekit.attitudes.LofOffset) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 3 with NodeDetector

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);
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) CartesianOrbit(org.orekit.orbits.CartesianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Orbit(org.orekit.orbits.Orbit) CircularOrbit(org.orekit.orbits.CircularOrbit) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) NodeDetector(org.orekit.propagation.events.NodeDetector) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) DateComponents(org.orekit.time.DateComponents) TimeComponents(org.orekit.time.TimeComponents) LofOffset(org.orekit.attitudes.LofOffset) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 4 with NodeDetector

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);
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) NodeDetector(org.orekit.propagation.events.NodeDetector) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates) PVCoordinates(org.orekit.utils.PVCoordinates) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 5 with NodeDetector

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);
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) Frame(org.orekit.frames.Frame) TopocentricFrame(org.orekit.frames.TopocentricFrame) ContinueOnEvent(org.orekit.propagation.events.handlers.ContinueOnEvent) NodeDetector(org.orekit.propagation.events.NodeDetector) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)6 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)6 SpacecraftState (org.orekit.propagation.SpacecraftState)6 NodeDetector (org.orekit.propagation.events.NodeDetector)6 AbsoluteDate (org.orekit.time.AbsoluteDate)6 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)4 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)2 LofOffset (org.orekit.attitudes.LofOffset)2 Frame (org.orekit.frames.Frame)2 TopocentricFrame (org.orekit.frames.TopocentricFrame)2 CartesianOrbit (org.orekit.orbits.CartesianOrbit)2 Orbit (org.orekit.orbits.Orbit)2 ContinueOnEvent (org.orekit.propagation.events.handlers.ContinueOnEvent)2 DateComponents (org.orekit.time.DateComponents)2 TimeComponents (org.orekit.time.TimeComponents)2 PVCoordinates (org.orekit.utils.PVCoordinates)2 TimeStampedPVCoordinates (org.orekit.utils.TimeStampedPVCoordinates)2 CircularOrbit (org.orekit.orbits.CircularOrbit)1 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)1 KeplerianPropagator (org.orekit.propagation.analytical.KeplerianPropagator)1