Search in sources :

Example 11 with EquinoctialOrbit

use of org.orekit.orbits.EquinoctialOrbit in project Orekit by CS-SI.

the class EcksteinHechlerPropagatorTest method almostSphericalBody.

@Test
public void almostSphericalBody() throws OrekitException {
    // Definition of initial conditions
    // ---------------------------------
    // with e around e = 1.4e-4 and i = 1.7 rad
    Vector3D position = new Vector3D(3220103., 69623., 6449822.);
    Vector3D velocity = new Vector3D(6414.7, -2006., -3180.);
    AbsoluteDate initDate = AbsoluteDate.J2000_EPOCH.shiftedBy(584.);
    Orbit initialOrbit = new EquinoctialOrbit(new PVCoordinates(position, velocity), FramesFactory.getEME2000(), initDate, provider.getMu());
    // Initialisation to simulate a Keplerian extrapolation
    // To be noticed: in order to simulate a Keplerian extrapolation with the
    // analytical
    // extrapolator, one should put the zonal coefficients to 0. But due to
    // numerical pbs
    // one must put a non 0 value.
    UnnormalizedSphericalHarmonicsProvider kepProvider = GravityFieldFactory.getUnnormalizedProvider(6.378137e6, 3.9860047e14, TideSystem.UNKNOWN, new double[][] { { 0 }, { 0 }, { 0.1e-10 }, { 0.1e-13 }, { 0.1e-13 }, { 0.1e-14 }, { 0.1e-14 } }, new double[][] { { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 } });
    // Extrapolators definitions
    // -------------------------
    EcksteinHechlerPropagator extrapolatorAna = new EcksteinHechlerPropagator(initialOrbit, 1000.0, kepProvider);
    KeplerianPropagator extrapolatorKep = new KeplerianPropagator(initialOrbit);
    // Extrapolation at a final date different from initial date
    // ---------------------------------------------------------
    // extrapolation duration in seconds
    double delta_t = 100.0;
    AbsoluteDate extrapDate = initDate.shiftedBy(delta_t);
    SpacecraftState finalOrbitAna = extrapolatorAna.propagate(extrapDate);
    SpacecraftState finalOrbitKep = extrapolatorKep.propagate(extrapDate);
    Assert.assertEquals(finalOrbitAna.getDate().durationFrom(extrapDate), 0.0, Utils.epsilonTest);
    // comparison of each orbital parameters
    Assert.assertEquals(finalOrbitAna.getA(), finalOrbitKep.getA(), 10 * Utils.epsilonTest * finalOrbitKep.getA());
    Assert.assertEquals(finalOrbitAna.getEquinoctialEx(), finalOrbitKep.getEquinoctialEx(), Utils.epsilonE * finalOrbitKep.getE());
    Assert.assertEquals(finalOrbitAna.getEquinoctialEy(), finalOrbitKep.getEquinoctialEy(), Utils.epsilonE * finalOrbitKep.getE());
    Assert.assertEquals(MathUtils.normalizeAngle(finalOrbitAna.getHx(), finalOrbitKep.getHx()), finalOrbitKep.getHx(), Utils.epsilonAngle * FastMath.abs(finalOrbitKep.getI()));
    Assert.assertEquals(MathUtils.normalizeAngle(finalOrbitAna.getHy(), finalOrbitKep.getHy()), finalOrbitKep.getHy(), Utils.epsilonAngle * FastMath.abs(finalOrbitKep.getI()));
    Assert.assertEquals(MathUtils.normalizeAngle(finalOrbitAna.getLv(), finalOrbitKep.getLv()), finalOrbitKep.getLv(), Utils.epsilonAngle * FastMath.abs(finalOrbitKep.getLv()));
    Assert.assertEquals(MathUtils.normalizeAngle(finalOrbitAna.getLE(), finalOrbitKep.getLE()), finalOrbitKep.getLE(), Utils.epsilonAngle * FastMath.abs(finalOrbitKep.getLE()));
    Assert.assertEquals(MathUtils.normalizeAngle(finalOrbitAna.getLM(), finalOrbitKep.getLM()), finalOrbitKep.getLM(), Utils.epsilonAngle * FastMath.abs(finalOrbitKep.getLM()));
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Orbit(org.orekit.orbits.Orbit) CircularOrbit(org.orekit.orbits.CircularOrbit) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) UnnormalizedSphericalHarmonicsProvider(org.orekit.forces.gravity.potential.UnnormalizedSphericalHarmonicsProvider) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates) PVCoordinates(org.orekit.utils.PVCoordinates) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 12 with EquinoctialOrbit

