Search in sources :

Example 51 with KeplerianPropagator

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

the class LofOffsetTest method testSpin.

@Test
public void testSpin() throws OrekitException {
    final AttitudeProvider law = new LofOffset(orbit.getFrame(), LOFType.VVLH, RotationOrder.XYX, 0.1, 0.2, 0.3);
    AbsoluteDate date = new AbsoluteDate(new DateComponents(1970, 01, 01), new TimeComponents(3, 25, 45.6789), TimeScalesFactory.getUTC());
    KeplerianOrbit orbit = new KeplerianOrbit(7178000.0, 1.e-4, FastMath.toRadians(50.), FastMath.toRadians(10.), FastMath.toRadians(20.), FastMath.toRadians(30.), PositionAngle.MEAN, FramesFactory.getEME2000(), date, 3.986004415e14);
    Propagator propagator = new KeplerianPropagator(orbit, law);
    double h = 0.01;
    SpacecraftState sMinus = propagator.propagate(date.shiftedBy(-h));
    SpacecraftState s0 = propagator.propagate(date);
    SpacecraftState sPlus = propagator.propagate(date.shiftedBy(h));
    // check spin is consistent with attitude evolution
    double errorAngleMinus = Rotation.distance(sMinus.shiftedBy(h).getAttitude().getRotation(), s0.getAttitude().getRotation());
    double evolutionAngleMinus = Rotation.distance(sMinus.getAttitude().getRotation(), s0.getAttitude().getRotation());
    Assert.assertEquals(0.0, errorAngleMinus, 1.0e-6 * evolutionAngleMinus);
    double errorAnglePlus = Rotation.distance(s0.getAttitude().getRotation(), sPlus.shiftedBy(-h).getAttitude().getRotation());
    double evolutionAnglePlus = Rotation.distance(s0.getAttitude().getRotation(), sPlus.getAttitude().getRotation());
    Assert.assertEquals(0.0, errorAnglePlus, 1.0e-6 * evolutionAnglePlus);
    Vector3D spin0 = s0.getAttitude().getSpin();
    Vector3D reference = AngularCoordinates.estimateRate(sMinus.getAttitude().getRotation(), sPlus.getAttitude().getRotation(), 2 * h);
    Assert.assertEquals(0.0, spin0.subtract(reference).getNorm(), 1.0e-10);
}
Also used : KeplerianPropagator(org.orekit.propagation.analytical.KeplerianPropagator) FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) SpacecraftState(org.orekit.propagation.SpacecraftState) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) Propagator(org.orekit.propagation.Propagator) KeplerianPropagator(org.orekit.propagation.analytical.KeplerianPropagator) DateComponents(org.orekit.time.DateComponents) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) TimeComponents(org.orekit.time.TimeComponents) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 52 with KeplerianPropagator

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

the class FixedRateTest method testSpin.

