Search in sources :

Example 76 with NumericalPropagator

use of org.orekit.propagation.numerical.NumericalPropagator in project Orekit by CS-SI.

the class DSSTPropagatorTest method getLEOStatePropagatedBy30Minutes.

private SpacecraftState getLEOStatePropagatedBy30Minutes() throws IllegalArgumentException, OrekitException {
    final Vector3D position = new Vector3D(-6142438.668, 3492467.560, -25767.25680);
    final Vector3D velocity = new Vector3D(505.8479685, 942.7809215, 7435.922231);
    // Spring equinoxe 21st mars 2003 1h00m
    final AbsoluteDate initialDate = new AbsoluteDate(new DateComponents(2003, 03, 21), new TimeComponents(1, 0, 0.), TimeScalesFactory.getUTC());
    final CartesianOrbit osculatingOrbit = new CartesianOrbit(new PVCoordinates(position, velocity), FramesFactory.getTOD(IERSConventions.IERS_1996, false), initialDate, Constants.WGS84_EARTH_MU);
    // Adaptive step integrator
    // with a minimum step of 0.001 and a maximum step of 1000
    double minStep = 0.001;
    double maxstep = 1000.0;
    double positionTolerance = 10.0;
    OrbitType propagationType = OrbitType.EQUINOCTIAL;
    double[][] tolerances = NumericalPropagator.tolerances(positionTolerance, osculatingOrbit, propagationType);
    AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(minStep, maxstep, tolerances[0], tolerances[1]);
    NumericalPropagator propagator = new NumericalPropagator(integrator);
    propagator.setOrbitType(propagationType);
    NormalizedSphericalHarmonicsProvider provider = GravityFieldFactory.getNormalizedProvider(5, 5);
    ForceModel holmesFeatherstone = new HolmesFeatherstoneAttractionModel(FramesFactory.getITRF(IERSConventions.IERS_2010, true), provider);
    propagator.addForceModel(holmesFeatherstone);
    propagator.setInitialState(new SpacecraftState(osculatingOrbit));
    return propagator.propagate(new AbsoluteDate(initialDate, 1800.));
}
Also used : CartesianOrbit(org.orekit.orbits.CartesianOrbit) ForceModel(org.orekit.forces.ForceModel) DSSTForceModel(org.orekit.propagation.semianalytical.dsst.forces.DSSTForceModel) AdaptiveStepsizeIntegrator(org.hipparchus.ode.nonstiff.AdaptiveStepsizeIntegrator) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates) PVCoordinates(org.orekit.utils.PVCoordinates) DateComponents(org.orekit.time.DateComponents) TimeComponents(org.orekit.time.TimeComponents) AbsoluteDate(org.orekit.time.AbsoluteDate) SpacecraftState(org.orekit.propagation.SpacecraftState) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) NumericalPropagator(org.orekit.propagation.numerical.NumericalPropagator) OrbitType(org.orekit.orbits.OrbitType) DormandPrince853Integrator(org.hipparchus.ode.nonstiff.DormandPrince853Integrator) NormalizedSphericalHarmonicsProvider(org.orekit.forces.gravity.potential.NormalizedSphericalHarmonicsProvider) HolmesFeatherstoneAttractionModel(org.orekit.forces.gravity.HolmesFeatherstoneAttractionModel)

Example 77 with NumericalPropagator

use of org.orekit.propagation.numerical.NumericalPropagator in project Orekit by CS-SI.

the class AdditionalEquationsTest method testInitNumerical.

/**
 * Test for issue #401
 *  with a numerical propagator
 */
