use of org.hipparchus.ode.nonstiff.DormandPrince853Integrator in project Orekit by CS-SI.
the class DSSTPropagatorTest method testShortPeriodCoefficients.
@Test
public void testShortPeriodCoefficients() throws OrekitException {
Utils.setDataRoot("regular-data:potential/icgem-format");
GravityFieldFactory.addPotentialCoefficientsReader(new ICGEMFormatReader("^eigen-6s-truncated$", false));
UnnormalizedSphericalHarmonicsProvider nshp = GravityFieldFactory.getUnnormalizedProvider(4, 4);
Orbit orbit = new KeplerianOrbit(13378000, 0.05, 0, 0, FastMath.PI, 0, PositionAngle.MEAN, FramesFactory.getTOD(false), new AbsoluteDate(2003, 5, 6, TimeScalesFactory.getUTC()), nshp.getMu());
double period = orbit.getKeplerianPeriod();
double[][] tolerance = DSSTPropagator.tolerances(1.0, orbit);
AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(period / 100, period * 100, tolerance[0], tolerance[1]);
integrator.setInitialStepSize(10 * period);
DSSTPropagator propagator = new DSSTPropagator(integrator, false);
OneAxisEllipsoid earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getGTOD(false));
CelestialBody sun = CelestialBodyFactory.getSun();
CelestialBody moon = CelestialBodyFactory.getMoon();
propagator.addForceModel(new DSSTZonal(nshp, 4, 3, 9));
propagator.addForceModel(new DSSTTesseral(earth.getBodyFrame(), Constants.WGS84_EARTH_ANGULAR_VELOCITY, nshp, 4, 4, 4, 8, 4, 4, 2));
propagator.addForceModel(new DSSTThirdBody(sun));
propagator.addForceModel(new DSSTThirdBody(moon));
propagator.addForceModel(new DSSTAtmosphericDrag(new HarrisPriester(sun, earth), 2.1, 180));
propagator.addForceModel(new DSSTSolarRadiationPressure(1.2, 180, sun, earth.getEquatorialRadius()));
final AbsoluteDate finalDate = orbit.getDate().shiftedBy(30 * Constants.JULIAN_DAY);
propagator.resetInitialState(new SpacecraftState(orbit, 45.0));
final SpacecraftState stateNoConfig = propagator.propagate(finalDate);
Assert.assertEquals(0, stateNoConfig.getAdditionalStates().size());
propagator.setSelectedCoefficients(new HashSet<String>());
propagator.resetInitialState(new SpacecraftState(orbit, 45.0));
final SpacecraftState stateConfigEmpty = propagator.propagate(finalDate);
Assert.assertEquals(234, stateConfigEmpty.getAdditionalStates().size());
final Set<String> selected = new HashSet<String>();
selected.add("DSST-3rd-body-Moon-s[7]");
selected.add("DSST-central-body-tesseral-c[-2][3]");
propagator.setSelectedCoefficients(selected);
propagator.resetInitialState(new SpacecraftState(orbit, 45.0));
final SpacecraftState stateConfigeSelected = propagator.propagate(finalDate);
Assert.assertEquals(selected.size(), stateConfigeSelected.getAdditionalStates().size());
propagator.setSelectedCoefficients(null);
propagator.resetInitialState(new SpacecraftState(orbit, 45.0));
final SpacecraftState stateConfigNull = propagator.propagate(finalDate);
Assert.assertEquals(0, stateConfigNull.getAdditionalStates().size());
}
use of org.hipparchus.ode.nonstiff.DormandPrince853Integrator in project Orekit by CS-SI.
the class DSSTPropagatorTest method getLEOStatePropagatedBy30Minutes.
private SpacecraftState getLEOStatePropagatedBy30Minutes() throws IllegalArgumentException, OrekitException {
final Vector3D position = new Vector3D(-6142438.668, 3492467.560, -25767.25680);
final Vector3D velocity = new Vector3D(505.8479685, 942.7809215, 7435.922231);
// Spring equinoxe 21st mars 2003 1h00m
final AbsoluteDate initialDate = new AbsoluteDate(new DateComponents(2003, 03, 21), new TimeComponents(1, 0, 0.), TimeScalesFactory.getUTC());
final CartesianOrbit osculatingOrbit = new CartesianOrbit(new PVCoordinates(position, velocity), FramesFactory.getTOD(IERSConventions.IERS_1996, false), initialDate, Constants.WGS84_EARTH_MU);
// Adaptive step integrator
// with a minimum step of 0.001 and a maximum step of 1000
double minStep = 0.001;
double maxstep = 1000.0;
double positionTolerance = 10.0;
OrbitType propagationType = OrbitType.EQUINOCTIAL;
double[][] tolerances = NumericalPropagator.tolerances(positionTolerance, osculatingOrbit, propagationType);
AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(minStep, maxstep, tolerances[0], tolerances[1]);
NumericalPropagator propagator = new NumericalPropagator(integrator);
propagator.setOrbitType(propagationType);
NormalizedSphericalHarmonicsProvider provider = GravityFieldFactory.getNormalizedProvider(5, 5);
ForceModel holmesFeatherstone = new HolmesFeatherstoneAttractionModel(FramesFactory.getITRF(IERSConventions.IERS_2010, true), provider);
propagator.addForceModel(holmesFeatherstone);
propagator.setInitialState(new SpacecraftState(osculatingOrbit));
return propagator.propagate(new AbsoluteDate(initialDate, 1800.));
}
use of org.hipparchus.ode.nonstiff.DormandPrince853Integrator in project Orekit by CS-SI.
the class DSSTPropagatorTest method testGetInitialOsculatingState.
@Test
public void testGetInitialOsculatingState() throws IllegalArgumentException, OrekitException {
final SpacecraftState initialState = getGEOState();
// build integrator
final double minStep = initialState.getKeplerianPeriod() * 0.1;
final double maxStep = initialState.getKeplerianPeriod() * 10.0;
final double[][] tol = DSSTPropagator.tolerances(0.1, initialState.getOrbit());
AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(minStep, maxStep, tol[0], tol[1]);
// build the propagator for the propagation of the mean elements
DSSTPropagator prop = new DSSTPropagator(integrator, true);
final UnnormalizedSphericalHarmonicsProvider provider = GravityFieldFactory.getUnnormalizedProvider(4, 0);
final Frame earthFrame = CelestialBodyFactory.getEarth().getBodyOrientedFrame();
DSSTForceModel zonal = new DSSTZonal(provider, 4, 3, 9);
DSSTForceModel tesseral = new DSSTTesseral(earthFrame, Constants.WGS84_EARTH_ANGULAR_VELOCITY, provider, 4, 0, 4, 8, 4, 0, 2);
prop.addForceModel(zonal);
prop.addForceModel(tesseral);
// Set the initial state as osculating
prop.setInitialState(initialState, false);
// Check the stored initial state is the osculating one
Assert.assertEquals(initialState, prop.getInitialState());
// Check that no propagation, i.e. propagation to the initial date, provides the initial
// osculating state although the propagator is configured to propagate mean elements !!!
Assert.assertEquals(initialState, prop.propagate(initialState.getDate()));
}
use of org.hipparchus.ode.nonstiff.DormandPrince853Integrator in project Orekit by CS-SI.
the class AdditionalEquationsTest method testInitNumerical.
/**
* Test for issue #401
* with a numerical propagator
*/
@Test
public void testInitNumerical() throws OrekitException {
// setup
final double reference = 1.25;
InitCheckerEquations checker = new InitCheckerEquations(reference);
Assert.assertFalse(checker.wasCalled());
// action
AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(0.001, 200, tolerance[0], tolerance[1]);
integrator.setInitialStepSize(60);
NumericalPropagator propagatorNumerical = new NumericalPropagator(integrator);
propagatorNumerical.setInitialState(initialState.addAdditionalState(checker.getName(), reference));
propagatorNumerical.addAdditionalEquations(checker);
propagatorNumerical.propagate(initDate.shiftedBy(600));
// verify
Assert.assertTrue(checker.wasCalled());
}
use of org.hipparchus.ode.nonstiff.DormandPrince853Integrator in project Orekit by CS-SI.
the class AdditionalEquationsTest method testInitDSST.
/**
* Test for issue #401
* with a DSST propagator
*/
@Test
public void testInitDSST() throws OrekitException {
// setup
final double reference = 3.5;
InitCheckerEquations checker = new InitCheckerEquations(reference);
Assert.assertFalse(checker.wasCalled());
// action
AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(0.001, 200, tolerance[0], tolerance[1]);
integrator.setInitialStepSize(60);
DSSTPropagator propagatorDSST = new DSSTPropagator(integrator);
propagatorDSST.setInitialState(initialState.addAdditionalState(checker.getName(), reference));
propagatorDSST.addAdditionalEquations(checker);
propagatorDSST.propagate(initDate.shiftedBy(600));
// verify
Assert.assertTrue(checker.wasCalled());
}
Aggregations