use of org.orekit.orbits.EquinoctialOrbit in project Orekit by CS-SI.

the class EcksteinHechlerPropagatorTest method sameDateCartesian.

@Test
public void sameDateCartesian() throws OrekitException {
    // Definition of initial conditions with position and velocity
    // ------------------------------------------------------------
    // with e around e = 1.4e-4 and i = 1.7 rad
    Vector3D position = new Vector3D(3220103., 69623., 6449822.);
    Vector3D velocity = new Vector3D(6414.7, -2006., -3180.);
    AbsoluteDate initDate = AbsoluteDate.J2000_EPOCH.shiftedBy(584.);
    Orbit initialOrbit = new EquinoctialOrbit(new PVCoordinates(position, velocity), FramesFactory.getEME2000(), initDate, provider.getMu());
    // Extrapolator definition
    // -----------------------
    EcksteinHechlerPropagator extrapolator = new EcksteinHechlerPropagator(initialOrbit, provider);
    // Extrapolation at the initial date
    // ---------------------------------
    SpacecraftState finalOrbit = extrapolator.propagate(initDate);
    // positions match perfectly
    Assert.assertEquals(0.0, Vector3D.distance(initialOrbit.getPVCoordinates().getPosition(), finalOrbit.getPVCoordinates().getPosition()), 1.0e-8);
    // velocity and circular parameters do *not* match, this is EXPECTED!
    // the reason is that we ensure position/velocity are consistent with the
    // evolution of the orbit, and this includes the non-Keplerian effects,
    // whereas the initial orbit is Keplerian only. The implementation of the
    // model is such that rather than having a perfect match at initial point
    // (either in velocity or in circular parameters), we have a propagated orbit
    // that remains close to a numerical reference throughout the orbit.
    // This is shown in the testInitializationCorrectness() where a numerical
    // fit is used to check initialization
    Assert.assertEquals(0.137, Vector3D.distance(initialOrbit.getPVCoordinates().getVelocity(), finalOrbit.getPVCoordinates().getVelocity()), 1.0e-3);
    Assert.assertEquals(125.2, finalOrbit.getA() - initialOrbit.getA(), 0.1);
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Orbit(org.orekit.orbits.Orbit) CircularOrbit(org.orekit.orbits.CircularOrbit) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates) PVCoordinates(org.orekit.utils.PVCoordinates) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 13 with EquinoctialOrbit

use of org.orekit.orbits.EquinoctialOrbit in project Orekit by CS-SI.

the class EcksteinHechlerPropagatorTest method tooEllipticalOrbit.

@Test(expected = OrekitException.class)
public void tooEllipticalOrbit() throws OrekitException {
    // for an eccentricity too big for the model
    Vector3D position = new Vector3D(7.0e6, 1.0e6, 4.0e6);
    Vector3D velocity = new Vector3D(-500.0, 8000.0, 1000.0);
    AbsoluteDate initDate = AbsoluteDate.J2000_EPOCH;
    Orbit initialOrbit = new EquinoctialOrbit(new PVCoordinates(position, velocity), FramesFactory.getEME2000(), initDate, provider.getMu());
    // Extrapolator definition
    // -----------------------
    EcksteinHechlerPropagator extrapolator = new EcksteinHechlerPropagator(initialOrbit, provider);
    // Extrapolation at the initial date
    // ---------------------------------
    double delta_t = 0.0;
    AbsoluteDate extrapDate = initDate.shiftedBy(delta_t);
    extrapolator.propagate(extrapDate);
}
Also used : EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Orbit(org.orekit.orbits.Orbit) CircularOrbit(org.orekit.orbits.CircularOrbit) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates) PVCoordinates(org.orekit.utils.PVCoordinates) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 14 with EquinoctialOrbit

