Search in sources :

Example 41 with Propagator

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

the class TrackCorridor method createPropagator.

/**
 * Create an orbit propagator for a circular orbit
 * @param a  semi-major axis (m)
 * @param ex e cos(ω), first component of circular eccentricity vector
 * @param ey e sin(ω), second component of circular eccentricity vector
 * @param i inclination (rad)
 * @param raan right ascension of ascending node (Ω, rad)
 * @param alpha  an + ω, mean latitude argument (rad)
 * @param date date of the orbital parameters
 * @return an orbit propagator
 * @exception OrekitException if propagator cannot be built
 */
private Propagator createPropagator(final AbsoluteDate date, final double a, final double ex, final double ey, final double i, final double raan, final double alpha) throws OrekitException {
    // create orbit
    Orbit initialOrbit = new CircularOrbit(a, ex, ey, i, raan, alpha, PositionAngle.MEAN, FramesFactory.getEME2000(), date, Constants.EIGEN5C_EARTH_MU);
    // create propagator
    Propagator propagator = new EcksteinHechlerPropagator(initialOrbit, new LofOffset(initialOrbit.getFrame(), LOFType.TNW), Constants.EIGEN5C_EARTH_EQUATORIAL_RADIUS, Constants.EIGEN5C_EARTH_MU, Constants.EIGEN5C_EARTH_C20, Constants.EIGEN5C_EARTH_C30, Constants.EIGEN5C_EARTH_C40, Constants.EIGEN5C_EARTH_C50, Constants.EIGEN5C_EARTH_C60);
    return propagator;
}
Also used : EcksteinHechlerPropagator(org.orekit.propagation.analytical.EcksteinHechlerPropagator) Orbit(org.orekit.orbits.Orbit) CircularOrbit(org.orekit.orbits.CircularOrbit) CircularOrbit(org.orekit.orbits.CircularOrbit) TLEPropagator(org.orekit.propagation.analytical.tle.TLEPropagator) EcksteinHechlerPropagator(org.orekit.propagation.analytical.EcksteinHechlerPropagator) Propagator(org.orekit.propagation.Propagator) LofOffset(org.orekit.attitudes.LofOffset)

Example 42 with Propagator

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

the class EphemerisEventsTest method buildEphem.

private Ephemeris buildEphem(OrbitType type) throws IllegalArgumentException, OrekitException {
    double mass = 2500;
    double a = 7187990.1979844316;
    double e = 0.5e-4;
    double i = 1.7105407051081795;
    double omega = 1.9674147913622104;
    double OMEGA = FastMath.toRadians(261);
    double lv = 0;
    double mu = 3.9860047e14;
    double ae = 6.378137e6;
    double c20 = -1.08263e-3;
    double c30 = 2.54e-6;
    double c40 = 1.62e-6;
    double c50 = 2.3e-7;
    double c60 = -5.5e-7;
    double deltaT = finalDate.durationFrom(initDate);
    Orbit transPar = new KeplerianOrbit(a, e, i, omega, OMEGA, lv, PositionAngle.TRUE, FramesFactory.getEME2000(), initDate, mu);
    int nbIntervals = 720;
    Propagator propagator = new EcksteinHechlerPropagator(transPar, mass, ae, mu, c20, c30, c40, c50, c60);
    List<SpacecraftState> tab = new ArrayList<SpacecraftState>(nbIntervals + 1);
    for (int j = 0; j <= nbIntervals; j++) {
        SpacecraftState state = propagator.propagate(initDate.shiftedBy((j * deltaT) / nbIntervals));
        tab.add(new SpacecraftState(type.convertType(state.getOrbit()), state.getAttitude(), state.getMass()));
    }
    return new Ephemeris(tab, 2);
}
Also used : EcksteinHechlerPropagator(org.orekit.propagation.analytical.EcksteinHechlerPropagator) SpacecraftState(org.orekit.propagation.SpacecraftState) Orbit(org.orekit.orbits.Orbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) EcksteinHechlerPropagator(org.orekit.propagation.analytical.EcksteinHechlerPropagator) BoundedPropagator(org.orekit.propagation.BoundedPropagator) Propagator(org.orekit.propagation.Propagator) ArrayList(java.util.ArrayList) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Ephemeris(org.orekit.propagation.analytical.Ephemeris)

Example 43 with Propagator

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

the class EphemerisTest method testProtectedMethods.