@Test
public void testInitNumerical() throws OrekitException {
    // setup
    final double reference = 1.25;
    InitCheckerEquations checker = new InitCheckerEquations(reference);
    Assert.assertFalse(checker.wasCalled());
    // action
    AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(0.001, 200, tolerance[0], tolerance[1]);
    integrator.setInitialStepSize(60);
    NumericalPropagator propagatorNumerical = new NumericalPropagator(integrator);
    propagatorNumerical.setInitialState(initialState.addAdditionalState(checker.getName(), reference));
    propagatorNumerical.addAdditionalEquations(checker);
    propagatorNumerical.propagate(initDate.shiftedBy(600));
    // verify
    Assert.assertTrue(checker.wasCalled());
}
Also used : NumericalPropagator(org.orekit.propagation.numerical.NumericalPropagator) AdaptiveStepsizeIntegrator(org.hipparchus.ode.nonstiff.AdaptiveStepsizeIntegrator) DormandPrince853Integrator(org.hipparchus.ode.nonstiff.DormandPrince853Integrator) Test(org.junit.Test)

Example 78 with NumericalPropagator

use of org.orekit.propagation.numerical.NumericalPropagator in project Orekit by CS-SI.

the class CloseEventsNumericalABTest 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(10000, initialOrbit, OrbitType.CARTESIAN);
    final AdamsBashforthIntegrator integrator = new AdamsBashforthIntegrator(4, stepSize, stepSize, tol[0], tol[1]);
    final DormandPrince853Integrator starter = new DormandPrince853Integrator(stepSize / 100, stepSize / 10, tol[0], tol[1]);
    starter.setInitialStepSize(stepSize / 20);
    integrator.setStarterIntegrator(starter);
    final NumericalPropagator propagator = new NumericalPropagator(integrator);
    propagator.setInitialState(new SpacecraftState(initialOrbit));
    propagator.setOrbitType(OrbitType.CARTESIAN);
    return propagator;
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) AdamsBashforthIntegrator(org.hipparchus.ode.nonstiff.AdamsBashforthIntegrator) NumericalPropagator(org.orekit.propagation.numerical.NumericalPropagator) DormandPrince853Integrator(org.hipparchus.ode.nonstiff.DormandPrince853Integrator)

Example 79 with NumericalPropagator

use of org.orekit.propagation.numerical.NumericalPropagator in project Orekit by CS-SI.

the class EventsLoggerTest method setUp.

@Before
public void setUp() {
    try {
        Utils.setDataRoot("regular-data");
        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());
        final Orbit orbit = new EquinoctialOrbit(new PVCoordinates(position, velocity), FramesFactory.getEME2000(), iniDate, mu);
        initialState = new SpacecraftState(orbit);
        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);
        count = 0;
        umbraDetector = buildDetector(true);
        penumbraDetector = buildDetector(false);
    } catch (OrekitException oe) {
        Assert.fail(oe.getLocalizedMessage());
    }
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) Orbit(org.orekit.orbits.Orbit) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) 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)

Example 80 with NumericalPropagator

use of org.orekit.propagation.numerical.NumericalPropagator 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

NumericalPropagator (org.orekit.propagation.numerical.NumericalPropagator)95 SpacecraftState (org.orekit.propagation.SpacecraftState)69 DormandPrince853Integrator (org.hipparchus.ode.nonstiff.DormandPrince853Integrator)62 Test (org.junit.Test)54 Orbit (org.orekit.orbits.Orbit)50 AbsoluteDate (org.orekit.time.AbsoluteDate)46 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)43 FieldSpacecraftState (org.orekit.propagation.FieldSpacecraftState)39 AdaptiveStepsizeIntegrator (org.hipparchus.ode.nonstiff.AdaptiveStepsizeIntegrator)38 OrbitType (org.orekit.orbits.OrbitType)38 FieldNumericalPropagator (org.orekit.propagation.numerical.FieldNumericalPropagator)36 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)36 FieldKeplerianOrbit (org.orekit.orbits.FieldKeplerianOrbit)34 AbstractLegacyForceModelTest (org.orekit.forces.AbstractLegacyForceModelTest)31 PVCoordinates (org.orekit.utils.PVCoordinates)29 CartesianOrbit (org.orekit.orbits.CartesianOrbit)27 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)24 Frame (org.orekit.frames.Frame)24 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)22 DateComponents (org.orekit.time.DateComponents)21