use of org.orekit.utils.PVCoordinates in project Orekit by CS-SI.
the class LocalOrbitalFrameTest method testLVLH.
@Test
public void testLVLH() throws OrekitException {
AbsoluteDate date = initDate.shiftedBy(400);
PVCoordinates pv = provider.getPVCoordinates(date, inertialFrame);
checkFrame(LOFType.LVLH, date, pv.getPosition(), Vector3D.crossProduct(pv.getMomentum(), pv.getPosition()), pv.getMomentum(), pv.getMomentum().negate());
}
use of org.orekit.utils.PVCoordinates in project Orekit by CS-SI.
the class LocalOrbitalFrameTest method testVVLH.
@Test
public void testVVLH() throws OrekitException {
AbsoluteDate date = initDate.shiftedBy(400);
PVCoordinates pv = provider.getPVCoordinates(date, inertialFrame);
checkFrame(LOFType.VVLH, date, Vector3D.crossProduct(pv.getMomentum(), pv.getPosition()), pv.getMomentum().negate(), pv.getPosition().negate(), pv.getMomentum().negate());
}
use of org.orekit.utils.PVCoordinates in project Orekit by CS-SI.
the class TEMEProviderTest method testValladoTEMEofDate.
@Test
public void testValladoTEMEofDate() throws OrekitException {
// this reference test has been extracted from Vallado's book:
// Fundamentals of Astrodynamics and Applications
// David A. Vallado, Space Technology Library, 2007
AbsoluteDate t0 = new AbsoluteDate(new DateComponents(2000, 182), new TimeComponents(0.78495062 * Constants.JULIAN_DAY), TimeScalesFactory.getUTC());
// TEME
PVCoordinates pvTEME = new PVCoordinates(new Vector3D(-9060473.73569, 4658709.52502, 813686.73153), new Vector3D(-2232.832783, -4110.453490, -3157.345433));
// reference position in EME2000
// note that Valado's book gives
// PVCoordinates pvEME2000Ref =
// new PVCoordinates(new Vector3D(-9059941.3786, 4659697.2000, 813958.8875),
// new Vector3D(-2233.348094, -4110.136162, -3157.394074));
// the values we use here are slightly different, they were computed using
// Vallado's C++ companion code to the book, using the teme_j2k function with
// all 106 nutation terms and the 2 corrections elements of the equation of the equinoxes
PVCoordinates pvEME2000Ref = new PVCoordinates(new Vector3D(-9059941.5224999374914, 4659697.1225837596648, 813957.72947647583351), new Vector3D(-2233.3476939179299769, -4110.1362849403413335, -3157.3941963060194738));
Transform t = FramesFactory.getTEME().getTransformTo(FramesFactory.getEME2000(), t0);
PVCoordinates pvEME2000Computed = t.transformPVCoordinates(pvTEME);
PVCoordinates delta = new PVCoordinates(pvEME2000Computed, pvEME2000Ref);
Assert.assertEquals(0.0, delta.getPosition().getNorm(), 0.025);
Assert.assertEquals(0.0, delta.getVelocity().getNorm(), 1.0e-4);
}
use of org.orekit.utils.PVCoordinates in project Orekit by CS-SI.
the class TODProviderTest method testAASReferenceLEO.
@Test
public void testAASReferenceLEO() throws OrekitException {
// this reference test has been extracted from the following paper:
// Implementation Issues Surrounding the New IAU Reference Systems for Astrodynamics
// David A. Vallado, John H. Seago, P. Kenneth Seidelmann
// http://www.centerforspace.com/downloads/files/pubs/AAS-06-134.pdf
Utils.setLoaders(IERSConventions.IERS_1996, Utils.buildEOPList(IERSConventions.IERS_1996, ITRFVersion.ITRF_2008, new double[][] { { 53098, -0.4399619, 0.0015563, -0.140682, 0.333309, -0.052195, -0.003875, Double.NaN, Double.NaN }, { 53099, -0.4399619, 0.0015563, -0.140682, 0.333309, -0.052195, -0.003875, Double.NaN, Double.NaN }, { 53100, -0.4399619, 0.0015563, -0.140682, 0.333309, -0.052195, -0.003875, Double.NaN, Double.NaN }, { 53101, -0.4399619, 0.0015563, -0.140682, 0.333309, -0.052195, -0.003875, Double.NaN, Double.NaN }, { 53102, -0.4399619, 0.0015563, -0.140682, 0.333309, -0.052195, -0.003875, Double.NaN, Double.NaN }, { 53103, -0.4399619, 0.0015563, -0.140682, 0.333309, -0.052195, -0.003875, Double.NaN, Double.NaN }, { 53104, -0.4399619, 0.0015563, -0.140682, 0.333309, -0.052195, -0.003875, Double.NaN, Double.NaN }, { 53105, -0.4399619, 0.0015563, -0.140682, 0.333309, -0.052195, -0.003875, Double.NaN, Double.NaN } }));
AbsoluteDate t0 = new AbsoluteDate(new DateComponents(2004, 04, 06), new TimeComponents(07, 51, 28.386009), TimeScalesFactory.getUTC());
Transform tt = FramesFactory.getMOD(IERSConventions.IERS_1996).getTransformTo(FramesFactory.getTOD(IERSConventions.IERS_1996, true), t0);
Transform ff = FramesFactory.getMOD(false).getTransformTo(FramesFactory.getTOD(false), t0);
// TOD iau76
PVCoordinates pvTODiau76 = new PVCoordinates(new Vector3D(5094514.7804, 6127366.4612, 6380344.5328), new Vector3D(-4746.088567, 786.077222, 5531.931288));
// MOD iau76
PVCoordinates pvMODiau76WithoutNutCorr = new PVCoordinates(new Vector3D(5094029.0167, 6127870.9363, 6380247.8885), new Vector3D(-4746.262495, 786.014149, 5531.791025));
// MOD iau76
PVCoordinates pvMODiau76 = new PVCoordinates(new Vector3D(5094028.3745, 6127870.8164, 6380248.5164), new Vector3D(-4746.263052, 786.014045, 5531.790562));
// it seems the induced effect of pole nutation correction δΔψ on the equation of the equinoxes
// was not taken into account in the reference paper, so we fix it here for the test
final double dDeltaPsi = FramesFactory.getEOPHistory(IERSConventions.IERS_1996, true).getEquinoxNutationCorrection(t0)[0];
final double epsilonA = IERSConventions.IERS_1996.getMeanObliquityFunction().value(t0);
final Transform fix = new Transform(t0, new Rotation(Vector3D.PLUS_K, dDeltaPsi * FastMath.cos(epsilonA), RotationConvention.FRAME_TRANSFORM));
checkPV(pvTODiau76, fix.transformPVCoordinates(tt.transformPVCoordinates(pvMODiau76)), 1.13e-3, 5.3e-5);
checkPV(pvTODiau76, ff.transformPVCoordinates(pvMODiau76WithoutNutCorr), 1.07e-3, 5.3e-5);
}
use of org.orekit.utils.PVCoordinates in project Orekit by CS-SI.
the class TransformProviderUtilTest method checkNoTransform.
private void checkNoTransform(FieldTransform<Decimal64> transform, RandomGenerator random) {
for (int i = 0; i < 100; ++i) {
Vector3D a = randomVector(1.0e3, random);
Vector3D tA = transform.transformVector(a).toVector3D();
Assert.assertEquals(0, a.subtract(tA).getNorm(), 1.0e-10 * a.getNorm());
Vector3D b = randomVector(1.0e3, random);
Vector3D tB = transform.transformPosition(b).toVector3D();
Assert.assertEquals(0, b.subtract(tB).getNorm(), 1.0e-10 * b.getNorm());
PVCoordinates pv = new PVCoordinates(randomVector(1.0e3, random), randomVector(1.0, random), randomVector(1.0e-3, random));
PVCoordinates tPv = transform.transformPVCoordinates(pv).toPVCoordinates();
checkVector(pv.getPosition(), tPv.getPosition(), 1.0e-10);
checkVector(pv.getVelocity(), tPv.getVelocity(), 3.0e-9);
checkVector(pv.getAcceleration(), tPv.getAcceleration(), 3.0e-9);
}
}
Aggregations