hi @MaximeJ,
I’m reopening this thread because of an issue encountered when reimplimentin the Error State Transition matrix computation model from the KalmanFilter class.
In line 547, the propagation parameters jacobian named “dYdPp” is retreived via the the harvester.getParametersJacobian(currentSpacecraftState) method. When implementing a simple numerical propagation scenario to test the feature, the retrieved matrix is null. The reason for it lies within the getJacobiansColumnsName() where an empty columnNames List object is created. If I understand it well, this object is supposed to list all the driver parameters names of the implemented force models.
This same object is present and populated at NumericalPropagator level but is unfortunatly not visible. The KalmanFilter class is retrieving the parameters from PropagatorBuilder instances used for orbit determination.
// define initial state
Frame inertialFrame = FramesFactory.getGCRF();
AbsoluteDate date = AbsoluteDate.ARBITRARY_EPOCH;
double mu = Constants.IERS2010_EARTH_MU;
Vector3D position = new Vector3D(7200000.0, 0.0, 7200000.0);
Vector3D velocity = new Vector3D(0.0, -5763.39, 5763.39);
PVCoordinates pvCoordinates = new PVCoordinates(position, velocity);
CartesianOrbit initialOrbit = new CartesianOrbit(pvCoordinates, inertialFrame, date, mu);
SpacecraftState state = new SpacecraftState(initialOrbit);
// define propagator
ODEIntegrator integrator = new ClassicalRungeKuttaIntegrator(1.0);
NumericalPropagator propagator = new NumericalPropagator(integrator);
propagator.setInitialState(state);
// setup force models
// Atmospheric Drag
CelestialBody sun = CelestialBodyFactory.getSun();
double ae = Constants.IERS2010_EARTH_EQUATORIAL_RADIUS;
double f = Constants.IERS2010_EARTH_FLATTENING;
Frame bodyFrame = FramesFactory.getGTOD(IERSConventions.IERS_2010, false);
OneAxisEllipsoid earth = new OneAxisEllipsoid(ae, f, bodyFrame);
Atmosphere atmosphere = new HarrisPriester(sun, earth);
double crossSection = 2;
double dragCoeff = 0.47; //for spherical shape.
IsotropicDrag scModel = new IsotropicDrag(crossSection, dragCoeff);
ForceModel dragModel = new DragForce(atmosphere, scModel);
propagator.addForceModel(dragModel);
// SRP
double dRef = Constants.JPL_SSD_ASTRONOMICAL_UNIT;
double pRef = 4.56e-6;
double cr = 0.5;
RadiationSensitive spacecraft = new IsotropicRadiationSingleCoefficient(crossSection, cr);
ForceModel srpModel = new SolarRadiationPressure(dRef, pRef, sun, earth, spacecraft);
propagator.addForceModel(srpModel);
// setup STM computation model
MatricesHarvester harvester = (AbstractMatricesHarvester) propagator.setupMatricesComputation("stm", null, null);
double[][] cartesianCovarianceMatrix = {{1.000000e+02, 1.000000e-02, 1.000000e-02, 1.000000e-04, 1.000000e-04, 1.000000e-04},
{1.000000e-02, 1.000000e+02, 1.000000e-02, 1.000000e-04, 1.000000e-04, 1.000000e-04},
{1.000000e-02, 1.000000e-02, 1.000000e+02, 1.000000e-04, 1.000000e-04, 1.000000e-04},
{1.000000e-04, 1.000000e-04, 1.000000e-04, 1.000000e-04, 1.000000e-06, 1.000000e-06},
{1.000000e-04, 1.000000e-04, 1.000000e-04, 1.000000e-06, 1.000000e-04, 1.000000e-06},
{1.000000e-04, 1.000000e-04, 1.000000e-04, 1.000000e-06, 1.000000e-06, 1.000000e-042},};
RealMatrix matrix = new Array2DRowRealMatrix(cartesianCovarianceMatrix);
StateCovariance stateCovariance = new StateCovariance(matrix, date, inertialFrame, OrbitType.CARTESIAN, PositionAngleType.TRUE);
StateCovarianceMatrixProvider stateCovarianceMatrixProvider = new StateCovarianceMatrixProvider("covariance", "stm", harvester, stateCovariance);
propagator.addAdditionalStateProvider(stateCovarianceMatrixProvider);
// propagate
AbsoluteDate finalEpoch = date.shiftedBy(100);
SpacecraftState finalState = propagator.propagate(finalEpoch);
// retrieve STM
RealMatrix dYdPp = harvester.getParametersJacobian(finalState);
RealMatrix dYdY0 = harvester.getStateTransitionMatrix(finalState);
System.out.println("Parameters Jacobian" + dYdPp);
System.out.println("STM" + dYdY0);
Do you believe this same feature is available for orbit propagation ? If not available yet, I consider implementing a custom one relying on the getJacobiansColumnsName() script implemented within the NumericalPropagator class.
Thanks in advance for your time and assistance.
Best regards,
Gueorguy