Failing EKF without orbit estimation

Hi all,

I found an issue with KalmanEstimator if no orbital coordinate is estimated but a propagation model parameter is. It basically crashes (whilst it works fine with UKF as far as I am aware).
Code sample to reproduce:

    @Test
    void testEstimationStepWithBStarOnly() {
        // GIVEN
        TLEEstimationTestUtils.eccentricContext("regular-data:potential:tides");
        String line1 = "1 07276U 74026A   00055.48318287  .00000000  00000-0  22970+3 0  9994";
        String line2 = "2 07276  71.6273  78.7838 1248323  14.0598   3.8405  4.72707036231812";
        final TLE tle = new TLE(line1, line2);
        final TLEPropagatorBuilder propagatorBuilder = new TLEPropagatorBuilder(tle,
                PositionAngleType.TRUE, 1., new FixedPointTleGenerationAlgorithm());
        for (final ParameterDriver driver: propagatorBuilder.getOrbitalParametersDrivers().getDrivers()) {
            driver.setSelected(false);
        }
        propagatorBuilder.getPropagationParametersDrivers().getDrivers().get(0).setSelected(true);
        final KalmanEstimatorBuilder builder = new KalmanEstimatorBuilder();
        builder.addPropagationConfiguration(propagatorBuilder,
                new ConstantProcessNoise(MatrixUtils.createRealMatrix(1, 1)));
        final KalmanEstimator estimator = builder.build();
        final AbsoluteDate measurementDate = tle.getDate().shiftedBy(1.0);
        final TLEPropagator propagator = TLEPropagator.selectExtrapolator(tle);
        final Position positionMeasurement = new Position(measurementDate, propagator.getPosition(measurementDate,
                propagator.getFrame()), 1., 1., new ObservableSatellite(0));
        // WHEN & THEN
        Assertions.assertDoesNotThrow(() -> estimator.estimationStep(positionMeasurement));
    }

I naively tried to replace the “6” by “nbOrbParams” line 157 of KalmanModel, but it’s not enough.

Cheers,
Romain.

1 Like

Thanks @Serrof. That’s a good indication we don’t have tests for the case where there are fewer than 6 estimated orbital parameters.

There’s a lot of complexity in keeping track of which propagator orbital/propagation parameters map to which entry in the covariance matrix (and state transition matrix) - the covarianceIndirection indicies. At some point there’s been a mixup in how that mapping is used. I haven’t looked very closely at those before, because they work fine with 6 orbital parameters!

If you’d like to make your specific case work, then you can change like 151 in KalmanModel from

if (nbParams > 0) {

to

if (nbOrbParams > 0 && nbParams > 0) {

That’s not a general fix, but it’ll do the trick when there aren’t any orbital parameters being estimated.

Hi Mark,

Thanks for your answer!
Just to double check, whilst your trick would allow the code not to crash, then the covariance matrix would not be computed correctly right?

Cheers,
Romain.

The covariance should be fine in your case. The transition matrix is just the identity matrix when there aren’t any orbital parameters being estimated.

I see, thanks. In that case I will create another issue for when there is between 1 and 5 orbital parameters estimated and at least one propagation model parameter. This way we can already have a fix for the original problem soon.

Cheers,
Romain.

1 Like