Search in sources :

Example 1 with AbstractIntegratedPropagator

use of org.orekit.propagation.integration.AbstractIntegratedPropagator in project Orekit by CS-SI.

the class NumericalPropagatorTest method testNotInitialised2.

@Test(expected = OrekitException.class)
public void testNotInitialised2() throws OrekitException {
    final AbstractIntegratedPropagator notInitialised = new NumericalPropagator(new ClassicalRungeKuttaIntegrator(10.0));
    notInitialised.propagate(AbsoluteDate.J2000_EPOCH, AbsoluteDate.J2000_EPOCH.shiftedBy(3600));
}
Also used : AbstractIntegratedPropagator(org.orekit.propagation.integration.AbstractIntegratedPropagator) ClassicalRungeKuttaIntegrator(org.hipparchus.ode.nonstiff.ClassicalRungeKuttaIntegrator) Test(org.junit.Test)

Example 2 with AbstractIntegratedPropagator

use of org.orekit.propagation.integration.AbstractIntegratedPropagator in project Orekit by CS-SI.

the class NumericalPropagatorTest method testNotInitialised1.

@Test(expected = OrekitException.class)
public void testNotInitialised1() throws OrekitException {
    final AbstractIntegratedPropagator notInitialised = new NumericalPropagator(new ClassicalRungeKuttaIntegrator(10.0));
    notInitialised.propagate(AbsoluteDate.J2000_EPOCH);
}
Also used : AbstractIntegratedPropagator(org.orekit.propagation.integration.AbstractIntegratedPropagator) ClassicalRungeKuttaIntegrator(org.hipparchus.ode.nonstiff.ClassicalRungeKuttaIntegrator) Test(org.junit.Test)

Example 3 with AbstractIntegratedPropagator

use of org.orekit.propagation.integration.AbstractIntegratedPropagator in project Orekit by CS-SI.

the class PartialDerivativesTest method testPropagationTypesElliptical.

