use of org.orekit.orbits.FieldCartesianOrbit in project Orekit by CS-SI.
the class FieldPVCoordinatesTest method testJerkIsVelocitySecondDerivative.
@Test
public void testJerkIsVelocitySecondDerivative() throws OrekitException {
final FieldCartesianOrbit<Decimal64> orbit = new FieldCartesianOrbit<>(new FieldPVCoordinates<>(new FieldVector3D<>(new Decimal64(-4947831.), new Decimal64(-3765382.), new Decimal64(-3708221.)), new FieldVector3D<>(new Decimal64(-2079.), new Decimal64(5291.), new Decimal64(-7842.))), FramesFactory.getEME2000(), FieldAbsoluteDate.getJ2000Epoch(Decimal64Field.getInstance()), Constants.EIGEN5C_EARTH_MU);
FieldPVCoordinates<FieldDerivativeStructure<Decimal64>> fv = orbit.getPVCoordinates().toDerivativeStructurePV(2);
FieldVector3D<Decimal64> numericalJerk = differentiate(orbit, o -> o.getPVCoordinates().getAcceleration());
Assert.assertEquals(numericalJerk.getX().getReal(), fv.getVelocity().getX().getPartialDerivative(2).getReal(), 1.0e-13);
Assert.assertEquals(numericalJerk.getY().getReal(), fv.getVelocity().getY().getPartialDerivative(2).getReal(), 1.0e-13);
Assert.assertEquals(numericalJerk.getZ().getReal(), fv.getVelocity().getZ().getPartialDerivative(2).getReal(), 1.0e-13);
}
use of org.orekit.orbits.FieldCartesianOrbit in project Orekit by CS-SI.
the class FieldPVCoordinatesTest method testJerkIsAccelerationDerivative.
@Test
public void testJerkIsAccelerationDerivative() throws OrekitException {
final FieldCartesianOrbit<Decimal64> orbit = new FieldCartesianOrbit<>(new FieldPVCoordinates<>(new FieldVector3D<>(new Decimal64(-4947831.), new Decimal64(-3765382.), new Decimal64(-3708221.)), new FieldVector3D<>(new Decimal64(-2079.), new Decimal64(5291.), new Decimal64(-7842.))), FramesFactory.getEME2000(), FieldAbsoluteDate.getJ2000Epoch(Decimal64Field.getInstance()), Constants.EIGEN5C_EARTH_MU);
FieldPVCoordinates<FieldDerivativeStructure<Decimal64>> fv1 = orbit.getPVCoordinates().toDerivativeStructurePV(1);
FieldVector3D<Decimal64> numericalJerk = differentiate(orbit, o -> o.getPVCoordinates().getAcceleration());
Assert.assertEquals(numericalJerk.getX().getReal(), fv1.getAcceleration().getX().getPartialDerivative(1).getReal(), 1.0e-13);
Assert.assertEquals(numericalJerk.getY().getReal(), fv1.getAcceleration().getY().getPartialDerivative(1).getReal(), 1.0e-13);
Assert.assertEquals(numericalJerk.getZ().getReal(), fv1.getAcceleration().getZ().getPartialDerivative(1).getReal(), 1.0e-13);
FieldPVCoordinates<FieldDerivativeStructure<Decimal64>> fv2 = orbit.getPVCoordinates().toDerivativeStructurePV(2);
Assert.assertEquals(numericalJerk.getX().getReal(), fv2.getAcceleration().getX().getPartialDerivative(1).getReal(), 1.0e-13);
Assert.assertEquals(numericalJerk.getY().getReal(), fv2.getAcceleration().getY().getPartialDerivative(1).getReal(), 1.0e-13);
Assert.assertEquals(numericalJerk.getZ().getReal(), fv2.getAcceleration().getZ().getPartialDerivative(1).getReal(), 1.0e-13);
}
Aggregations