@Test
public void testProtectedMethods() throws OrekitException, SecurityException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
    propagator.setAttitudeProvider(new LofOffset(inertialFrame, LOFType.VVLH));
    List<SpacecraftState> states = new ArrayList<SpacecraftState>();
    for (double dt = 0; dt >= -1200; dt -= 60.0) {
        final SpacecraftState original = propagator.propagate(initDate.shiftedBy(dt));
        final SpacecraftState modified = new SpacecraftState(original.getOrbit(), original.getAttitude(), original.getMass() - 0.0625 * dt);
        states.add(modified);
    }
    final Propagator ephem = new Ephemeris(states, 2);
    Method propagateOrbit = Ephemeris.class.getDeclaredMethod("propagateOrbit", AbsoluteDate.class);
    propagateOrbit.setAccessible(true);
    Method getMass = Ephemeris.class.getDeclaredMethod("getMass", AbsoluteDate.class);
    getMass.setAccessible(true);
    SpacecraftState s = ephem.propagate(initDate.shiftedBy(-270.0));
    Orbit o = (Orbit) propagateOrbit.invoke(ephem, s.getDate());
    double m = ((Double) getMass.invoke(ephem, s.getDate())).doubleValue();
    Assert.assertEquals(0.0, Vector3D.distance(s.getPVCoordinates().getPosition(), o.getPVCoordinates().getPosition()), 1.0e-15);
    Assert.assertEquals(s.getMass(), m, 1.0e-15);
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) Orbit(org.orekit.orbits.Orbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Propagator(org.orekit.propagation.Propagator) ArrayList(java.util.ArrayList) Method(java.lang.reflect.Method) LofOffset(org.orekit.attitudes.LofOffset) Test(org.junit.Test)

Example 44 with Propagator

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

the class KeplerianPropagatorTest method testEphemerisModeWithHandler.

@Test
public void testEphemerisModeWithHandler() throws OrekitException {
    // setup
    AbsoluteDate initDate = AbsoluteDate.GPS_EPOCH;
    Orbit ic = new KeplerianOrbit(6378137 + 500e3, 1e-3, 0, 0, 0, 0, PositionAngle.TRUE, FramesFactory.getGCRF(), initDate, mu);
    Propagator propagator = new KeplerianPropagator(ic);
    AbsoluteDate end = initDate.shiftedBy(90 * 60);
    // action
    final List<SpacecraftState> states = new ArrayList<>();
    propagator.setEphemerisMode((interpolator, isLast) -> {
        states.add(interpolator.getCurrentState());
        states.add(interpolator.getPreviousState());
    });
    propagator.propagate(end);
    final BoundedPropagator ephemeris = propagator.getGeneratedEphemeris();
    // verify
    // got some data
    Assert.assertTrue(states.size() > 1);
    for (SpacecraftState state : states) {
        PVCoordinates actual = ephemeris.propagate(state.getDate()).getPVCoordinates();
        Assert.assertThat(actual, OrekitMatchers.pvIs(state.getPVCoordinates()));
    }
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) CartesianOrbit(org.orekit.orbits.CartesianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Orbit(org.orekit.orbits.Orbit) CircularOrbit(org.orekit.orbits.CircularOrbit) Propagator(org.orekit.propagation.Propagator) BoundedPropagator(org.orekit.propagation.BoundedPropagator) ArrayList(java.util.ArrayList) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates) PVCoordinates(org.orekit.utils.PVCoordinates) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) BoundedPropagator(org.orekit.propagation.BoundedPropagator) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 45 with Propagator

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

the class KeplerianPropagatorTest method testIssue107.

@Test
public void testIssue107() 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);
    Propagator propagator = new KeplerianPropagator(orbit) {

        private static final long serialVersionUID = 1L;

        AbsoluteDate lastDate = AbsoluteDate.PAST_INFINITY;

        protected SpacecraftState basicPropagate(final AbsoluteDate date) throws OrekitException {
            if (date.compareTo(lastDate) < 0) {
                throw new OrekitException(LocalizedCoreFormats.SIMPLE_MESSAGE, "no backward propagation allowed");
            }
            lastDate = date;
            return super.basicPropagate(date);
        }
    };
    SpacecraftState finalState = propagator.propagate(date.shiftedBy(3600.0));
    Assert.assertEquals(3600.0, finalState.getDate().durationFrom(date), 1.0e-15);
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) CartesianOrbit(org.orekit.orbits.CartesianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Orbit(org.orekit.orbits.Orbit) CircularOrbit(org.orekit.orbits.CircularOrbit) CircularOrbit(org.orekit.orbits.CircularOrbit) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) Propagator(org.orekit.propagation.Propagator) BoundedPropagator(org.orekit.propagation.BoundedPropagator) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates) PVCoordinates(org.orekit.utils.PVCoordinates) OrekitException(org.orekit.errors.OrekitException) TimeScale(org.orekit.time.TimeScale) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Aggregations

Propagator (org.orekit.propagation.Propagator)177 Test (org.junit.Test)141 SpacecraftState (org.orekit.propagation.SpacecraftState)92 AbsoluteDate (org.orekit.time.AbsoluteDate)90 Context (org.orekit.estimation.Context)67 NumericalPropagatorBuilder (org.orekit.propagation.conversion.NumericalPropagatorBuilder)67 ArrayList (java.util.ArrayList)62 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)58 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)51 Orbit (org.orekit.orbits.Orbit)46 KeplerianPropagator (org.orekit.propagation.analytical.KeplerianPropagator)41 ObservedMeasurement (org.orekit.estimation.measurements.ObservedMeasurement)40 Event (org.orekit.propagation.events.handlers.RecordAndContinue.Event)38 StopOnEvent (org.orekit.propagation.events.handlers.StopOnEvent)38 OrekitException (org.orekit.errors.OrekitException)30 EcksteinHechlerPropagator (org.orekit.propagation.analytical.EcksteinHechlerPropagator)29 GeodeticPoint (org.orekit.bodies.GeodeticPoint)28 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)28 PVCoordinates (org.orekit.utils.PVCoordinates)26 ParameterDriver (org.orekit.utils.ParameterDriver)23