use of org.orekit.orbits.CartesianOrbit in project Orekit by CS-SI.
the class PVCoordinatesTest method testJounceIsAccelerationSecondDerivative.
@Test
public void testJounceIsAccelerationSecondDerivative() throws OrekitException {
final CartesianOrbit orbit = new CartesianOrbit(new PVCoordinates(new Vector3D(-4947831., -3765382., -3708221.), new Vector3D(-2079., 5291., -7842.)), FramesFactory.getEME2000(), AbsoluteDate.J2000_EPOCH, Constants.EIGEN5C_EARTH_MU);
FieldPVCoordinates<DerivativeStructure> fv = orbit.getPVCoordinates().toDerivativeStructurePV(2);
Vector3D numericalJounce = differentiate(orbit, o -> {
FieldVector3D<DerivativeStructure> a = o.getPVCoordinates().toDerivativeStructurePV(1).getAcceleration();
return new Vector3D(a.getX().getPartialDerivative(1), a.getY().getPartialDerivative(1), a.getZ().getPartialDerivative(1));
});
Assert.assertEquals(numericalJounce.getX(), fv.getAcceleration().getX().getPartialDerivative(2), 1.0e-15);
Assert.assertEquals(numericalJounce.getY(), fv.getAcceleration().getY().getPartialDerivative(2), 1.0e-15);
Assert.assertEquals(numericalJounce.getZ(), fv.getAcceleration().getZ().getPartialDerivative(2), 1.0e-15);
}
use of org.orekit.orbits.CartesianOrbit in project Orekit by CS-SI.
the class PVCoordinatesTest method testJerkIsVelocitySecondDerivative.
@Test
public void testJerkIsVelocitySecondDerivative() throws OrekitException {
final CartesianOrbit orbit = new CartesianOrbit(new PVCoordinates(new Vector3D(-4947831., -3765382., -3708221.), new Vector3D(-2079., 5291., -7842.)), FramesFactory.getEME2000(), AbsoluteDate.J2000_EPOCH, Constants.EIGEN5C_EARTH_MU);
FieldPVCoordinates<DerivativeStructure> fv = orbit.getPVCoordinates().toDerivativeStructurePV(2);
Vector3D numericalJerk = differentiate(orbit, o -> o.getPVCoordinates().getAcceleration());
Assert.assertEquals(numericalJerk.getX(), fv.getVelocity().getX().getPartialDerivative(2), 1.0e-13);
Assert.assertEquals(numericalJerk.getY(), fv.getVelocity().getY().getPartialDerivative(2), 1.0e-13);
Assert.assertEquals(numericalJerk.getZ(), fv.getVelocity().getZ().getPartialDerivative(2), 1.0e-13);
}
Aggregations