@Test
public void testSpin() throws OrekitException {
    AbsoluteDate date = new AbsoluteDate(new DateComponents(1970, 01, 01), new TimeComponents(3, 25, 45.6789), TimeScalesFactory.getUTC());
    final double rate = 2 * FastMath.PI / (12 * 60);
    AttitudeProvider law = new FixedRate(new Attitude(date, FramesFactory.getEME2000(), new Rotation(0.48, 0.64, 0.36, 0.48, false), new Vector3D(rate, Vector3D.PLUS_K), Vector3D.ZERO));
    KeplerianOrbit orbit = new KeplerianOrbit(7178000.0, 1.e-4, FastMath.toRadians(50.), FastMath.toRadians(10.), FastMath.toRadians(20.), FastMath.toRadians(30.), PositionAngle.MEAN, FramesFactory.getEME2000(), date, 3.986004415e14);
    Propagator propagator = new KeplerianPropagator(orbit, law);
    double h = 0.01;
    SpacecraftState sMinus = propagator.propagate(date.shiftedBy(-h));
    SpacecraftState s0 = propagator.propagate(date);
    SpacecraftState sPlus = propagator.propagate(date.shiftedBy(h));
    // check spin is consistent with attitude evolution
    double errorAngleMinus = Rotation.distance(sMinus.shiftedBy(h).getAttitude().getRotation(), s0.getAttitude().getRotation());
    double evolutionAngleMinus = Rotation.distance(sMinus.getAttitude().getRotation(), s0.getAttitude().getRotation());
    Assert.assertEquals(0.0, errorAngleMinus, 1.0e-6 * evolutionAngleMinus);
    double errorAnglePlus = Rotation.distance(s0.getAttitude().getRotation(), sPlus.shiftedBy(-h).getAttitude().getRotation());
    double evolutionAnglePlus = Rotation.distance(s0.getAttitude().getRotation(), sPlus.getAttitude().getRotation());
    Assert.assertEquals(0.0, errorAnglePlus, 1.0e-6 * evolutionAnglePlus);
    Vector3D spin0 = s0.getAttitude().getSpin();
    Vector3D reference = AngularCoordinates.estimateRate(sMinus.getAttitude().getRotation(), sPlus.getAttitude().getRotation(), 2 * h);
    Assert.assertEquals(0.0, spin0.subtract(reference).getNorm(), 1.0e-14);
}
Also used : DateComponents(org.orekit.time.DateComponents) TimeComponents(org.orekit.time.TimeComponents) FieldRotation(org.hipparchus.geometry.euclidean.threed.FieldRotation) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) FieldKeplerianPropagator(org.orekit.propagation.analytical.FieldKeplerianPropagator) KeplerianPropagator(org.orekit.propagation.analytical.KeplerianPropagator) FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) SpacecraftState(org.orekit.propagation.SpacecraftState) FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) Propagator(org.orekit.propagation.Propagator) FieldKeplerianPropagator(org.orekit.propagation.analytical.FieldKeplerianPropagator) FieldPropagator(org.orekit.propagation.FieldPropagator) KeplerianPropagator(org.orekit.propagation.analytical.KeplerianPropagator) FieldKeplerianOrbit(org.orekit.orbits.FieldKeplerianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Test(org.junit.Test)

Example 53 with KeplerianPropagator

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

the class TabulatedProviderTest method checkError.

private double checkError(final AbsoluteDate start, AbsoluteDate end, double checkingRate, final AttitudeProvider referenceProvider, TabulatedProvider provider) throws OrekitException {
    // prepare an interpolating provider, using only internal steps
    // (i.e. ignoring interpolation near boundaries)
    Propagator interpolatingPropagator = new KeplerianPropagator(circOrbit.shiftedBy(start.durationFrom(circOrbit.getDate())));
    interpolatingPropagator.setAttitudeProvider(provider);
    // compute interpolation error on the internal steps .
    final double[] error = new double[1];
    interpolatingPropagator.setMasterMode(checkingRate, new OrekitFixedStepHandler() {

        public void init(SpacecraftState s0, AbsoluteDate t, double step) {
            error[0] = 0.0;
        }

        public void handleStep(SpacecraftState currentState, boolean isLast) throws OrekitException {
            Attitude interpolated = currentState.getAttitude();
            Attitude reference = referenceProvider.getAttitude(currentState.getOrbit(), currentState.getDate(), currentState.getFrame());
            double localError = Rotation.distance(interpolated.getRotation(), reference.getRotation());
            error[0] = FastMath.max(error[0], localError);
        }
    });
    interpolatingPropagator.propagate(end);
    return error[0];
}
Also used : KeplerianPropagator(org.orekit.propagation.analytical.KeplerianPropagator) FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) SpacecraftState(org.orekit.propagation.SpacecraftState) Propagator(org.orekit.propagation.Propagator) KeplerianPropagator(org.orekit.propagation.analytical.KeplerianPropagator) OrekitException(org.orekit.errors.OrekitException) OrekitFixedStepHandler(org.orekit.propagation.sampling.OrekitFixedStepHandler) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate)

Example 54 with KeplerianPropagator

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

the class YawCompensationTest method testSpin.

