use of org.orekit.orbits.KeplerianOrbit in project Orekit by CS-SI.
the class PartialDerivativesTest method testWrongParametersDimension.
@Test
public void testWrongParametersDimension() throws OrekitException {
Orbit initialOrbit = new KeplerianOrbit(8000000.0, 0.01, 0.1, 0.7, 0, 1.2, PositionAngle.TRUE, FramesFactory.getEME2000(), AbsoluteDate.J2000_EPOCH, Constants.EIGEN5C_EARTH_MU);
double dP = 0.001;
ForceModel sunAttraction = new ThirdBodyAttraction(CelestialBodyFactory.getSun());
sunAttraction.getParameterDriver("Sun attraction coefficient").setSelected(true);
ForceModel moonAttraction = new ThirdBodyAttraction(CelestialBodyFactory.getMoon());
NumericalPropagator propagator = setUpPropagator(initialOrbit, dP, OrbitType.EQUINOCTIAL, PositionAngle.TRUE, sunAttraction, moonAttraction);
PartialDerivativesEquations partials = new PartialDerivativesEquations("partials", propagator);
try {
partials.setInitialJacobians(new SpacecraftState(initialOrbit), new double[6][6], new double[6][3]);
partials.computeDerivatives(new SpacecraftState(initialOrbit), new double[6]);
Assert.fail("an exception should have been thrown");
} catch (OrekitException oe) {
Assert.assertEquals(OrekitMessages.INITIAL_MATRIX_AND_PARAMETERS_NUMBER_MISMATCH, oe.getSpecifier());
}
}
use of org.orekit.orbits.KeplerianOrbit in project Orekit by CS-SI.
the class PartialDerivativesTest method testTooLargeDimension.
@Test(expected = OrekitException.class)
public void testTooLargeDimension() throws OrekitException {
Orbit initialOrbit = new KeplerianOrbit(8000000.0, 0.01, 0.1, 0.7, 0, 1.2, PositionAngle.TRUE, FramesFactory.getEME2000(), AbsoluteDate.J2000_EPOCH, Constants.EIGEN5C_EARTH_MU);
double dP = 0.001;
NumericalPropagator propagator = setUpPropagator(initialOrbit, dP, OrbitType.EQUINOCTIAL, PositionAngle.TRUE);
PartialDerivativesEquations partials = new PartialDerivativesEquations("partials", propagator);
partials.setInitialJacobians(new SpacecraftState(initialOrbit), new double[8][6], new double[6][2]);
}
use of org.orekit.orbits.KeplerianOrbit in project Orekit by CS-SI.
the class PartialDerivativesTest method testNotInitialized.
@Test(expected = OrekitException.class)
public void testNotInitialized() throws OrekitException {
Orbit initialOrbit = new KeplerianOrbit(8000000.0, 0.01, 0.1, 0.7, 0, 1.2, PositionAngle.TRUE, FramesFactory.getEME2000(), AbsoluteDate.J2000_EPOCH, Constants.EIGEN5C_EARTH_MU);
double dP = 0.001;
NumericalPropagator propagator = setUpPropagator(initialOrbit, dP, OrbitType.EQUINOCTIAL, PositionAngle.TRUE);
new PartialDerivativesEquations("partials", propagator).getMapper();
}
use of org.orekit.orbits.KeplerianOrbit in project Orekit by CS-SI.
the class PartialDerivativesTest method testTooSmallDimension.
@Test(expected = OrekitException.class)
public void testTooSmallDimension() throws OrekitException {
Orbit initialOrbit = new KeplerianOrbit(8000000.0, 0.01, 0.1, 0.7, 0, 1.2, PositionAngle.TRUE, FramesFactory.getEME2000(), AbsoluteDate.J2000_EPOCH, Constants.EIGEN5C_EARTH_MU);
double dP = 0.001;
NumericalPropagator propagator = setUpPropagator(initialOrbit, dP, OrbitType.EQUINOCTIAL, PositionAngle.TRUE);
PartialDerivativesEquations partials = new PartialDerivativesEquations("partials", propagator);
partials.setInitialJacobians(new SpacecraftState(initialOrbit), new double[5][6], new double[6][2]);
}
use of org.orekit.orbits.KeplerianOrbit in project Orekit by CS-SI.
the class DSSTPropagatorTest method testEphemerisDates.
@Test
public void testEphemerisDates() throws OrekitException {
// setup
TimeScale tai = TimeScalesFactory.getTAI();
AbsoluteDate initialDate = new AbsoluteDate("2015-07-01", tai);
AbsoluteDate startDate = new AbsoluteDate("2015-07-03", tai).shiftedBy(-0.1);
AbsoluteDate endDate = new AbsoluteDate("2015-07-04", tai);
Frame eci = FramesFactory.getGCRF();
KeplerianOrbit orbit = new KeplerianOrbit(600e3 + Constants.WGS84_EARTH_EQUATORIAL_RADIUS, 0, 0, 0, 0, 0, PositionAngle.TRUE, eci, initialDate, Constants.EIGEN5C_EARTH_MU);
double[][] tol = DSSTPropagator.tolerances(1, orbit);
Propagator prop = new DSSTPropagator(new DormandPrince853Integrator(0.1, 500, tol[0], tol[1]));
prop.resetInitialState(new SpacecraftState(new CartesianOrbit(orbit)));
// action
prop.setEphemerisMode();
prop.propagate(startDate, endDate);
BoundedPropagator ephemeris = prop.getGeneratedEphemeris();
// verify
TimeStampedPVCoordinates actualPV = ephemeris.getPVCoordinates(startDate, eci);
TimeStampedPVCoordinates expectedPV = orbit.getPVCoordinates(startDate, eci);
MatcherAssert.assertThat(actualPV.getPosition(), OrekitMatchers.vectorCloseTo(expectedPV.getPosition(), 1.0));
MatcherAssert.assertThat(actualPV.getVelocity(), OrekitMatchers.vectorCloseTo(expectedPV.getVelocity(), 1.0));
MatcherAssert.assertThat(ephemeris.getMinDate().durationFrom(startDate), OrekitMatchers.closeTo(0, 0));
MatcherAssert.assertThat(ephemeris.getMaxDate().durationFrom(endDate), OrekitMatchers.closeTo(0, 0));
// test date
AbsoluteDate date = endDate.shiftedBy(-0.11);
Assert.assertEquals(ephemeris.propagate(date).getDate().durationFrom(date), 0, 0);
}
Aggregations