Search in sources :

Example 1 with GraggBulirschStoerIntegrator

use of org.hipparchus.ode.nonstiff.GraggBulirschStoerIntegrator in project Orekit by CS-SI.

the class ThirdBodyAttractionTest method testSunContrib.

@Test(expected = OrekitException.class)
public void testSunContrib() throws OrekitException {
    // initialization
    AbsoluteDate date = new AbsoluteDate(new DateComponents(1970, 07, 01), new TimeComponents(13, 59, 27.816), TimeScalesFactory.getUTC());
    Orbit orbit = new EquinoctialOrbit(42164000, 10e-3, 10e-3, FastMath.tan(0.001745329) * FastMath.cos(2 * FastMath.PI / 3), FastMath.tan(0.001745329) * FastMath.sin(2 * FastMath.PI / 3), 0.1, PositionAngle.TRUE, FramesFactory.getEME2000(), date, mu);
    double period = 2 * FastMath.PI * orbit.getA() * FastMath.sqrt(orbit.getA() / orbit.getMu());
    // set up propagator
    NumericalPropagator calc = new NumericalPropagator(new GraggBulirschStoerIntegrator(10.0, period, 0, 1.0e-5));
    calc.addForceModel(new ThirdBodyAttraction(CelestialBodyFactory.getSun()));
    // set up step handler to perform checks
    calc.setMasterMode(FastMath.floor(period), new ReferenceChecker(date) {

        protected double hXRef(double t) {
            return -1.06757e-3 + 0.221415e-11 * t + 18.9421e-5 * FastMath.cos(3.9820426e-7 * t) - 7.59983e-5 * FastMath.sin(3.9820426e-7 * t);
        }

        protected double hYRef(double t) {
            return 1.43526e-3 + 7.49765e-11 * t + 6.9448e-5 * FastMath.cos(3.9820426e-7 * t) + 17.6083e-5 * FastMath.sin(3.9820426e-7 * t);
        }
    });
    AbsoluteDate finalDate = date.shiftedBy(365 * period);
    calc.setInitialState(new SpacecraftState(orbit));
    calc.propagate(finalDate);
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) GraggBulirschStoerIntegrator(org.hipparchus.ode.nonstiff.GraggBulirschStoerIntegrator) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) CartesianOrbit(org.orekit.orbits.CartesianOrbit) FieldKeplerianOrbit(org.orekit.orbits.FieldKeplerianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Orbit(org.orekit.orbits.Orbit) NumericalPropagator(org.orekit.propagation.numerical.NumericalPropagator) FieldNumericalPropagator(org.orekit.propagation.numerical.FieldNumericalPropagator) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) DateComponents(org.orekit.time.DateComponents) TimeComponents(org.orekit.time.TimeComponents) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) AbstractLegacyForceModelTest(org.orekit.forces.AbstractLegacyForceModelTest) Test(org.junit.Test)

Example 2 with GraggBulirschStoerIntegrator

use of org.hipparchus.ode.nonstiff.GraggBulirschStoerIntegrator in project Orekit by CS-SI.

the class ThirdBodyAttractionTest method testMoonContrib.

@Test
public void testMoonContrib() throws OrekitException {
    // initialization
    AbsoluteDate date = new AbsoluteDate(new DateComponents(1970, 07, 01), new TimeComponents(13, 59, 27.816), TimeScalesFactory.getUTC());
    Orbit orbit = new EquinoctialOrbit(42164000, 10e-3, 10e-3, FastMath.tan(0.001745329) * FastMath.cos(2 * FastMath.PI / 3), FastMath.tan(0.001745329) * FastMath.sin(2 * FastMath.PI / 3), 0.1, PositionAngle.TRUE, FramesFactory.getEME2000(), date, mu);
    double period = 2 * FastMath.PI * orbit.getA() * FastMath.sqrt(orbit.getA() / orbit.getMu());
    // set up propagator
    NumericalPropagator calc = new NumericalPropagator(new GraggBulirschStoerIntegrator(10.0, period, 0, 1.0e-5));
    calc.addForceModel(new ThirdBodyAttraction(CelestialBodyFactory.getMoon()));
    // set up step handler to perform checks
    calc.setMasterMode(FastMath.floor(period), new ReferenceChecker(date) {

        protected double hXRef(double t) {
            return -0.000906173 + 1.93933e-11 * t + 1.0856e-06 * FastMath.cos(5.30637e-05 * t) - 1.22574e-06 * FastMath.sin(5.30637e-05 * t);
        }

        protected double hYRef(double t) {
            return 0.00151973 + 1.88991e-10 * t - 1.25972e-06 * FastMath.cos(5.30637e-05 * t) - 1.00581e-06 * FastMath.sin(5.30637e-05 * t);
        }
    });
    AbsoluteDate finalDate = date.shiftedBy(31 * period);
    calc.setInitialState(new SpacecraftState(orbit));
    calc.propagate(finalDate);
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) GraggBulirschStoerIntegrator(org.hipparchus.ode.nonstiff.GraggBulirschStoerIntegrator) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) CartesianOrbit(org.orekit.orbits.CartesianOrbit) FieldKeplerianOrbit(org.orekit.orbits.FieldKeplerianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Orbit(org.orekit.orbits.Orbit) NumericalPropagator(org.orekit.propagation.numerical.NumericalPropagator) FieldNumericalPropagator(org.orekit.propagation.numerical.FieldNumericalPropagator) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) DateComponents(org.orekit.time.DateComponents) TimeComponents(org.orekit.time.TimeComponents) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) AbstractLegacyForceModelTest(org.orekit.forces.AbstractLegacyForceModelTest) Test(org.junit.Test)

Example 3 with GraggBulirschStoerIntegrator

use of org.hipparchus.ode.nonstiff.GraggBulirschStoerIntegrator in project Orekit by CS-SI.

the class CloseEventsNumericalGBSTest method getPropagator.

/**
 * Create a propagator using the {@link #initialOrbit}.
 *
 * @param stepSize   of integrator.
 * @return a usable propagator.
 * @throws OrekitException
 */
public Propagator getPropagator(double stepSize) throws OrekitException {
    double[][] tol = NumericalPropagator.tolerances(1e-1, initialOrbit, OrbitType.CARTESIAN);
    final NumericalPropagator propagator = new NumericalPropagator(new GraggBulirschStoerIntegrator(stepSize, stepSize, tol[0], tol[1]));
    propagator.setInitialState(new SpacecraftState(initialOrbit));
    propagator.setOrbitType(OrbitType.CARTESIAN);
    return propagator;
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) GraggBulirschStoerIntegrator(org.hipparchus.ode.nonstiff.GraggBulirschStoerIntegrator) NumericalPropagator(org.orekit.propagation.numerical.NumericalPropagator)

Aggregations

GraggBulirschStoerIntegrator (org.hipparchus.ode.nonstiff.GraggBulirschStoerIntegrator)3 SpacecraftState (org.orekit.propagation.SpacecraftState)3 NumericalPropagator (org.orekit.propagation.numerical.NumericalPropagator)3 Test (org.junit.Test)2 AbstractLegacyForceModelTest (org.orekit.forces.AbstractLegacyForceModelTest)2 CartesianOrbit (org.orekit.orbits.CartesianOrbit)2 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)2 FieldKeplerianOrbit (org.orekit.orbits.FieldKeplerianOrbit)2 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)2 Orbit (org.orekit.orbits.Orbit)2 FieldSpacecraftState (org.orekit.propagation.FieldSpacecraftState)2 FieldNumericalPropagator (org.orekit.propagation.numerical.FieldNumericalPropagator)2 AbsoluteDate (org.orekit.time.AbsoluteDate)2 DateComponents (org.orekit.time.DateComponents)2 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)2 TimeComponents (org.orekit.time.TimeComponents)2