@Test
public void testPropagationTypesElliptical() throws OrekitException {
    NormalizedSphericalHarmonicsProvider provider = GravityFieldFactory.getNormalizedProvider(5, 5);
    ForceModel gravityField = new HolmesFeatherstoneAttractionModel(FramesFactory.getITRF(IERSConventions.IERS_2010, true), provider);
    Orbit initialOrbit = new KeplerianOrbit(8000000.0, 0.01, 0.1, 0.7, 0, 1.2, PositionAngle.TRUE, FramesFactory.getEME2000(), AbsoluteDate.J2000_EPOCH, provider.getMu());
    double dt = 900;
    double dP = 0.001;
    for (OrbitType orbitType : OrbitType.values()) {
        for (PositionAngle angleType : PositionAngle.values()) {
            // compute state Jacobian using PartialDerivatives
            NumericalPropagator propagator = setUpPropagator(initialOrbit, dP, orbitType, angleType, gravityField);
            PartialDerivativesEquations partials = new PartialDerivativesEquations("partials", propagator);
            final SpacecraftState initialState = partials.setInitialJacobians(new SpacecraftState(initialOrbit));
            propagator.setInitialState(initialState);
            final JacobiansMapper mapper = partials.getMapper();
            PickUpHandler pickUp = new PickUpHandler(mapper, null);
            propagator.setMasterMode(pickUp);
            propagator.propagate(initialState.getDate().shiftedBy(dt));
            double[][] dYdY0 = pickUp.getdYdY0();
            // compute reference state Jacobian using finite differences
            double[][] dYdY0Ref = new double[6][6];
            AbstractIntegratedPropagator propagator2 = setUpPropagator(initialOrbit, dP, orbitType, angleType, gravityField);
            double[] steps = NumericalPropagator.tolerances(1000000 * dP, initialOrbit, orbitType)[0];
            for (int i = 0; i < 6; ++i) {
                propagator2.resetInitialState(shiftState(initialState, orbitType, angleType, -4 * steps[i], i));
                SpacecraftState sM4h = propagator2.propagate(initialState.getDate().shiftedBy(dt));
                propagator2.resetInitialState(shiftState(initialState, orbitType, angleType, -3 * steps[i], i));
                SpacecraftState sM3h = propagator2.propagate(initialState.getDate().shiftedBy(dt));
                propagator2.resetInitialState(shiftState(initialState, orbitType, angleType, -2 * steps[i], i));
                SpacecraftState sM2h = propagator2.propagate(initialState.getDate().shiftedBy(dt));
                propagator2.resetInitialState(shiftState(initialState, orbitType, angleType, -1 * steps[i], i));
                SpacecraftState sM1h = propagator2.propagate(initialState.getDate().shiftedBy(dt));
                propagator2.resetInitialState(shiftState(initialState, orbitType, angleType, 1 * steps[i], i));
                SpacecraftState sP1h = propagator2.propagate(initialState.getDate().shiftedBy(dt));
                propagator2.resetInitialState(shiftState(initialState, orbitType, angleType, 2 * steps[i], i));
                SpacecraftState sP2h = propagator2.propagate(initialState.getDate().shiftedBy(dt));
                propagator2.resetInitialState(shiftState(initialState, orbitType, angleType, 3 * steps[i], i));
                SpacecraftState sP3h = propagator2.propagate(initialState.getDate().shiftedBy(dt));
                propagator2.resetInitialState(shiftState(initialState, orbitType, angleType, 4 * steps[i], i));
                SpacecraftState sP4h = propagator2.propagate(initialState.getDate().shiftedBy(dt));
                fillJacobianColumn(dYdY0Ref, i, orbitType, angleType, steps[i], sM4h, sM3h, sM2h, sM1h, sP1h, sP2h, sP3h, sP4h);
            }
            for (int i = 0; i < 6; ++i) {
                for (int j = 0; j < 6; ++j) {
                    double error = FastMath.abs((dYdY0[i][j] - dYdY0Ref[i][j]) / dYdY0Ref[i][j]);
                    Assert.assertEquals(0, error, 6.0e-2);
                }
            }
        }
    }
}
Also used : ForceModel(org.orekit.forces.ForceModel) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Orbit(org.orekit.orbits.Orbit) PositionAngle(org.orekit.orbits.PositionAngle) AbstractIntegratedPropagator(org.orekit.propagation.integration.AbstractIntegratedPropagator) SpacecraftState(org.orekit.propagation.SpacecraftState) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) OrbitType(org.orekit.orbits.OrbitType) NormalizedSphericalHarmonicsProvider(org.orekit.forces.gravity.potential.NormalizedSphericalHarmonicsProvider) HolmesFeatherstoneAttractionModel(org.orekit.forces.gravity.HolmesFeatherstoneAttractionModel) Test(org.junit.Test)

Example 4 with AbstractIntegratedPropagator

use of org.orekit.propagation.integration.AbstractIntegratedPropagator in project Orekit by CS-SI.

the class PartialDerivativesTest method testPropagationTypesHyperbolic.

