Dear Fellow Orekit Users,
Today I was trying to use Orekit’s DSSTPropagator. What I found is that when:
-
additional force is added (any DSSTForceModel)
-
the EventDetector is added
-
output state is set to OSCULATING
then at propagation start an error occurs :
Caused by: org.hipparchus.exception.MathIllegalArgumentException: sample for interpolation is empty
at org.hipparchus.analysis.interpolation.HermiteInterpolator.checkInterpolation(HermiteInterpolator.java:277)
at org.hipparchus.analysis.interpolation.HermiteInterpolator.value(HermiteInterpolator.java:176)
at org.orekit.propagation.semianalytical.dsst.utilities.ShortPeriodicsInterpolatedCoefficient.value(ShortPeriodicsInterpolatedCoefficient.java:76)
at org.orekit.propagation.semianalytical.dsst.forces.DSSTThirdBody$ThirdBodyShortPeriodicCoefficients.value(DSSTThirdBody.java:3125)
at org.orekit.propagation.semianalytical.dsst.DSSTPropagator$MeanPlusShortPeriodicMapper.mapArrayToState(DSSTPropagator.java:780)
at org.orekit.propagation.integration.StateMapper.mapArrayToState(StateMapper.java:167)
at org.orekit.propagation.integration.AbstractIntegratedPropagator.getCompleteState(AbstractIntegratedPropagator.java:593)
at org.orekit.propagation.integration.AbstractIntegratedPropagator.access$600(AbstractIntegratedPropagator.java:63)
at org.orekit.propagation.integration.AbstractIntegratedPropagator$AdaptedEventDetector.init(AbstractIntegratedPropagator.java:772)
at org.hipparchus.ode.AbstractIntegrator.initIntegration(AbstractIntegrator.java:225)
at org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaIntegrator.integrate(EmbeddedRungeKuttaIntegrator.java:196)
at org.orekit.propagation.integration.AbstractIntegratedPropagator.propagate(AbstractIntegratedPropagator.java:466)
What I found, is that AdaptedEventDetector calls “getCompleteState” method. This method is using Propagator’s “mapArrayToState” method, which calls ShortPeriodTerms.value( Orbit ). And this is where problem happens.
With MEAN propagation mode, this is not a case because .mapArrayToState method launched different condition.
With OSCULATING state, this method is called prematurely by AdaptedEventDetector. ShortPeriodTerms are not updated at this stage by their DSSTForceModels. They have been just initialized, without providing any values.
Above is what I found looking at the code, but there is also a possibility that I am using the code in wrong way Please correct me if that is the case.
In order to reproduce, here is a test method :
@Test
public void testPropagator()
{
AbsoluteDate targetDate = new AbsoluteDate(2030,
3,
3,
TimeScalesFactory.getUTC());
DSSTPropagator prop = this.setDSSTProp(this.getLEOState());
AltitudeDetector event = new AltitudeDetector(85.5,
ReferenceEllipsoid
.getWgs84(FramesFactory
.getITRF(IERSConventions.IERS_2010,
true)));
DSSTThirdBody force = new DSSTThirdBody(CelestialBodyFactory
.getBody("MOON"), CelestialBodyFactory.getEarth().getGM());
prop.addEventDetector(event);
prop.addForceModel(force);
prop.propagate(targetDate);
}
private DSSTPropagator setDSSTProp(final SpacecraftState initialState)
{
initialState.getDate();
final double minStep = 0.01;
final double maxStep = 500;
final double[][] tol = DSSTPropagator
.tolerances(1.0, initialState.getOrbit());
AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(minStep,
maxStep,
tol[0],
tol[1]);
DSSTPropagator dsstProp = new DSSTPropagator(integrator,
PropagationType.OSCULATING);
dsstProp.setInitialState(initialState, PropagationType.MEAN);
return dsstProp;
}
private SpacecraftState getLEOState() 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 initDate = new AbsoluteDate(new DateComponents(2019,
10,
21),
new TimeComponents(1,
0,
0.),
TimeScalesFactory
.getUTC());
return new SpacecraftState(new EquinoctialOrbit(new PVCoordinates(position,
velocity),
FramesFactory
.getEME2000(),
initDate,
3.986004415E14),
500.0);
}
Could you please help me with that problem ?
Is there maybe a way to go around this ?
Thanks in advance for any of your hints !
Best Regards,