use of org.hipparchus.ode.AbstractIntegrator in project Orekit by CS-SI.
the class HolmesFeatherstoneAttractionModelTest method createEphemeris.
private BoundedPropagator createEphemeris(double dP, SpacecraftState initialState, double duration, NormalizedSphericalHarmonicsProvider provider) throws OrekitException {
double[][] tol = NumericalPropagator.tolerances(dP, initialState.getOrbit(), OrbitType.CARTESIAN);
AbstractIntegrator integrator = new DormandPrince853Integrator(0.001, 120.0, tol[0], tol[1]);
NumericalPropagator propagator = new NumericalPropagator(integrator);
propagator.setEphemerisMode();
propagator.setOrbitType(OrbitType.CARTESIAN);
propagator.addForceModel(new HolmesFeatherstoneAttractionModel(FramesFactory.getITRF(IERSConventions.IERS_2010, true), provider));
propagator.setInitialState(initialState);
propagator.propagate(initialState.getDate().shiftedBy(duration));
return propagator.getGeneratedEphemeris();
}
use of org.hipparchus.ode.AbstractIntegrator in project Orekit by CS-SI.
the class OceanTidesTest method propagate.
private SpacecraftState propagate(Orbit orbit, AbsoluteDate target, ForceModel... forceModels) throws OrekitException {
double[][] tolerances = NumericalPropagator.tolerances(10, orbit, OrbitType.KEPLERIAN);
AbstractIntegrator integrator = new DormandPrince853Integrator(1.0e-3, 300, tolerances[0], tolerances[1]);
NumericalPropagator propagator = new NumericalPropagator(integrator);
for (ForceModel forceModel : forceModels) {
propagator.addForceModel(forceModel);
}
propagator.setInitialState(new SpacecraftState(orbit));
return propagator.propagate(target);
}
use of org.hipparchus.ode.AbstractIntegrator in project Orekit by CS-SI.
the class RelativityTest method testSmallEffectOnOrbit.
/**
* check against example in Tapley, Schutz, and Born, p 65-66. They predict a
* progression of perigee of 11 arcsec/year. To get the same results we must set the
* propagation tolerances to 1e-5.
*
* @throws OrekitException on error
*/
@Test
public void testSmallEffectOnOrbit() throws OrekitException {
// setup
final double gm = Constants.EIGEN5C_EARTH_MU;
Orbit orbit = new KeplerianOrbit(7500e3, 0.025, FastMath.toRadians(41.2), 0, 0, 0, PositionAngle.TRUE, frame, date, gm);
double[][] tol = NumericalPropagator.tolerances(0.00001, orbit, OrbitType.CARTESIAN);
AbstractIntegrator integrator = new DormandPrince853Integrator(1, 3600, tol[0], tol[1]);
NumericalPropagator propagator = new NumericalPropagator(integrator);
propagator.setOrbitType(OrbitType.CARTESIAN);
propagator.addForceModel(new Relativity(gm));
propagator.setInitialState(new SpacecraftState(orbit));
// action: propagate a period
AbsoluteDate end = orbit.getDate().shiftedBy(30 * Constants.JULIAN_DAY);
PVCoordinates actual = propagator.getPVCoordinates(end, frame);
// verify
KeplerianOrbit endOrbit = new KeplerianOrbit(actual, frame, end, gm);
KeplerianOrbit startOrbit = new KeplerianOrbit(orbit);
double dp = endOrbit.getPerigeeArgument() - startOrbit.getPerigeeArgument();
double dtYears = end.durationFrom(orbit.getDate()) / Constants.JULIAN_YEAR;
double dpDeg = FastMath.toDegrees(dp);
// change in argument of perigee in arcseconds per year
double arcsecPerYear = dpDeg * 3600 / dtYears;
Assert.assertEquals(11, arcsecPerYear, 0.5);
}
use of org.hipparchus.ode.AbstractIntegrator in project Orekit by CS-SI.
the class SolidTidesTest method propagate.
private SpacecraftState propagate(Orbit orbit, AbsoluteDate target, ForceModel... forceModels) throws OrekitException {
double[][] tolerances = NumericalPropagator.tolerances(10, orbit, OrbitType.KEPLERIAN);
AbstractIntegrator integrator = new DormandPrince853Integrator(1.0e-3, 300, tolerances[0], tolerances[1]);
NumericalPropagator propagator = new NumericalPropagator(integrator);
for (ForceModel forceModel : forceModels) {
propagator.addForceModel(forceModel);
}
propagator.setInitialState(new SpacecraftState(orbit));
return propagator.propagate(target);
}
use of org.hipparchus.ode.AbstractIntegrator in project Orekit by CS-SI.
the class SolarBodyTest method testPropagationVsEphemeris.
@Test
public void testPropagationVsEphemeris() throws OrekitException {
Utils.setDataRoot("regular-data");
// Creation of the celestial bodies of the solar system
final CelestialBody sun = CelestialBodyFactory.getSun();
final CelestialBody mercury = CelestialBodyFactory.getMercury();
final CelestialBody venus = CelestialBodyFactory.getVenus();
final CelestialBody earth = CelestialBodyFactory.getEarth();
final CelestialBody mars = CelestialBodyFactory.getMars();
final CelestialBody jupiter = CelestialBodyFactory.getJupiter();
final CelestialBody saturn = CelestialBodyFactory.getSaturn();
final CelestialBody uranus = CelestialBodyFactory.getUranus();
final CelestialBody neptune = CelestialBodyFactory.getNeptune();
final CelestialBody pluto = CelestialBodyFactory.getPluto();
// Starting and end dates
final AbsoluteDate startingDate = new AbsoluteDate(2000, 1, 2, TimeScalesFactory.getUTC());
AbsoluteDate endDate = startingDate.shiftedBy(30 * Constants.JULIAN_DAY);
final Frame icrf = FramesFactory.getICRF();
// fake orbit around negligible point mass at solar system barycenter
double negligibleMu = 1.0e-3;
SpacecraftState initialState = new SpacecraftState(new CartesianOrbit(venus.getPVCoordinates(startingDate, icrf), icrf, startingDate, negligibleMu));
// Creation of the numerical propagator
final double[][] tol = NumericalPropagator.tolerances(1000, initialState.getOrbit(), OrbitType.CARTESIAN);
AbstractIntegrator dop1 = new DormandPrince853Integrator(1.0, 1.0e5, tol[0], tol[1]);
NumericalPropagator propag = new NumericalPropagator(dop1);
propag.setOrbitType(OrbitType.CARTESIAN);
propag.setInitialState(initialState);
propag.setMu(negligibleMu);
// Creation of the ForceModels
propag.addForceModel(new BodyAttraction(sun));
propag.addForceModel(new BodyAttraction(mercury));
propag.addForceModel(new BodyAttraction(earth));
propag.addForceModel(new BodyAttraction(mars));
propag.addForceModel(new BodyAttraction(jupiter));
propag.addForceModel(new BodyAttraction(saturn));
propag.addForceModel(new BodyAttraction(uranus));
propag.addForceModel(new BodyAttraction(neptune));
propag.addForceModel(new BodyAttraction(pluto));
// checks are done within the step handler
propag.setMasterMode(1000.0, new OrekitFixedStepHandler() {
public void handleStep(SpacecraftState currentState, boolean isLast) throws OrekitException {
// propagated position should remain within 1400m of ephemeris for one month
Vector3D propagatedP = currentState.getPVCoordinates(icrf).getPosition();
Vector3D ephemerisP = venus.getPVCoordinates(currentState.getDate(), icrf).getPosition();
Assert.assertEquals(0, Vector3D.distance(propagatedP, ephemerisP), 1400.0);
}
});
propag.propagate(startingDate, endDate);
}
Aggregations