@Test
public void testPropagationTypesHyperbolic() throws OrekitException {
    NormalizedSphericalHarmonicsProvider provider = GravityFieldFactory.getNormalizedProvider(5, 5);
    ForceModel gravityField = new HolmesFeatherstoneAttractionModel(FramesFactory.getITRF(IERSConventions.IERS_2010, true), provider);
    Orbit initialOrbit = new KeplerianOrbit(new PVCoordinates(new Vector3D(-1551946.0, 708899.0, 6788204.0), new Vector3D(-9875.0, -3941.0, -1845.0)), FramesFactory.getEME2000(), AbsoluteDate.J2000_EPOCH, provider.getMu());
    double dt = 900;
    double dP = 0.001;
    for (OrbitType orbitType : new OrbitType[] { OrbitType.KEPLERIAN, OrbitType.CARTESIAN }) {
        for (PositionAngle angleType : PositionAngle.values()) {
            // compute state Jacobian using PartialDerivatives
            NumericalPropagator propagator = setUpPropagator(initialOrbit, dP, orbitType, angleType, gravityField);
            PartialDerivativesEquations partials = new PartialDerivativesEquations("partials", propagator);
            final SpacecraftState initialState = partials.setInitialJacobians(new SpacecraftState(initialOrbit));
            propagator.setInitialState(initialState);
            final JacobiansMapper mapper = partials.getMapper();
            PickUpHandler pickUp = new PickUpHandler(mapper, null);
            propagator.setMasterMode(pickUp);
            propagator.propagate(initialState.getDate().shiftedBy(dt));
            double[][] dYdY0 = pickUp.getdYdY0();
            // compute reference state Jacobian using finite differences
            double[][] dYdY0Ref = new double[6][6];
            AbstractIntegratedPropagator propagator2 = setUpPropagator(initialOrbit, dP, orbitType, angleType, gravityField);
            double[] steps = NumericalPropagator.tolerances(1000000 * dP, initialOrbit, orbitType)[0];
            for (int i = 0; i < 6; ++i) {
                propagator2.resetInitialState(shiftState(initialState, orbitType, angleType, -4 * steps[i], i));
                SpacecraftState sM4h = propagator2.propagate(initialState.getDate().shiftedBy(dt));
                propagator2.resetInitialState(shiftState(initialState, orbitType, angleType, -3 * steps[i], i));
                SpacecraftState sM3h = propagator2.propagate(initialState.getDate().shiftedBy(dt));
                propagator2.resetInitialState(shiftState(initialState, orbitType, angleType, -2 * steps[i], i));
                SpacecraftState sM2h = propagator2.propagate(initialState.getDate().shiftedBy(dt));
                propagator2.resetInitialState(shiftState(initialState, orbitType, angleType, -1 * steps[i], i));
                SpacecraftState sM1h = propagator2.propagate(initialState.getDate().shiftedBy(dt));
                propagator2.resetInitialState(shiftState(initialState, orbitType, angleType, 1 * steps[i], i));
                SpacecraftState sP1h = propagator2.propagate(initialState.getDate().shiftedBy(dt));
                propagator2.resetInitialState(shiftState(initialState, orbitType, angleType, 2 * steps[i], i));
                SpacecraftState sP2h = propagator2.propagate(initialState.getDate().shiftedBy(dt));
                propagator2.resetInitialState(shiftState(initialState, orbitType, angleType, 3 * steps[i], i));
                SpacecraftState sP3h = propagator2.propagate(initialState.getDate().shiftedBy(dt));
                propagator2.resetInitialState(shiftState(initialState, orbitType, angleType, 4 * steps[i], i));
                SpacecraftState sP4h = propagator2.propagate(initialState.getDate().shiftedBy(dt));
                fillJacobianColumn(dYdY0Ref, i, orbitType, angleType, steps[i], sM4h, sM3h, sM2h, sM1h, sP1h, sP2h, sP3h, sP4h);
            }
            for (int i = 0; i < 6; ++i) {
                for (int j = 0; j < 6; ++j) {
                    double error = FastMath.abs((dYdY0[i][j] - dYdY0Ref[i][j]) / dYdY0Ref[i][j]);
                    Assert.assertEquals(0, error, 1.0e-3);
                }
            }
        }
    }
}
Also used : ForceModel(org.orekit.forces.ForceModel) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Orbit(org.orekit.orbits.Orbit) PositionAngle(org.orekit.orbits.PositionAngle) PVCoordinates(org.orekit.utils.PVCoordinates) AbstractIntegratedPropagator(org.orekit.propagation.integration.AbstractIntegratedPropagator) SpacecraftState(org.orekit.propagation.SpacecraftState) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) OrbitType(org.orekit.orbits.OrbitType) NormalizedSphericalHarmonicsProvider(org.orekit.forces.gravity.potential.NormalizedSphericalHarmonicsProvider) HolmesFeatherstoneAttractionModel(org.orekit.forces.gravity.HolmesFeatherstoneAttractionModel) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)4 AbstractIntegratedPropagator (org.orekit.propagation.integration.AbstractIntegratedPropagator)4 ClassicalRungeKuttaIntegrator (org.hipparchus.ode.nonstiff.ClassicalRungeKuttaIntegrator)2 ForceModel (org.orekit.forces.ForceModel)2 HolmesFeatherstoneAttractionModel (org.orekit.forces.gravity.HolmesFeatherstoneAttractionModel)2 NormalizedSphericalHarmonicsProvider (org.orekit.forces.gravity.potential.NormalizedSphericalHarmonicsProvider)2 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)2 Orbit (org.orekit.orbits.Orbit)2 OrbitType (org.orekit.orbits.OrbitType)2 PositionAngle (org.orekit.orbits.PositionAngle)2 SpacecraftState (org.orekit.propagation.SpacecraftState)2 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)1 PVCoordinates (org.orekit.utils.PVCoordinates)1