use of org.orekit.orbits.EquinoctialOrbit in project Orekit by CS-SI.

the class TabulatedEphemerisTest method testPiWraping.

@Test
public void testPiWraping() throws OrekitException {
    TimeScale utc = TimeScalesFactory.getUTC();
    Frame frame = FramesFactory.getEME2000();
    double mu = CelestialBodyFactory.getEarth().getGM();
    AbsoluteDate t0 = new AbsoluteDate(2009, 10, 29, 0, 0, 0, utc);
    AbsoluteDate t1 = new AbsoluteDate(t0, 1320.0);
    Vector3D p1 = new Vector3D(-0.17831296727974E+08, 0.67919502669856E+06, -0.16591008368477E+07);
    Vector3D v1 = new Vector3D(-0.38699705630724E+04, -0.36209408682762E+04, -0.16255053872347E+03);
    SpacecraftState s1 = new SpacecraftState(new EquinoctialOrbit(new PVCoordinates(p1, v1), frame, t1, mu));
    AbsoluteDate t2 = new AbsoluteDate(t0, 1440.0);
    Vector3D p2 = new Vector3D(-0.18286942572033E+08, 0.24442124296930E+06, -0.16777961761695E+07);
    Vector3D v2 = new Vector3D(-0.37252897467918E+04, -0.36246628128896E+04, -0.14917724596280E+03);
    SpacecraftState s2 = new SpacecraftState(new EquinoctialOrbit(new PVCoordinates(p2, v2), frame, t2, mu));
    AbsoluteDate t3 = new AbsoluteDate(t0, 1560.0);
    Vector3D p3 = new Vector3D(-0.18725635245837E+08, -0.19058407701834E+06, -0.16949352249614E+07);
    Vector3D v3 = new Vector3D(-0.35873348682393E+04, -0.36248828501784E+04, -0.13660045394149E+03);
    SpacecraftState s3 = new SpacecraftState(new EquinoctialOrbit(new PVCoordinates(p3, v3), frame, t3, mu));
    Ephemeris ephem = new Ephemeris(Arrays.asList(s1, s2, s3), 2);
    AbsoluteDate tA = new AbsoluteDate(t0, 24 * 60);
    Vector3D pA = ephem.propagate(tA).getPVCoordinates(frame).getPosition();
    Assert.assertEquals(1.766, Vector3D.distance(pA, s1.shiftedBy(tA.durationFrom(s1.getDate())).getPVCoordinates(frame).getPosition()), 1.0e-3);
    Assert.assertEquals(0.000, Vector3D.distance(pA, s2.shiftedBy(tA.durationFrom(s2.getDate())).getPVCoordinates(frame).getPosition()), 1.0e-3);
    Assert.assertEquals(1.556, Vector3D.distance(pA, s3.shiftedBy(tA.durationFrom(s3.getDate())).getPVCoordinates(frame).getPosition()), 1.0e-3);
    AbsoluteDate tB = new AbsoluteDate(t0, 25 * 60);
    Vector3D pB = ephem.propagate(tB).getPVCoordinates(frame).getPosition();
    Assert.assertEquals(2.646, Vector3D.distance(pB, s1.shiftedBy(tB.durationFrom(s1.getDate())).getPVCoordinates(frame).getPosition()), 1.0e-3);
    Assert.assertEquals(2.619, Vector3D.distance(pB, s2.shiftedBy(tB.durationFrom(s2.getDate())).getPVCoordinates(frame).getPosition()), 1.0e-3);
    Assert.assertEquals(2.632, Vector3D.distance(pB, s3.shiftedBy(tB.durationFrom(s3.getDate())).getPVCoordinates(frame).getPosition()), 1.0e-3);
    AbsoluteDate tC = new AbsoluteDate(t0, 26 * 60);
    Vector3D pC = ephem.propagate(tC).getPVCoordinates(frame).getPosition();
    Assert.assertEquals(6.851, Vector3D.distance(pC, s1.shiftedBy(tC.durationFrom(s1.getDate())).getPVCoordinates(frame).getPosition()), 1.0e-3);
    Assert.assertEquals(1.605, Vector3D.distance(pC, s2.shiftedBy(tC.durationFrom(s2.getDate())).getPVCoordinates(frame).getPosition()), 1.0e-3);
    Assert.assertEquals(0.000, Vector3D.distance(pC, s3.shiftedBy(tC.durationFrom(s3.getDate())).getPVCoordinates(frame).getPosition()), 1.0e-3);
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) Frame(org.orekit.frames.Frame) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates) PVCoordinates(org.orekit.utils.PVCoordinates) TimeScale(org.orekit.time.TimeScale) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 15 with EquinoctialOrbit

