Search in sources :

Example 36 with FieldSpacecraftState

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

the class YawCompensationTest method checkField.

private <T extends RealFieldElement<T>> void checkField(final Field<T> field, final GroundPointing provider, final Orbit orbit, final AbsoluteDate date, final Frame frame) throws OrekitException {
    final Attitude attitudeD = provider.getAttitude(orbit, date, frame);
    final FieldOrbit<T> orbitF = new FieldSpacecraftState<>(field, new SpacecraftState(orbit)).getOrbit();
    final FieldAbsoluteDate<T> dateF = new FieldAbsoluteDate<>(field, date);
    final FieldAttitude<T> attitudeF = provider.getAttitude(orbitF, dateF, frame);
    Assert.assertEquals(0.0, Rotation.distance(attitudeD.getRotation(), attitudeF.getRotation().toRotation()), 2.0e-13);
    Assert.assertEquals(0.0, Vector3D.distance(attitudeD.getSpin(), attitudeF.getSpin().toVector3D()), 2.0e-11);
    Assert.assertEquals(0.0, Vector3D.distance(attitudeD.getRotationAcceleration(), attitudeF.getRotationAcceleration().toVector3D()), 2.0e-13);
    final TimeStampedPVCoordinates pvD = provider.getTargetPV(orbit, date, frame);
    final TimeStampedFieldPVCoordinates<T> pvF = provider.getTargetPV(orbitF, dateF, frame);
    Assert.assertEquals(0.0, Vector3D.distance(pvD.getPosition(), pvF.getPosition().toVector3D()), 1.0e-15);
    Assert.assertEquals(0.0, Vector3D.distance(pvD.getVelocity(), pvF.getVelocity().toVector3D()), 9.0e-9);
    Assert.assertEquals(0.0, Vector3D.distance(pvD.getAcceleration(), pvF.getAcceleration().toVector3D()), 8.0e-7);
}
Also used : FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) SpacecraftState(org.orekit.propagation.SpacecraftState) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate)

Aggregations

FieldSpacecraftState (org.orekit.propagation.FieldSpacecraftState)36 SpacecraftState (org.orekit.propagation.SpacecraftState)24 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)24 DerivativeStructure (org.hipparchus.analysis.differentiation.DerivativeStructure)20 DormandPrince853FieldIntegrator (org.hipparchus.ode.nonstiff.DormandPrince853FieldIntegrator)20 OrbitType (org.orekit.orbits.OrbitType)20 DSFactory (org.hipparchus.analysis.differentiation.DSFactory)17 FieldNumericalPropagator (org.orekit.propagation.numerical.FieldNumericalPropagator)17 Frame (org.orekit.frames.Frame)16 FieldKeplerianOrbit (org.orekit.orbits.FieldKeplerianOrbit)16 Test (org.junit.Test)15 AbstractLegacyForceModelTest (org.orekit.forces.AbstractLegacyForceModelTest)15 FieldPVCoordinates (org.orekit.utils.FieldPVCoordinates)15 PVCoordinates (org.orekit.utils.PVCoordinates)15 NumericalPropagator (org.orekit.propagation.numerical.NumericalPropagator)14 AdaptiveStepsizeIntegrator (org.hipparchus.ode.nonstiff.AdaptiveStepsizeIntegrator)12 DormandPrince853Integrator (org.hipparchus.ode.nonstiff.DormandPrince853Integrator)12 FieldVector3D (org.hipparchus.geometry.euclidean.threed.FieldVector3D)11 GaussianRandomGenerator (org.hipparchus.random.GaussianRandomGenerator)8 RandomGenerator (org.hipparchus.random.RandomGenerator)8