@Test
public void testSpin() throws OrekitException {
    NadirPointing nadirLaw = new NadirPointing(circOrbit.getFrame(), earthShape);
    // Target pointing attitude provider with yaw compensation
    YawCompensation law = new YawCompensation(circOrbit.getFrame(), nadirLaw);
    KeplerianOrbit orbit = new KeplerianOrbit(7178000.0, 1.e-4, FastMath.toRadians(50.), FastMath.toRadians(10.), FastMath.toRadians(20.), FastMath.toRadians(30.), PositionAngle.MEAN, FramesFactory.getEME2000(), date.shiftedBy(-300.0), 3.986004415e14);
    Propagator propagator = new KeplerianPropagator(orbit, law);
    double h = 0.01;
    SpacecraftState sMinus = propagator.propagate(date.shiftedBy(-h));
    SpacecraftState s0 = propagator.propagate(date);
    SpacecraftState sPlus = propagator.propagate(date.shiftedBy(h));
    // check spin is consistent with attitude evolution
    double errorAngleMinus = Rotation.distance(sMinus.shiftedBy(h).getAttitude().getRotation(), s0.getAttitude().getRotation());
    double evolutionAngleMinus = Rotation.distance(sMinus.getAttitude().getRotation(), s0.getAttitude().getRotation());
    Assert.assertEquals(0.0, errorAngleMinus, 8.5e-6 * evolutionAngleMinus);
    double errorAnglePlus = Rotation.distance(s0.getAttitude().getRotation(), sPlus.shiftedBy(-h).getAttitude().getRotation());
    double evolutionAnglePlus = Rotation.distance(s0.getAttitude().getRotation(), sPlus.getAttitude().getRotation());
    Assert.assertEquals(0.0, errorAnglePlus, 2.0e-5 * evolutionAnglePlus);
    Vector3D spin0 = s0.getAttitude().getSpin();
    Vector3D reference = AngularCoordinates.estimateRate(sMinus.getAttitude().getRotation(), sPlus.getAttitude().getRotation(), 2 * h);
    Assert.assertTrue(spin0.getNorm() > 1.0e-3);
    Assert.assertEquals(0.0, spin0.subtract(reference).getNorm(), 2.0e-8);
}
Also used : KeplerianPropagator(org.orekit.propagation.analytical.KeplerianPropagator) FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) SpacecraftState(org.orekit.propagation.SpacecraftState) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) Propagator(org.orekit.propagation.Propagator) KeplerianPropagator(org.orekit.propagation.analytical.KeplerianPropagator) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Test(org.junit.Test)

Example 55 with KeplerianPropagator

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

the class LocalOrbitalFrameTest method setUp.

@Before
public void setUp() throws OrekitException {
    inertialFrame = FramesFactory.getGCRF();
    initDate = AbsoluteDate.J2000_EPOCH.shiftedBy(584.);
    initialOrbit = new KeplerianOrbit(7209668.0, 0.5e-4, 1.7, 2.1, 2.9, 6.2, PositionAngle.TRUE, inertialFrame, initDate, 3.986004415e14);
    provider = new KeplerianPropagator(initialOrbit);
}
Also used : KeplerianPropagator(org.orekit.propagation.analytical.KeplerianPropagator) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Before(org.junit.Before)

Aggregations

KeplerianPropagator (org.orekit.propagation.analytical.KeplerianPropagator)59 Test (org.junit.Test)47 SpacecraftState (org.orekit.propagation.SpacecraftState)41 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)40 AbsoluteDate (org.orekit.time.AbsoluteDate)36 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)34 Propagator (org.orekit.propagation.Propagator)32 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)21 GeodeticPoint (org.orekit.bodies.GeodeticPoint)20 Orbit (org.orekit.orbits.Orbit)20 PVCoordinates (org.orekit.utils.PVCoordinates)15 FieldSpacecraftState (org.orekit.propagation.FieldSpacecraftState)14 OrekitException (org.orekit.errors.OrekitException)13 Frame (org.orekit.frames.Frame)13 TopocentricFrame (org.orekit.frames.TopocentricFrame)12 Rotation (org.hipparchus.geometry.euclidean.threed.Rotation)11 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)9 CartesianOrbit (org.orekit.orbits.CartesianOrbit)8 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)8 DateComponents (org.orekit.time.DateComponents)7