Search in sources :

Example 56 with CartesianOrbit

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

Example 57 with CartesianOrbit

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

Aggregations

CartesianOrbit (org.orekit.orbits.CartesianOrbit)57 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)48 AbsoluteDate (org.orekit.time.AbsoluteDate)43 SpacecraftState (org.orekit.propagation.SpacecraftState)38 Test (org.junit.Test)37 PVCoordinates (org.orekit.utils.PVCoordinates)32 TimeStampedPVCoordinates (org.orekit.utils.TimeStampedPVCoordinates)28 FieldVector3D (org.hipparchus.geometry.euclidean.threed.FieldVector3D)25 FieldSpacecraftState (org.orekit.propagation.FieldSpacecraftState)22 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)20 Orbit (org.orekit.orbits.Orbit)20 Frame (org.orekit.frames.Frame)17 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)15 OrekitException (org.orekit.errors.OrekitException)14 AbstractLegacyForceModelTest (org.orekit.forces.AbstractLegacyForceModelTest)14 FieldPVCoordinates (org.orekit.utils.FieldPVCoordinates)13 BoundedPropagator (org.orekit.propagation.BoundedPropagator)11 Propagator (org.orekit.propagation.Propagator)10 TimeScale (org.orekit.time.TimeScale)10 DormandPrince853Integrator (org.hipparchus.ode.nonstiff.DormandPrince853Integrator)9