Search in sources :

Example 51 with EquinoctialOrbit

use of org.orekit.orbits.EquinoctialOrbit in project Orekit by CS-SI.

the class NumericalConverterTest method setUp.

@Before
public void setUp() throws OrekitException, IOException, ParseException {
    Utils.setDataRoot("regular-data:potential/shm-format");
    gravity = new HolmesFeatherstoneAttractionModel(FramesFactory.getITRF(IERSConventions.IERS_2010, true), GravityFieldFactory.getNormalizedProvider(2, 0));
    mu = gravity.getParameterDriver(NewtonianAttraction.CENTRAL_ATTRACTION_COEFFICIENT).getValue();
    minStep = 1.0;
    maxStep = 600.0;
    dP = 10.0;
    // use a orbit that comes close to Earth so the drag coefficient has an effect
    final Vector3D position = new Vector3D(7.0e6, 1.0e6, 4.0e6).normalize().scalarMultiply(Constants.WGS84_EARTH_EQUATORIAL_RADIUS + 300e3);
    final Vector3D velocity = new Vector3D(-500.0, 8000.0, 1000.0);
    final AbsoluteDate initDate = new AbsoluteDate(2010, 10, 10, 10, 10, 10.0, TimeScalesFactory.getUTC());
    orbit = new EquinoctialOrbit(new PVCoordinates(position, velocity), FramesFactory.getEME2000(), initDate, mu);
    final double[][] tol = NumericalPropagator.tolerances(dP, orbit, OrbitType.CARTESIAN);
    propagator = new NumericalPropagator(new DormandPrince853Integrator(minStep, maxStep, tol[0], tol[1]));
    propagator.setInitialState(new SpacecraftState(orbit));
    propagator.setOrbitType(OrbitType.CARTESIAN);
    final OneAxisEllipsoid earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
    earth.setAngularThreshold(1.e-7);
    atmosphere = new SimpleExponentialAtmosphere(earth, 0.0004, 42000.0, 7500.0);
    final double dragCoef = 2.0;
    crossSection = 10.0;
    drag = new DragForce(atmosphere, new IsotropicDrag(crossSection, dragCoef));
    propagator.addForceModel(gravity);
    propagator.addForceModel(drag);
}
Also used : OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) IsotropicDrag(org.orekit.forces.drag.IsotropicDrag) PVCoordinates(org.orekit.utils.PVCoordinates) AbsoluteDate(org.orekit.time.AbsoluteDate) SpacecraftState(org.orekit.propagation.SpacecraftState) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) NumericalPropagator(org.orekit.propagation.numerical.NumericalPropagator) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) DragForce(org.orekit.forces.drag.DragForce) HolmesFeatherstoneAttractionModel(org.orekit.forces.gravity.HolmesFeatherstoneAttractionModel) DormandPrince853Integrator(org.hipparchus.ode.nonstiff.DormandPrince853Integrator) SimpleExponentialAtmosphere(org.orekit.forces.drag.atmosphere.SimpleExponentialAtmosphere) Before(org.junit.Before)

Example 52 with EquinoctialOrbit

use of org.orekit.orbits.EquinoctialOrbit in project Orekit by CS-SI.

the class J2DifferentialEffect method updateOrbit.

/**
 * Compute the differential effect of J2 on an orbit.
 * @param orbit1 original orbit at t₁, without differential J2
 * @return orbit at t₁, always taking the effect into account
 */
private Orbit updateOrbit(final Orbit orbit1) {
    // convert current orbital state to equinoctial elements
    final EquinoctialOrbit original = (EquinoctialOrbit) OrbitType.EQUINOCTIAL.convertType(orbit1);
    // compute differential effect
    final AbsoluteDate date = original.getDate();
    final double dt = date.durationFrom(referenceDate);
    final double dPaRaan = (dPaDot + dRaanDot) * dt;
    final double cPaRaan = FastMath.cos(dPaRaan);
    final double sPaRaan = FastMath.sin(dPaRaan);
    final double dRaan = dRaanDot * dt;
    final double cRaan = FastMath.cos(dRaan);
    final double sRaan = FastMath.sin(dRaan);
    final double ex = original.getEquinoctialEx() * cPaRaan - original.getEquinoctialEy() * sPaRaan;
    final double ey = original.getEquinoctialEx() * sPaRaan + original.getEquinoctialEy() * cPaRaan;
    final double hx = original.getHx() * cRaan - original.getHy() * sRaan;
    final double hy = original.getHx() * sRaan + original.getHy() * cRaan;
    final double lambda = original.getLv() + dPaRaan;
    // build updated orbit
    final EquinoctialOrbit updated = new EquinoctialOrbit(original.getA(), ex, ey, hx, hy, lambda, PositionAngle.TRUE, original.getFrame(), date, original.getMu());
    // convert to required type
    return orbit1.getType().convertType(updated);
}
Also used : EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) AbsoluteDate(org.orekit.time.AbsoluteDate)

Example 53 with EquinoctialOrbit

use of org.orekit.orbits.EquinoctialOrbit in project Orekit by CS-SI.

the class OneAxisEllipsoidTest method testGroundProjectionDerivatives.

@Test
public void testGroundProjectionDerivatives() throws OrekitException {
    Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
    Frame eme2000 = FramesFactory.getEME2000();
    OneAxisEllipsoid model = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, itrf);
    TimeStampedPVCoordinates initPV = new TimeStampedPVCoordinates(AbsoluteDate.J2000_EPOCH.shiftedBy(584.), new Vector3D(3220103., 69623., 6449822.), new Vector3D(6414.7, -2006., -3180.), Vector3D.ZERO);
    Orbit orbit = new EquinoctialOrbit(initPV, eme2000, Constants.EIGEN5C_EARTH_MU);
    double[] errors = derivativesErrors(orbit, orbit.getDate(), eme2000, model);
    Assert.assertEquals(0, errors[0], 1.0e-16);
    Assert.assertEquals(0, errors[1], 2.0e-12);
    Assert.assertEquals(0, errors[2], 2.0e-4);
}
Also used : Frame(org.orekit.frames.Frame) Orbit(org.orekit.orbits.Orbit) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) CircularOrbit(org.orekit.orbits.CircularOrbit) FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates) Test(org.junit.Test)

Example 54 with EquinoctialOrbit

use of org.orekit.orbits.EquinoctialOrbit in project Orekit by CS-SI.

the class OneAxisEllipsoidTest method testGroundProjectionPosition.

@Test
public void testGroundProjectionPosition() throws OrekitException {
    OneAxisEllipsoid model = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
    TimeStampedPVCoordinates initPV = new TimeStampedPVCoordinates(AbsoluteDate.J2000_EPOCH.shiftedBy(584.), new Vector3D(3220103., 69623., 6449822.), new Vector3D(6414.7, -2006., -3180.), Vector3D.ZERO);
    Frame eme2000 = FramesFactory.getEME2000();
    Orbit orbit = new EquinoctialOrbit(initPV, eme2000, Constants.EIGEN5C_EARTH_MU);
    for (double dt = 0; dt < 3600.0; dt += 60.0) {
        TimeStampedPVCoordinates pv = orbit.getPVCoordinates(orbit.getDate().shiftedBy(dt), eme2000);
        TimeStampedPVCoordinates groundPV = model.projectToGround(pv, eme2000);
        Vector3D groundP = model.projectToGround(pv.getPosition(), pv.getDate(), eme2000);
        // check methods projectToGround and transform are consistent with each other
        Assert.assertEquals(model.transform(pv.getPosition(), eme2000, pv.getDate()).getLatitude(), model.transform(groundPV.getPosition(), eme2000, pv.getDate()).getLatitude(), 1.0e-10);
        Assert.assertEquals(model.transform(pv.getPosition(), eme2000, pv.getDate()).getLongitude(), model.transform(groundPV.getPosition(), eme2000, pv.getDate()).getLongitude(), 1.0e-10);
        Assert.assertEquals(0.0, Vector3D.distance(groundP, groundPV.getPosition()), 1.0e-15 * groundP.getNorm());
    }
}
Also used : Frame(org.orekit.frames.Frame) Orbit(org.orekit.orbits.Orbit) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) CircularOrbit(org.orekit.orbits.CircularOrbit) FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates) Test(org.junit.Test)

Example 55 with EquinoctialOrbit

use of org.orekit.orbits.EquinoctialOrbit in project Orekit by CS-SI.

the class EcksteinHechlerPropagatorTest method undergroundOrbit.

@Test(expected = OrekitException.class)
public void undergroundOrbit() throws OrekitException {
    // for a semi major axis < equatorial radius
    Vector3D position = new Vector3D(7.0e6, 1.0e6, 4.0e6);
    Vector3D velocity = new Vector3D(-500.0, 800.0, 100.0);
    AbsoluteDate initDate = AbsoluteDate.J2000_EPOCH;
    Orbit initialOrbit = new EquinoctialOrbit(new PVCoordinates(position, velocity), FramesFactory.getEME2000(), initDate, provider.getMu());
    // Extrapolator definition
    // -----------------------
    EcksteinHechlerPropagator extrapolator = new EcksteinHechlerPropagator(initialOrbit, provider);
    // Extrapolation at the initial date
    // ---------------------------------
    double delta_t = 0.0;
    AbsoluteDate extrapDate = initDate.shiftedBy(delta_t);
    extrapolator.propagate(extrapDate);
}
Also used : EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Orbit(org.orekit.orbits.Orbit) CircularOrbit(org.orekit.orbits.CircularOrbit) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates) PVCoordinates(org.orekit.utils.PVCoordinates) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Aggregations

EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)58 AbsoluteDate (org.orekit.time.AbsoluteDate)49 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)48 PVCoordinates (org.orekit.utils.PVCoordinates)46 Orbit (org.orekit.orbits.Orbit)37 SpacecraftState (org.orekit.propagation.SpacecraftState)34 Test (org.junit.Test)29 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)25 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)20 Before (org.junit.Before)18 TimeStampedPVCoordinates (org.orekit.utils.TimeStampedPVCoordinates)18 TimeScale (org.orekit.time.TimeScale)16 Frame (org.orekit.frames.Frame)15 CartesianOrbit (org.orekit.orbits.CartesianOrbit)15 CircularOrbit (org.orekit.orbits.CircularOrbit)15 EcksteinHechlerPropagator (org.orekit.propagation.analytical.EcksteinHechlerPropagator)13 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)13 OrekitException (org.orekit.errors.OrekitException)12 Propagator (org.orekit.propagation.Propagator)11 KeplerianPropagator (org.orekit.propagation.analytical.KeplerianPropagator)10