Search in sources :

Example 21 with TimeStampedFieldPVCoordinates

use of org.orekit.utils.TimeStampedFieldPVCoordinates in project Orekit by CS-SI.

the class FieldKeplerianOrbitTest method doTestPositionAngleHyperbolicDerivatives.

private <T extends RealFieldElement<T>> void doTestPositionAngleHyperbolicDerivatives(final Field<T> field) throws OrekitException {
    final FieldAbsoluteDate<T> date = new FieldAbsoluteDate<>(field, "2003-05-01T00:00:20.000", TimeScalesFactory.getUTC());
    final FieldVector3D<T> position = new FieldVector3D<>(field.getZero().add(224267911.905821), field.getZero().add(290251613.109399), field.getZero().add(45534292.777492));
    final FieldVector3D<T> velocity = new FieldVector3D<>(field.getZero().add(-1494.068165293), field.getZero().add(1124.771027677), field.getZero().add(526.915286134));
    final FieldVector3D<T> acceleration = new FieldVector3D<>(field.getZero().add(-0.001295920501), field.getZero().add(-0.002233045187), field.getZero().add(-0.000349906292));
    final TimeStampedFieldPVCoordinates<T> pv = new TimeStampedFieldPVCoordinates<>(date, position, velocity, acceleration);
    final Frame frame = FramesFactory.getEME2000();
    final double mu = Constants.EIGEN5C_EARTH_MU;
    final FieldKeplerianOrbit<T> orbit = new FieldKeplerianOrbit<>(pv, frame, mu);
    for (PositionAngle type : PositionAngle.values()) {
        final FieldKeplerianOrbit<T> rebuilt = new FieldKeplerianOrbit<>(orbit.getA(), orbit.getE(), orbit.getI(), orbit.getPerigeeArgument(), orbit.getRightAscensionOfAscendingNode(), orbit.getAnomaly(type), orbit.getADot(), orbit.getEDot(), orbit.getIDot(), orbit.getPerigeeArgumentDot(), orbit.getRightAscensionOfAscendingNodeDot(), orbit.getAnomalyDot(type), type, orbit.getFrame(), orbit.getDate(), orbit.getMu());
        Assert.assertThat(rebuilt.getA().getReal(), relativelyCloseTo(orbit.getA().getReal(), 1));
        Assert.assertThat(rebuilt.getE().getReal(), relativelyCloseTo(orbit.getE().getReal(), 1));
        Assert.assertThat(rebuilt.getI().getReal(), relativelyCloseTo(orbit.getI().getReal(), 1));
        Assert.assertThat(rebuilt.getPerigeeArgument().getReal(), relativelyCloseTo(orbit.getPerigeeArgument().getReal(), 1));
        Assert.assertThat(rebuilt.getRightAscensionOfAscendingNode().getReal(), relativelyCloseTo(orbit.getRightAscensionOfAscendingNode().getReal(), 1));
        Assert.assertThat(rebuilt.getADot().getReal(), relativelyCloseTo(orbit.getADot().getReal(), 1));
        Assert.assertThat(rebuilt.getEDot().getReal(), relativelyCloseTo(orbit.getEDot().getReal(), 1));
        Assert.assertThat(rebuilt.getIDot().getReal(), relativelyCloseTo(orbit.getIDot().getReal(), 1));
        Assert.assertThat(rebuilt.getPerigeeArgumentDot().getReal(), relativelyCloseTo(orbit.getPerigeeArgumentDot().getReal(), 1));
        Assert.assertThat(rebuilt.getRightAscensionOfAscendingNodeDot().getReal(), relativelyCloseTo(orbit.getRightAscensionOfAscendingNodeDot().getReal(), 1));
        for (PositionAngle type2 : PositionAngle.values()) {
            Assert.assertThat(rebuilt.getAnomaly(type2).getReal(), relativelyCloseTo(orbit.getAnomaly(type2).getReal(), 2));
            Assert.assertThat(rebuilt.getAnomalyDot(type2).getReal(), relativelyCloseTo(orbit.getAnomalyDot(type2).getReal(), 4));
        }
    }
}
Also used : Frame(org.orekit.frames.Frame) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) TimeStampedFieldPVCoordinates(org.orekit.utils.TimeStampedFieldPVCoordinates)

Aggregations

TimeStampedFieldPVCoordinates (org.orekit.utils.TimeStampedFieldPVCoordinates)21 FieldVector3D (org.hipparchus.geometry.euclidean.threed.FieldVector3D)19 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)18 Frame (org.orekit.frames.Frame)11 DSFactory (org.hipparchus.analysis.differentiation.DSFactory)9 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)8 Transform (org.orekit.frames.Transform)7 ArrayList (java.util.ArrayList)6 Field (org.hipparchus.Field)6 DerivativeStructure (org.hipparchus.analysis.differentiation.DerivativeStructure)6 Assert (org.junit.Assert)6 Test (org.junit.Test)6 OrekitException (org.orekit.errors.OrekitException)6 List (java.util.List)5 Function (java.util.function.Function)5 RealFieldElement (org.hipparchus.RealFieldElement)5 UnivariateFunction (org.hipparchus.analysis.UnivariateFunction)5 FiniteDifferencesDifferentiator (org.hipparchus.analysis.differentiation.FiniteDifferencesDifferentiator)5 UnivariateDifferentiableFunction (org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction)5 FieldMatrixPreservingVisitor (org.hipparchus.linear.FieldMatrixPreservingVisitor)5