Search in sources :

Example 46 with CircularOrbit

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

the class LofOffsetTest method setUp.

@Before
public void setUp() {
    try {
        Utils.setDataRoot("regular-data");
        // Computation date
        date = new AbsoluteDate(new DateComponents(2008, 04, 07), TimeComponents.H00, TimeScalesFactory.getUTC());
        // Body mu
        mu = 3.9860047e14;
        // Reference frame = ITRF
        itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
        // Elliptic earth shape
        earthSpheric = new OneAxisEllipsoid(6378136.460, 0., itrf);
        // Satellite position
        orbit = new CircularOrbit(7178000.0, 0.5e-8, -0.5e-8, FastMath.toRadians(50.), FastMath.toRadians(150.), FastMath.toRadians(5.300), PositionAngle.MEAN, FramesFactory.getEME2000(), date, mu);
        pvSatEME2000 = orbit.getPVCoordinates();
    } catch (OrekitException oe) {
        Assert.fail(oe.getMessage());
    }
}
Also used : OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) CircularOrbit(org.orekit.orbits.CircularOrbit) DateComponents(org.orekit.time.DateComponents) OrekitException(org.orekit.errors.OrekitException) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Before(org.junit.Before)

Example 47 with CircularOrbit

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

the class TabulatedLofOffsetTest method setUp.

@Before
public void setUp() {
    try {
        Utils.setDataRoot("regular-data");
        // Computation date
        date = new AbsoluteDate(new DateComponents(2008, 04, 07), TimeComponents.H00, TimeScalesFactory.getUTC());
        // Body mu
        mu = 3.9860047e14;
        // Reference frame = ITRF
        itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
        // Elliptic earth shape
        earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, itrf);
        // Satellite position
        orbit = new CircularOrbit(7178000.0, 0.5e-8, -0.5e-8, FastMath.toRadians(50.), FastMath.toRadians(150.), FastMath.toRadians(5.300), PositionAngle.MEAN, FramesFactory.getEME2000(), date, mu);
        pvSatEME2000 = orbit.getPVCoordinates();
    } catch (OrekitException oe) {
        Assert.fail(oe.getMessage());
    }
}
Also used : OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) CircularOrbit(org.orekit.orbits.CircularOrbit) DateComponents(org.orekit.time.DateComponents) OrekitException(org.orekit.errors.OrekitException) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Before(org.junit.Before)

Example 48 with CircularOrbit

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

the class LofOffsetPointingTest method testLof.

/**
 * Test if both constructors are equivalent
 */
@Test
public void testLof() throws OrekitException {
    // Satellite position
    final CircularOrbit circ = new CircularOrbit(7178000.0, 0.5e-4, -0.5e-4, FastMath.toRadians(0.), FastMath.toRadians(270.), FastMath.toRadians(5.300), PositionAngle.MEAN, FramesFactory.getEME2000(), date, mu);
    // Create lof aligned law
    // ************************
    final LofOffset lofLaw = new LofOffset(circ.getFrame(), LOFType.VVLH);
    final LofOffsetPointing lofPointing = new LofOffsetPointing(circ.getFrame(), earthSpheric, lofLaw, Vector3D.PLUS_K);
    final Rotation lofRot = lofPointing.getAttitude(circ, date, circ.getFrame()).getRotation();
    // Compare to body center pointing law
    // *************************************
    final BodyCenterPointing centerLaw = new BodyCenterPointing(circ.getFrame(), earthSpheric);
    final Rotation centerRot = centerLaw.getAttitude(circ, date, circ.getFrame()).getRotation();
    final double angleBodyCenter = centerRot.composeInverse(lofRot, RotationConvention.VECTOR_OPERATOR).getAngle();
    Assert.assertEquals(0., angleBodyCenter, Utils.epsilonAngle);
    // Compare to nadir pointing law
    // *******************************
    final NadirPointing nadirLaw = new NadirPointing(circ.getFrame(), earthSpheric);
    final Rotation nadirRot = nadirLaw.getAttitude(circ, date, circ.getFrame()).getRotation();
    final double angleNadir = nadirRot.composeInverse(lofRot, RotationConvention.VECTOR_OPERATOR).getAngle();
    Assert.assertEquals(0., angleNadir, Utils.epsilonAngle);
}
Also used : CircularOrbit(org.orekit.orbits.CircularOrbit) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation) Test(org.junit.Test)

Example 49 with CircularOrbit

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

the class YawCompensationTest method setUp.

@Before
public void setUp() {
    try {
        Utils.setDataRoot("regular-data");
        // Computation date
        date = new AbsoluteDate(new DateComponents(2008, 04, 07), TimeComponents.H00, TimeScalesFactory.getUTC());
        // Body mu
        final double mu = 3.9860047e14;
        // Reference frame = ITRF
        itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
        // Satellite position
        circOrbit = new CircularOrbit(7178000.0, 0.5e-4, -0.5e-4, FastMath.toRadians(50.), FastMath.toRadians(270.), FastMath.toRadians(5.300), PositionAngle.MEAN, FramesFactory.getEME2000(), date, mu);
        // Elliptic earth shape
        earthShape = new OneAxisEllipsoid(6378136.460, 1 / 298.257222101, itrf);
    } catch (OrekitException oe) {
        Assert.fail(oe.getMessage());
    }
}
Also used : OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) CircularOrbit(org.orekit.orbits.CircularOrbit) DateComponents(org.orekit.time.DateComponents) OrekitException(org.orekit.errors.OrekitException) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Before(org.junit.Before)

