Commit 994341f3 authored by Bryan Cazabonne's avatar Bryan Cazabonne
Browse files

Add unit test for DSST orbit determination in backward propagation mode.

Fixes #717
parent a5a57b2b
Pipeline #1342 passed with stages
in 22 minutes and 23 seconds
......@@ -24,6 +24,9 @@
<action dev="evan" type="fix" issue="798">
Allow DSST event detection when propagating backwards.
</action>
<action dev="bryan" type="fix" issue="717" due-to="evan">
Fixed DSST orbit determination when propagating backwards.
</action>
<action dev="evan" type="remove" issue="586">
Remove InertialProvider.EME2000_ALIGNED, Propagator.DEFAULT_LAW. Use
InertialProvider.of(Frame).
......
......@@ -38,6 +38,7 @@ import org.orekit.errors.OrekitMessages;
import org.orekit.forces.ForceModel;
import org.orekit.forces.gravity.HolmesFeatherstoneAttractionModel;
import org.orekit.forces.gravity.potential.GravityFieldFactory;
import org.orekit.forces.gravity.potential.ICGEMFormatReader;
import org.orekit.forces.gravity.potential.NormalizedSphericalHarmonicsProvider;
import org.orekit.forces.gravity.potential.UnnormalizedSphericalHarmonicsProvider;
import org.orekit.frames.FramesFactory;
......@@ -49,6 +50,9 @@ import org.orekit.propagation.analytical.EcksteinHechlerPropagator;
import org.orekit.propagation.events.DateDetector;
import org.orekit.propagation.events.handlers.StopOnEvent;
import org.orekit.propagation.numerical.NumericalPropagator;
import org.orekit.propagation.semianalytical.dsst.DSSTPropagator;
import org.orekit.propagation.semianalytical.dsst.forces.DSSTForceModel;
import org.orekit.propagation.semianalytical.dsst.forces.DSSTZonal;
import org.orekit.time.AbsoluteDate;
import org.orekit.time.DateComponents;
import org.orekit.time.TimeComponents;
......@@ -59,6 +63,45 @@ import org.orekit.utils.IERSConventions;
public class PropagatorsParallelizerTest {
@Test
public void testIssue717() {
// Gravity
Utils.setDataRoot("regular-data:potential/icgem-format");
GravityFieldFactory.addPotentialCoefficientsReader(new ICGEMFormatReader("^eigen-6s-truncated$", false));
UnnormalizedSphericalHarmonicsProvider gravity = GravityFieldFactory.getUnnormalizedProvider(8, 8);
// Orbit
Orbit orbit = new KeplerianOrbit(15000000.0, 0.125, 1.25,
0.250, 1.375, 0.0625, PositionAngle.MEAN,
FramesFactory.getEME2000(),
new AbsoluteDate(2000, 2, 24, 11, 35, 47.0, TimeScalesFactory.getUTC()),
gravity.getMu());
// Propagator
final double[][] tol = DSSTPropagator.tolerances(0.01, orbit);
final DSSTPropagator propagator = new DSSTPropagator(new DormandPrince853Integrator(0.01, 600.0, tol[0], tol[1]), PropagationType.OSCULATING);
// Force models
final DSSTForceModel zonal = new DSSTZonal(gravity, 4, 3, 9);
propagator.addForceModel(zonal);
propagator.setInitialState(new SpacecraftState(orbit));
// Configure epochs in order to have a backward propagation mode
final double deltaT = 30.0;
final PropagatorsParallelizer parallelizer =
new PropagatorsParallelizer(Arrays.asList(propagator), interpolators -> {interpolators.get(0).getCurrentState().getDate();});
final SpacecraftState state = parallelizer.propagate(orbit.getDate().shiftedBy(deltaT).shiftedBy(+1.0), orbit.getDate().shiftedBy(-2.0 * deltaT).shiftedBy(-1.0)).get(0);
// Verify that the backward propagation worked properly
Assert.assertNotNull(state);
}
@Test
public void testNumericalNotInitialized() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment