When I use propagation parameters (e.g. solar radiation pressure in the example I’ve attached) I’m seeing a difference between the EKF and UKF that indicates there might be a bug in the unscented filter.
Before I create an issue and take a closer look at the UKF implementation, I’d just like to double-check that I’m not doing something wrong. I’ve attached an example which uses the EKF and UKF to propagate a state (mean and covariance) forward for a few seconds, with no update. Both results should be very, very close, but the UKF propagations parameters covariance becomes zero.
As an example, this is the square-root of the diagonal elements of the covariance produced by the EKF (in equinoctial coordinates + srp coefficient):
[2751.517369214375, 5.37401833338328E-5, 4.911714849707649E-5, 1.2369070312347382E-5, 1.0658570157389248E-5, 6.507407989140666E-5, 10.0]
and this is the same produced by the UKF:
[2751.5173692032326, 5.374018333379579E-5, 4.911714849663464E-5, 1.2369070312345821E-5, 1.0658570157388005E-5, 6.507402711829792E-5, 0.0]
The covariance of the orbital elements is very similar (which I’d expect), but the propagation parameters covariance (the last element of the vector) is not.
I think that I’ve found at least part of the issue. The non-orbit parts of the sigma points aren’t being copied across to the predicted versions in the evolution of the state. In the getEvolution method of UnscentedKalmanModel, if I change
predictedStates[i] = new ArrayRealVector(sigmaPoints[i].getDimension());
to
predictedStates[i] = sigmaPoints[i].copy();
I get the results I was expecting in my test case. I’ll have a closer look to make sure that change doesn’t have unexpected side-effects.
Hey @bcazabonne. I’m happy that the above change doesn’t have any unintended effects. After a couple of minor changes, I ran the unscented filter test suite and all the tests passed.
Do you think that this addresses the issue that you linked to, or should I create a new issue?
Could you first open a new issue? I’ll check if your proposal also fix issue-1036.
If you plan to contribute the fix, could you create a new branch starting from release-12.0. It will be very helpful to include the fix in a patch release.