Example 50 with CircularOrbit

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

the class AdapterPropagatorTest method testLowEarthOrbit.

@Test
public void testLowEarthOrbit() throws OrekitException, ParseException, IOException {
    Orbit leo = new CircularOrbit(7200000.0, -1.0e-5, 2.0e-4, FastMath.toRadians(98.0), FastMath.toRadians(123.456), 0.0, PositionAngle.MEAN, FramesFactory.getEME2000(), new AbsoluteDate(new DateComponents(2004, 01, 01), new TimeComponents(23, 30, 00.000), TimeScalesFactory.getUTC()), Constants.EIGEN5C_EARTH_MU);
    double mass = 5600.0;
    AbsoluteDate t0 = leo.getDate().shiftedBy(1000.0);
    Vector3D dV = new Vector3D(-0.1, 0.2, 0.3);
    double f = 20.0;
    double isp = 315.0;
    double vExhaust = Constants.G0_STANDARD_GRAVITY * isp;
    double dt = -(mass * vExhaust / f) * FastMath.expm1(-dV.getNorm() / vExhaust);
    BoundedPropagator withoutManeuver = getEphemeris(leo, mass, 5, new LofOffset(leo.getFrame(), LOFType.LVLH), t0, Vector3D.ZERO, f, isp, false, false, null);
    BoundedPropagator withManeuver = getEphemeris(leo, mass, 5, new LofOffset(leo.getFrame(), LOFType.LVLH), t0, dV, f, isp, false, false, null);
    // we set up a model that reverts the maneuvers
    AdapterPropagator adapterPropagator = new AdapterPropagator(withManeuver);
    AdapterPropagator.DifferentialEffect effect = new SmallManeuverAnalyticalModel(adapterPropagator.propagate(t0), dV.negate(), isp);
    adapterPropagator.addEffect(effect);
    adapterPropagator.addAdditionalStateProvider(new AdditionalStateProvider() {

        public String getName() {
            return "dummy 3";
        }

        public double[] getAdditionalState(SpacecraftState state) {
            return new double[3];
        }
    });
    // the adapted propagators do not manage the additional states from the reference,
    // they simply forward them
    Assert.assertFalse(adapterPropagator.isAdditionalStateManaged("dummy 1"));
    Assert.assertFalse(adapterPropagator.isAdditionalStateManaged("dummy 2"));
    Assert.assertTrue(adapterPropagator.isAdditionalStateManaged("dummy 3"));
    for (AbsoluteDate t = t0.shiftedBy(0.5 * dt); t.compareTo(withoutManeuver.getMaxDate()) < 0; t = t.shiftedBy(60.0)) {
        PVCoordinates pvWithout = withoutManeuver.getPVCoordinates(t, leo.getFrame());
        PVCoordinates pvReverted = adapterPropagator.getPVCoordinates(t, leo.getFrame());
        double revertError = new PVCoordinates(pvWithout, pvReverted).getPosition().getNorm();
        Assert.assertEquals(0, revertError, 0.45);
        Assert.assertEquals(2, adapterPropagator.propagate(t).getAdditionalState("dummy 1").length);
        Assert.assertEquals(1, adapterPropagator.propagate(t).getAdditionalState("dummy 2").length);
        Assert.assertEquals(3, adapterPropagator.propagate(t).getAdditionalState("dummy 3").length);
    }
}
Also used : Orbit(org.orekit.orbits.Orbit) CircularOrbit(org.orekit.orbits.CircularOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) 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) SmallManeuverAnalyticalModel(org.orekit.forces.maneuvers.SmallManeuverAnalyticalModel) CircularOrbit(org.orekit.orbits.CircularOrbit) AdditionalStateProvider(org.orekit.propagation.AdditionalStateProvider) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) BoundedPropagator(org.orekit.propagation.BoundedPropagator) LofOffset(org.orekit.attitudes.LofOffset) Test(org.junit.Test)

Aggregations

CircularOrbit (org.orekit.orbits.CircularOrbit)63 AbsoluteDate (org.orekit.time.AbsoluteDate)47 Test (org.junit.Test)41 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)34 SpacecraftState (org.orekit.propagation.SpacecraftState)26 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)22 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)21 PVCoordinates (org.orekit.utils.PVCoordinates)21 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)20 Orbit (org.orekit.orbits.Orbit)20 Rotation (org.hipparchus.geometry.euclidean.threed.Rotation)15 Frame (org.orekit.frames.Frame)15 DateComponents (org.orekit.time.DateComponents)15 GeodeticPoint (org.orekit.bodies.GeodeticPoint)12 TimeStampedPVCoordinates (org.orekit.utils.TimeStampedPVCoordinates)12 OrekitException (org.orekit.errors.OrekitException)11 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)11 ArrayList (java.util.ArrayList)9 Before (org.junit.Before)9 BoundedPropagator (org.orekit.propagation.BoundedPropagator)9