Commit dbe9df7f authored by Luc Maisonobe's avatar Luc Maisonobe
Browse files

Declared setupMatricesComputation at Propagator interface level.

The default implementation throws un UnsupportedOperationException which
will be removed when the method is implemented in all propagators (but
not before 12.0 for compatibility reasons).

declaring the method already at highest level will allow getting rid
(deprecating them first) of several clumsy classes in estimation
package.
parent d523ca5a
Pipeline #1583 failed with stages
......@@ -20,6 +20,7 @@ import java.util.Collection;
import java.util.List;
import org.hipparchus.geometry.euclidean.threed.Rotation;
import org.hipparchus.linear.RealMatrix;
import org.orekit.attitudes.AttitudeProvider;
import org.orekit.attitudes.InertialProvider;
import org.orekit.frames.Frame;
......@@ -29,6 +30,7 @@ import org.orekit.propagation.sampling.OrekitFixedStepHandler;
import org.orekit.propagation.sampling.OrekitStepHandler;
import org.orekit.propagation.sampling.StepHandlerMultiplexer;
import org.orekit.time.AbsoluteDate;
import org.orekit.utils.DoubleArrayDictionary;
import org.orekit.utils.PVCoordinatesProvider;
/** This interface provides a way to propagate an orbit at any time.
......@@ -239,6 +241,33 @@ public interface Propagator extends PVCoordinatesProvider {
*/
Frame getFrame();
/** Set up computation of State Transition Matrix and Jacobians matrix with respect to parameters.
* <p>
* If this method is called, both State Transition Matrix and Jacobians with respect to the
* force models parameters that will be selected when propagation starts will be automatically
* computed, and the harvester will allow to retrieve them.
* </p>
* <p>
* The arguments for initial matrices <em>must</em> be compatible with the {@link org.orekit.orbits.OrbitType
* orbit type} and {@link org.orekit.orbits.PositionAngle position angle} that will be used by the propagator.
* </p>
* <p>
* The default implementation throws an exception as the method is not supported by all propagators.
* </p>
* @param stmName State Transition Matrix state name
* @param initialStm initial State Transition Matrix ∂Y/∂Y₀,
* if null (which is the most frequent case), assumed to be 6x6 identity
* @param initialJacobianColumns initial columns of the Jacobians matrix with respect to parameters,
* if null or if some selected parameters are missing from the dictionary, the corresponding
* initial column is assumed to be 0
* @return harvester to retrieve computed matrices during and after propagation
* @since 11.1
*/
default MatricesHarvester setupMatricesComputation(final String stmName, final RealMatrix initialStm,
final DoubleArrayDictionary initialJacobianColumns) {
throw new UnsupportedOperationException();
}
/** Propagate towards a target date.
* <p>Simple propagators use only the target date as the specification for
* computing the propagated state. More feature rich propagators can consider
......
......@@ -388,26 +388,8 @@ public class NumericalPropagator extends AbstractIntegratedPropagator {
setStartDate(state.getDate());
}
/** Set up computation of State Transition Matrix and Jacobians matrix with respect to parameters.
* <p>
* If this method is called, both State Transition Matrix and Jacobians with respect to the
* force models parameters that will be selected when propagation starts will be automatically
* computed, and the harvester will allow to retrieve them.
* </p>
* <p>
* The arguments for initial matrices <em>must</em> be compatible with the {@link #setOrbitType(OrbitType) orbit type}
* and {@link #setPositionAngleType(PositionAngle) position angle} that will be ultimately
* selected when propagation starts
* </p>
* @param stmName State Transition Matrix state name
* @param initialStm initial State Transition Matrix ∂Y/∂Y₀,
* if null (which is the most frequent case), assumed to be 6x6 identity
* @param initialJacobianColumns initial columns of the Jacobians matrix with respect to parameters,
* if null or if some selected parameters are missing from the dictionary, the corresponding
* initial column is assumed to be 0
* @return harvester to retrieve computed matrices during and after propagation
* @since 11.1
*/
/** {@inheritDoc} */
@Override
public MatricesHarvester setupMatricesComputation(final String stmName, final RealMatrix initialStm,
final DoubleArrayDictionary initialJacobianColumns) {
if (stmName == null) {
......
......@@ -155,6 +155,19 @@ public class KeplerianPropagatorTest {
Assert.assertEquals(4.2, finalStateBoundedPropagator.getAdditionalState("myState")[0], 1.0e-15);
}
@Test
public void testStmAndJacobian() {
AbsoluteDate initDate = AbsoluteDate.GPS_EPOCH;
Orbit ic = new KeplerianOrbit(6378137 + 500e3, 1e-3, 0, 0, 0, 0, PositionAngle.TRUE, FramesFactory.getGCRF(), initDate, mu);
Propagator propagator = new KeplerianPropagator(ic);
try {
propagator.setupMatricesComputation("stm", null, null);
Assert.fail("an exception should have been thrown");
} catch (UnsupportedOperationException uoe) {
// expected
}
}
@Test
public void sameDateCartesian() {
......
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