Commit 00de34fa authored by Luc Maisonobe's avatar Luc Maisonobe
Browse files

Allow STM to be computed in AbsolutePVCoordinates configuration.

parent b1bdbec8
...@@ -125,23 +125,28 @@ class StateTransitionMatrixGenerator implements AdditionalDerivativesProvider { ...@@ -125,23 +125,28 @@ class StateTransitionMatrixGenerator implements AdditionalDerivativesProvider {
final OrbitType orbitType, final OrbitType orbitType,
final PositionAngle positionAngle) { final PositionAngle positionAngle) {
if (dYdY0 != null) { final RealMatrix nonNullDYdY0;
if (dYdY0 == null) {
nonNullDYdY0 = MatrixUtils.createRealIdentityMatrix(STATE_DIMENSION);
} else {
if (dYdY0.getRowDimension() != STATE_DIMENSION || if (dYdY0.getRowDimension() != STATE_DIMENSION ||
dYdY0.getColumnDimension() != STATE_DIMENSION) { dYdY0.getColumnDimension() != STATE_DIMENSION) {
throw new OrekitException(LocalizedCoreFormats.DIMENSIONS_MISMATCH_2x2, throw new OrekitException(LocalizedCoreFormats.DIMENSIONS_MISMATCH_2x2,
dYdY0.getRowDimension(), dYdY0.getColumnDimension(), dYdY0.getRowDimension(), dYdY0.getColumnDimension(),
STATE_DIMENSION, STATE_DIMENSION); STATE_DIMENSION, STATE_DIMENSION);
} }
nonNullDYdY0 = dYdY0;
} }
// convert to Cartesian STM // convert to Cartesian STM
final double[][] dYdC = new double[STATE_DIMENSION][STATE_DIMENSION]; final RealMatrix dCdY0;
orbitType.convertType(state.getOrbit()).getJacobianWrtCartesian(positionAngle, dYdC); if (state.isOrbitDefined()) {
final RealMatrix dCdY0 = new QRDecomposition(MatrixUtils.createRealMatrix(dYdC), THRESHOLD). final double[][] dYdC = new double[STATE_DIMENSION][STATE_DIMENSION];
getSolver(). orbitType.convertType(state.getOrbit()).getJacobianWrtCartesian(positionAngle, dYdC);
solve(dYdY0 == null ? dCdY0 = new QRDecomposition(MatrixUtils.createRealMatrix(dYdC), THRESHOLD).getSolver().solve(nonNullDYdY0);
MatrixUtils.createRealIdentityMatrix(STATE_DIMENSION) : } else {
dYdY0); dCdY0 = nonNullDYdY0;
}
// flatten matrix // flatten matrix
final double[] flat = new double[STATE_DIMENSION * STATE_DIMENSION]; final double[] flat = new double[STATE_DIMENSION * STATE_DIMENSION];
......
Supports Markdown
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