Search in sources :

Example 41 with NumericalPropagator

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

the class OsculatingToMeanElementsConverterTest method testTrivial.

@Test
public void testTrivial() throws Exception {
    final AbsoluteDate date = new AbsoluteDate("2011-12-12T11:57:20.000", TimeScalesFactory.getUTC());
    final Orbit orbit1 = new CircularOrbit(7204535.848109436, -4.484755873986251E-4, 0.0011562979012178316, FastMath.toRadians(98.74341600466741), FastMath.toRadians(43.32990110790338), FastMath.toRadians(180.0), PositionAngle.MEAN, FramesFactory.getGCRF(), date, Constants.WGS84_EARTH_MU);
    final SpacecraftState initialState = new SpacecraftState(orbit1);
    // Set up the numerical propagator
    final double[][] tol = NumericalPropagator.tolerances(1.0, initialState.getOrbit(), initialState.getOrbit().getType());
    final double minStep = 1.;
    final double maxStep = 200.;
    AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(minStep, maxStep, tol[0], tol[1]);
    integrator.setInitialStepSize(100.);
    final NumericalPropagator prop = new NumericalPropagator(integrator);
    prop.setInitialState(initialState);
    final OsculatingToMeanElementsConverter converter = new OsculatingToMeanElementsConverter(initialState, 2, prop, 1.0);
    final SpacecraftState meanOrbit = converter.convert();
    final double eps = 1.e-15;
    Assert.assertEquals(orbit1.getA(), meanOrbit.getA(), eps * orbit1.getA());
    Assert.assertEquals(orbit1.getEquinoctialEx(), meanOrbit.getEquinoctialEx(), eps);
    Assert.assertEquals(orbit1.getEquinoctialEy(), meanOrbit.getEquinoctialEy(), eps);
    Assert.assertEquals(orbit1.getHx(), meanOrbit.getHx(), eps);
    Assert.assertEquals(orbit1.getHy(), meanOrbit.getHy(), eps);
    Assert.assertEquals(MathUtils.normalizeAngle(orbit1.getLM(), FastMath.PI), MathUtils.normalizeAngle(meanOrbit.getLM(), FastMath.PI), eps);
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) Orbit(org.orekit.orbits.Orbit) CircularOrbit(org.orekit.orbits.CircularOrbit) CircularOrbit(org.orekit.orbits.CircularOrbit) NumericalPropagator(org.orekit.propagation.numerical.NumericalPropagator) AdaptiveStepsizeIntegrator(org.hipparchus.ode.nonstiff.AdaptiveStepsizeIntegrator) DormandPrince853Integrator(org.hipparchus.ode.nonstiff.DormandPrince853Integrator) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 42 with NumericalPropagator

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

the class CloseEventsNumericalDP853Test 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-3, initialOrbit, OrbitType.CARTESIAN);
    final NumericalPropagator propagator = new NumericalPropagator(new DormandPrince853Integrator(stepSize, stepSize, tol[0], tol[1]));
    propagator.setInitialState(new SpacecraftState(initialOrbit));
    propagator.setOrbitType(OrbitType.CARTESIAN);
    return propagator;
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) NumericalPropagator(org.orekit.propagation.numerical.NumericalPropagator) DormandPrince853Integrator(org.hipparchus.ode.nonstiff.DormandPrince853Integrator)

Example 43 with NumericalPropagator

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

Example 44 with NumericalPropagator

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

the class EventDetectorTest method testIssue108Numerical.

@Test
public void testIssue108Numerical() throws OrekitException {
    final TimeScale utc = TimeScalesFactory.getUTC();
    final Vector3D position = new Vector3D(-6142438.668, 3492467.56, -25767.257);
    final Vector3D velocity = new Vector3D(505.848, 942.781, 7435.922);
    final AbsoluteDate date = new AbsoluteDate(2003, 9, 16, utc);
    final Orbit orbit = new CircularOrbit(new PVCoordinates(position, velocity), FramesFactory.getEME2000(), date, mu);
    final double step = 60.0;
    final int n = 100;
    NumericalPropagator propagator = new NumericalPropagator(new ClassicalRungeKuttaIntegrator(step));
    propagator.resetInitialState(new SpacecraftState(orbit));
    GCallsCounter counter = new GCallsCounter(100000.0, 1.0e-6, 20, new StopOnEvent<GCallsCounter>());
    propagator.addEventDetector(counter);
    propagator.propagate(date.shiftedBy(n * step));
    Assert.assertEquals(n + 1, counter.getCount());
}
Also used : Orbit(org.orekit.orbits.Orbit) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) CircularOrbit(org.orekit.orbits.CircularOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) PVCoordinates(org.orekit.utils.PVCoordinates) ClassicalRungeKuttaIntegrator(org.hipparchus.ode.nonstiff.ClassicalRungeKuttaIntegrator) TimeScale(org.orekit.time.TimeScale) AbsoluteDate(org.orekit.time.AbsoluteDate) SpacecraftState(org.orekit.propagation.SpacecraftState) CircularOrbit(org.orekit.orbits.CircularOrbit) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) NumericalPropagator(org.orekit.propagation.numerical.NumericalPropagator) Test(org.junit.Test)

Example 45 with NumericalPropagator

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

the class AlignmentDetectorTest method setUp.

@Before
public void setUp() {
    try {
        Utils.setDataRoot("regular-data");
        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());
        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);
    } 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)

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