use of org.hipparchus.ode.nonstiff.GraggBulirschStoerIntegrator in project Orekit by CS-SI.
the class ThirdBodyAttractionTest method testSunContrib.
@Test(expected = OrekitException.class)
public void testSunContrib() throws OrekitException {
// initialization
AbsoluteDate date = new AbsoluteDate(new DateComponents(1970, 07, 01), new TimeComponents(13, 59, 27.816), TimeScalesFactory.getUTC());
Orbit orbit = new EquinoctialOrbit(42164000, 10e-3, 10e-3, FastMath.tan(0.001745329) * FastMath.cos(2 * FastMath.PI / 3), FastMath.tan(0.001745329) * FastMath.sin(2 * FastMath.PI / 3), 0.1, PositionAngle.TRUE, FramesFactory.getEME2000(), date, mu);
double period = 2 * FastMath.PI * orbit.getA() * FastMath.sqrt(orbit.getA() / orbit.getMu());
// set up propagator
NumericalPropagator calc = new NumericalPropagator(new GraggBulirschStoerIntegrator(10.0, period, 0, 1.0e-5));
calc.addForceModel(new ThirdBodyAttraction(CelestialBodyFactory.getSun()));
// set up step handler to perform checks
calc.setMasterMode(FastMath.floor(period), new ReferenceChecker(date) {
protected double hXRef(double t) {
return -1.06757e-3 + 0.221415e-11 * t + 18.9421e-5 * FastMath.cos(3.9820426e-7 * t) - 7.59983e-5 * FastMath.sin(3.9820426e-7 * t);
}
protected double hYRef(double t) {
return 1.43526e-3 + 7.49765e-11 * t + 6.9448e-5 * FastMath.cos(3.9820426e-7 * t) + 17.6083e-5 * FastMath.sin(3.9820426e-7 * t);
}
});
AbsoluteDate finalDate = date.shiftedBy(365 * period);
calc.setInitialState(new SpacecraftState(orbit));
calc.propagate(finalDate);
}
use of org.hipparchus.ode.nonstiff.GraggBulirschStoerIntegrator in project Orekit by CS-SI.
the class ThirdBodyAttractionTest method testMoonContrib.
@Test
public void testMoonContrib() throws OrekitException {
// initialization
AbsoluteDate date = new AbsoluteDate(new DateComponents(1970, 07, 01), new TimeComponents(13, 59, 27.816), TimeScalesFactory.getUTC());
Orbit orbit = new EquinoctialOrbit(42164000, 10e-3, 10e-3, FastMath.tan(0.001745329) * FastMath.cos(2 * FastMath.PI / 3), FastMath.tan(0.001745329) * FastMath.sin(2 * FastMath.PI / 3), 0.1, PositionAngle.TRUE, FramesFactory.getEME2000(), date, mu);
double period = 2 * FastMath.PI * orbit.getA() * FastMath.sqrt(orbit.getA() / orbit.getMu());
// set up propagator
NumericalPropagator calc = new NumericalPropagator(new GraggBulirschStoerIntegrator(10.0, period, 0, 1.0e-5));
calc.addForceModel(new ThirdBodyAttraction(CelestialBodyFactory.getMoon()));
// set up step handler to perform checks
calc.setMasterMode(FastMath.floor(period), new ReferenceChecker(date) {
protected double hXRef(double t) {
return -0.000906173 + 1.93933e-11 * t + 1.0856e-06 * FastMath.cos(5.30637e-05 * t) - 1.22574e-06 * FastMath.sin(5.30637e-05 * t);
}
protected double hYRef(double t) {
return 0.00151973 + 1.88991e-10 * t - 1.25972e-06 * FastMath.cos(5.30637e-05 * t) - 1.00581e-06 * FastMath.sin(5.30637e-05 * t);
}
});
AbsoluteDate finalDate = date.shiftedBy(31 * period);
calc.setInitialState(new SpacecraftState(orbit));
calc.propagate(finalDate);
}
use of org.hipparchus.ode.nonstiff.GraggBulirschStoerIntegrator in project Orekit by CS-SI.
the class CloseEventsNumericalGBSTest method getPropagator.
/**
* Create a propagator using the {@link #initialOrbit}.
*
* @param stepSize of integrator.
* @return a usable propagator.
* @throws OrekitException
*/
public Propagator getPropagator(double stepSize) throws OrekitException {
double[][] tol = NumericalPropagator.tolerances(1e-1, initialOrbit, OrbitType.CARTESIAN);
final NumericalPropagator propagator = new NumericalPropagator(new GraggBulirschStoerIntegrator(stepSize, stepSize, tol[0], tol[1]));
propagator.setInitialState(new SpacecraftState(initialOrbit));
propagator.setOrbitType(OrbitType.CARTESIAN);
return propagator;
}
Aggregations