use of org.orekit.orbits.EquinoctialOrbit in project Orekit by CS-SI.

the class DateDetectorTest method setUp.

@Before
public void setUp() {
    try {
        Utils.setDataRoot("regular-data");
        final double mu = 3.9860047e14;
        final Vector3D position = new Vector3D(-6142438.668, 3492467.560, -25767.25680);
        final Vector3D velocity = new Vector3D(505.8479685, 942.7809215, 7435.922231);
        iniDate = new AbsoluteDate(1969, 7, 28, 4, 0, 0.0, TimeScalesFactory.getTT());
        iniOrbit = new EquinoctialOrbit(new PVCoordinates(position, velocity), FramesFactory.getEME2000(), iniDate, mu);
        SpacecraftState initialState = new SpacecraftState(iniOrbit);
        double[] absTolerance = { 0.001, 1.0e-9, 1.0e-9, 1.0e-6, 1.0e-6, 1.0e-6, 0.001 };
        double[] relTolerance = { 1.0e-7, 1.0e-4, 1.0e-4, 1.0e-7, 1.0e-7, 1.0e-7, 1.0e-7 };
        AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(0.001, 1000, absTolerance, relTolerance);
        integrator.setInitialStepSize(60);
        propagator = new NumericalPropagator(integrator);
        propagator.setInitialState(initialState);
        dt = 60.;
        maxCheck = 10.;
        threshold = 10.e-10;
        evtno = 0;
    } catch (OrekitException oe) {
        Assert.fail(oe.getLocalizedMessage());
    }
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) NumericalPropagator(org.orekit.propagation.numerical.NumericalPropagator) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) AdaptiveStepsizeIntegrator(org.hipparchus.ode.nonstiff.AdaptiveStepsizeIntegrator) PVCoordinates(org.orekit.utils.PVCoordinates) OrekitException(org.orekit.errors.OrekitException) DormandPrince853Integrator(org.hipparchus.ode.nonstiff.DormandPrince853Integrator) AbsoluteDate(org.orekit.time.AbsoluteDate) Before(org.junit.Before)

Aggregations

EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)58 AbsoluteDate (org.orekit.time.AbsoluteDate)49 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)48 PVCoordinates (org.orekit.utils.PVCoordinates)46 Orbit (org.orekit.orbits.Orbit)37 SpacecraftState (org.orekit.propagation.SpacecraftState)34 Test (org.junit.Test)29 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)25 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)20 Before (org.junit.Before)18 TimeStampedPVCoordinates (org.orekit.utils.TimeStampedPVCoordinates)18 TimeScale (org.orekit.time.TimeScale)16 Frame (org.orekit.frames.Frame)15 CartesianOrbit (org.orekit.orbits.CartesianOrbit)15 CircularOrbit (org.orekit.orbits.CircularOrbit)15 EcksteinHechlerPropagator (org.orekit.propagation.analytical.EcksteinHechlerPropagator)13 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)13 OrekitException (org.orekit.errors.OrekitException)12 Propagator (org.orekit.propagation.Propagator)11 KeplerianPropagator (org.orekit.propagation.analytical.KeplerianPropagator)10