Search in sources :

Example 11 with FieldCartesianOrbit

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);
}
Also used : Decimal64(org.hipparchus.util.Decimal64) FieldDerivativeStructure(org.hipparchus.analysis.differentiation.FieldDerivativeStructure) FieldCartesianOrbit(org.orekit.orbits.FieldCartesianOrbit) FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) Test(org.junit.Test)

Example 12 with FieldCartesianOrbit

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);
}
Also used : Decimal64(org.hipparchus.util.Decimal64) FieldDerivativeStructure(org.hipparchus.analysis.differentiation.FieldDerivativeStructure) FieldCartesianOrbit(org.orekit.orbits.FieldCartesianOrbit) FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) Test(org.junit.Test)

Aggregations

FieldCartesianOrbit (org.orekit.orbits.FieldCartesianOrbit)12 FieldVector3D (org.hipparchus.geometry.euclidean.threed.FieldVector3D)9 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)8 Frame (org.orekit.frames.Frame)5 OrbitType (org.orekit.orbits.OrbitType)4 TimeScale (org.orekit.time.TimeScale)4 TimeStampedFieldPVCoordinates (org.orekit.utils.TimeStampedFieldPVCoordinates)4 DSFactory (org.hipparchus.analysis.differentiation.DSFactory)3 DerivativeStructure (org.hipparchus.analysis.differentiation.DerivativeStructure)3 FieldDerivativeStructure (org.hipparchus.analysis.differentiation.FieldDerivativeStructure)3 Decimal64 (org.hipparchus.util.Decimal64)3 Test (org.junit.Test)3 FieldKeplerianOrbit (org.orekit.orbits.FieldKeplerianOrbit)3 FieldSpacecraftState (org.orekit.propagation.FieldSpacecraftState)3 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)2 FieldAttitude (org.orekit.attitudes.FieldAttitude)2 ParameterDriver (org.orekit.utils.ParameterDriver)2 Field (org.hipparchus.Field)1 FieldRotation (org.hipparchus.geometry.euclidean.threed.FieldRotation)1 DormandPrince853FieldIntegrator (org.hipparchus.ode.nonstiff.DormandPrince853FieldIntegrator)1