use of org.orekit.frames.Frame in project Orekit by CS-SI.
the class CircularOrbitTest method testNonKeplerianDerivatives.
@Test
public void testNonKeplerianDerivatives() throws OrekitException {
final AbsoluteDate date = new AbsoluteDate("2003-05-01T00:00:20.000", TimeScalesFactory.getUTC());
final Vector3D position = new Vector3D(6896874.444705, 1956581.072644, -147476.245054);
final Vector3D velocity = new Vector3D(166.816407662, -1106.783301861, -7372.745712770);
final Vector3D acceleration = new Vector3D(-7.466182457944, -2.118153357345, 0.160004048437);
final TimeStampedPVCoordinates pv = new TimeStampedPVCoordinates(date, position, velocity, acceleration);
final Frame frame = FramesFactory.getEME2000();
final double mu = Constants.EIGEN5C_EARTH_MU;
final CircularOrbit orbit = new CircularOrbit(pv, frame, mu);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getA()), orbit.getADot(), 4.3e-8);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getEquinoctialEx()), orbit.getEquinoctialExDot(), 2.1e-15);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getEquinoctialEy()), orbit.getEquinoctialEyDot(), 5.4e-16);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getHx()), orbit.getHxDot(), 1.6e-15);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getHy()), orbit.getHyDot(), 7.3e-17);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getLv()), orbit.getLvDot(), 3.4e-16);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getLE()), orbit.getLEDot(), 3.5e-15);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getLM()), orbit.getLMDot(), 5.3e-15);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getE()), orbit.getEDot(), 6.8e-16);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getI()), orbit.getIDot(), 5.7e-16);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getCircularEx()), orbit.getCircularExDot(), 2.2e-15);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getCircularEy()), orbit.getCircularEyDot(), 5.3e-17);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getAlphaV()), orbit.getAlphaVDot(), 4.3e-15);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getAlphaE()), orbit.getAlphaEDot(), 1.2e-15);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getAlphaM()), orbit.getAlphaMDot(), 3.7e-15);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getAlpha(PositionAngle.TRUE)), orbit.getAlphaDot(PositionAngle.TRUE), 4.3e-15);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getAlpha(PositionAngle.ECCENTRIC)), orbit.getAlphaDot(PositionAngle.ECCENTRIC), 1.2e-15);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getAlpha(PositionAngle.MEAN)), orbit.getAlphaDot(PositionAngle.MEAN), 3.7e-15);
}
use of org.orekit.frames.Frame in project Orekit by CS-SI.
the class CircularOrbitTest method testNonInertialFrame.
@Test(expected = IllegalArgumentException.class)
public void testNonInertialFrame() throws IllegalArgumentException {
Vector3D position = new Vector3D(33051.2, 26184.9, -1.3E-5);
Vector3D velocity = new Vector3D(-60376.2, 76208., 2.7E-4);
PVCoordinates pvCoordinates = new PVCoordinates(position, velocity);
new CircularOrbit(pvCoordinates, new Frame(FramesFactory.getEME2000(), Transform.IDENTITY, "non-inertial", false), date, mu);
}
use of org.orekit.frames.Frame in project Orekit by CS-SI.
the class CircularOrbitTest method testCopyNonKeplerianAcceleration.
@Test
public void testCopyNonKeplerianAcceleration() throws OrekitException {
final Frame eme2000 = FramesFactory.getEME2000();
// Define GEO satellite position
final Vector3D position = new Vector3D(42164140, 0, 0);
// Build PVCoodrinates starting from its position and computing the corresponding circular velocity
final PVCoordinates pv = new PVCoordinates(position, new Vector3D(0, FastMath.sqrt(mu / position.getNorm()), 0));
// Build a KeplerianOrbit in eme2000
final Orbit orbit = new CircularOrbit(pv, eme2000, date, mu);
// Build another KeplerianOrbit as a copy of the first one
final Orbit orbitCopy = new CircularOrbit(orbit);
// Shift the orbit of a time-interval
// This works good
final Orbit shiftedOrbit = orbit.shiftedBy(10);
// This does not work
final Orbit shiftedOrbitCopy = orbitCopy.shiftedBy(10);
Assert.assertEquals(0.0, Vector3D.distance(shiftedOrbit.getPVCoordinates().getPosition(), shiftedOrbitCopy.getPVCoordinates().getPosition()), 1.0e-10);
Assert.assertEquals(0.0, Vector3D.distance(shiftedOrbit.getPVCoordinates().getVelocity(), shiftedOrbitCopy.getPVCoordinates().getVelocity()), 1.0e-10);
}
use of org.orekit.frames.Frame in project Orekit by CS-SI.
the class CircularOrbitTest method testPositionAngleDerivatives.
@Test
public void testPositionAngleDerivatives() throws OrekitException {
final AbsoluteDate date = new AbsoluteDate("2003-05-01T00:00:20.000", TimeScalesFactory.getUTC());
final Vector3D position = new Vector3D(6896874.444705, 1956581.072644, -147476.245054);
final Vector3D velocity = new Vector3D(166.816407662, -1106.783301861, -7372.745712770);
final Vector3D acceleration = new Vector3D(-7.466182457944, -2.118153357345, 0.160004048437);
final TimeStampedPVCoordinates pv = new TimeStampedPVCoordinates(date, position, velocity, acceleration);
final Frame frame = FramesFactory.getEME2000();
final double mu = Constants.EIGEN5C_EARTH_MU;
final CircularOrbit orbit = new CircularOrbit(pv, frame, mu);
for (PositionAngle type : PositionAngle.values()) {
final CircularOrbit rebuilt = new CircularOrbit(orbit.getA(), orbit.getCircularEx(), orbit.getCircularEy(), orbit.getI(), orbit.getRightAscensionOfAscendingNode(), orbit.getAlpha(type), orbit.getADot(), orbit.getCircularExDot(), orbit.getCircularEyDot(), orbit.getIDot(), orbit.getRightAscensionOfAscendingNodeDot(), orbit.getAlphaDot(type), type, orbit.getFrame(), orbit.getDate(), orbit.getMu());
Assert.assertThat(rebuilt.getA(), relativelyCloseTo(orbit.getA(), 1));
Assert.assertThat(rebuilt.getCircularEx(), relativelyCloseTo(orbit.getCircularEx(), 1));
Assert.assertThat(rebuilt.getCircularEy(), relativelyCloseTo(orbit.getCircularEy(), 1));
Assert.assertThat(rebuilt.getE(), relativelyCloseTo(orbit.getE(), 1));
Assert.assertThat(rebuilt.getI(), relativelyCloseTo(orbit.getI(), 1));
Assert.assertThat(rebuilt.getRightAscensionOfAscendingNode(), relativelyCloseTo(orbit.getRightAscensionOfAscendingNode(), 1));
Assert.assertThat(rebuilt.getADot(), relativelyCloseTo(orbit.getADot(), 1));
Assert.assertThat(rebuilt.getCircularExDot(), relativelyCloseTo(orbit.getCircularExDot(), 1));
Assert.assertThat(rebuilt.getCircularEyDot(), relativelyCloseTo(orbit.getCircularEyDot(), 1));
Assert.assertThat(rebuilt.getEDot(), relativelyCloseTo(orbit.getEDot(), 1));
Assert.assertThat(rebuilt.getIDot(), relativelyCloseTo(orbit.getIDot(), 1));
Assert.assertThat(rebuilt.getRightAscensionOfAscendingNodeDot(), relativelyCloseTo(orbit.getRightAscensionOfAscendingNodeDot(), 1));
for (PositionAngle type2 : PositionAngle.values()) {
Assert.assertThat(rebuilt.getAlpha(type2), relativelyCloseTo(orbit.getAlpha(type2), 1));
Assert.assertThat(rebuilt.getAlphaDot(type2), relativelyCloseTo(orbit.getAlphaDot(type2), 1));
}
}
}
use of org.orekit.frames.Frame in project Orekit by CS-SI.
the class FieldCircularOrbitTest method doTestNonKeplerianDerivatives.
private <T extends RealFieldElement<T>> void doTestNonKeplerianDerivatives(Field<T> field) throws OrekitException {
final FieldAbsoluteDate<T> date = new FieldAbsoluteDate<>(field, "2003-05-01T00:00:20.000", TimeScalesFactory.getUTC());
final FieldVector3D<T> position = new FieldVector3D<>(field.getZero().add(6896874.444705), field.getZero().add(1956581.072644), field.getZero().add(-147476.245054));
final FieldVector3D<T> velocity = new FieldVector3D<>(field.getZero().add(166.816407662), field.getZero().add(-1106.783301861), field.getZero().add(-7372.745712770));
final FieldVector3D<T> acceleration = new FieldVector3D<>(field.getZero().add(-7.466182457944), field.getZero().add(-2.118153357345), field.getZero().add(0.160004048437));
final TimeStampedFieldPVCoordinates<T> pv = new TimeStampedFieldPVCoordinates<>(date, position, velocity, acceleration);
final Frame frame = FramesFactory.getEME2000();
final double mu = Constants.EIGEN5C_EARTH_MU;
final FieldCircularOrbit<T> orbit = new FieldCircularOrbit<>(pv, frame, mu);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getA()), orbit.getADot().getReal(), 4.3e-8);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getEquinoctialEx()), orbit.getEquinoctialExDot().getReal(), 2.1e-15);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getEquinoctialEy()), orbit.getEquinoctialEyDot().getReal(), 5.4e-16);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getHx()), orbit.getHxDot().getReal(), 1.6e-15);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getHy()), orbit.getHyDot().getReal(), 7.3e-17);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getLv()), orbit.getLvDot().getReal(), 3.4e-16);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getLE()), orbit.getLEDot().getReal(), 3.5e-15);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getLM()), orbit.getLMDot().getReal(), 5.3e-15);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getE()), orbit.getEDot().getReal(), 6.8e-16);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getI()), orbit.getIDot().getReal(), 5.7e-16);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getCircularEx()), orbit.getCircularExDot().getReal(), 2.2e-15);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getCircularEy()), orbit.getCircularEyDot().getReal(), 5.3e-17);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getAlphaV()), orbit.getAlphaVDot().getReal(), 4.3e-15);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getAlphaE()), orbit.getAlphaEDot().getReal(), 1.2e-15);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getAlphaM()), orbit.getAlphaMDot().getReal(), 3.7e-15);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getAlpha(PositionAngle.TRUE)), orbit.getAlphaDot(PositionAngle.TRUE).getReal(), 4.3e-15);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getAlpha(PositionAngle.ECCENTRIC)), orbit.getAlphaDot(PositionAngle.ECCENTRIC).getReal(), 1.2e-15);
Assert.assertEquals(differentiate(pv, frame, mu, shifted -> shifted.getAlpha(PositionAngle.MEAN)), orbit.getAlphaDot(PositionAngle.MEAN).getReal(), 3.7e-15);
}
Aggregations