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));
}
}
}
Aggregations