KalmanModel.java

  1. /* Copyright 2002-2021 CS GROUP
  2.  * Licensed to CS GROUP (CS) under one or more
  3.  * contributor license agreements.  See the NOTICE file distributed with
  4.  * this work for additional information regarding copyright ownership.
  5.  * CS licenses this file to You under the Apache License, Version 2.0
  6.  * (the "License"); you may not use this file except in compliance with
  7.  * the License.  You may obtain a copy of the License at
  8.  *
  9.  *   http://www.apache.org/licenses/LICENSE-2.0
  10.  *
  11.  * Unless required by applicable law or agreed to in writing, software
  12.  * distributed under the License is distributed on an "AS IS" BASIS,
  13.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.  * See the License for the specific language governing permissions and
  15.  * limitations under the License.
  16.  */
  17. package org.orekit.estimation.sequential;

  18. import java.util.List;

  19. import org.orekit.propagation.PropagationType;
  20. import org.orekit.propagation.Propagator;
  21. import org.orekit.propagation.SpacecraftState;
  22. import org.orekit.propagation.conversion.OrbitDeterminationPropagatorBuilder;
  23. import org.orekit.propagation.integration.AbstractJacobiansMapper;
  24. import org.orekit.propagation.numerical.JacobiansMapper;
  25. import org.orekit.propagation.numerical.NumericalPropagator;
  26. import org.orekit.propagation.numerical.PartialDerivativesEquations;
  27. import org.orekit.utils.ParameterDriversList;

  28. /** Class defining the process model dynamics to use with a {@link KalmanEstimator}.
  29.  * @author Romain Gerbaud
  30.  * @author Maxime Journot
  31.  * @since 9.2
  32.  */
  33. public class KalmanModel extends AbstractKalmanModel {

  34.     /** Kalman process model constructor.
  35.      * @param propagatorBuilders propagators builders used to evaluate the orbits.
  36.      * @param covarianceMatricesProviders providers for covariance matrices
  37.      * @param estimatedMeasurementParameters measurement parameters to estimate
  38.      * @param measurementProcessNoiseMatrix provider for measurement process noise matrix
  39.      */
  40.     public KalmanModel(final List<OrbitDeterminationPropagatorBuilder> propagatorBuilders,
  41.                        final List<CovarianceMatrixProvider> covarianceMatricesProviders,
  42.                        final ParameterDriversList estimatedMeasurementParameters,
  43.                        final CovarianceMatrixProvider measurementProcessNoiseMatrix) {
  44.         // call super constructor
  45.         super(propagatorBuilders, covarianceMatricesProviders, estimatedMeasurementParameters,
  46.               measurementProcessNoiseMatrix, new JacobiansMapper[propagatorBuilders.size()]);
  47.     }

  48.     /** {@inheritDoc} */
  49.     @Override
  50.     protected void updateReferenceTrajectories(final Propagator[] propagators,
  51.                                                final PropagationType pType,
  52.                                                final PropagationType sType) {

  53.         // Update the reference trajectory propagator
  54.         setReferenceTrajectories(propagators);

  55.         // Jacobian mappers
  56.         final AbstractJacobiansMapper[] mappers = getMappers();

  57.         for (int k = 0; k < propagators.length; ++k) {
  58.             // Link the partial derivatives to this new propagator
  59.             final String equationName = KalmanEstimator.class.getName() + "-derivatives-" + k;
  60.             final PartialDerivativesEquations pde = new PartialDerivativesEquations(equationName, (NumericalPropagator) getReferenceTrajectories()[k]);

  61.             // Reset the Jacobians
  62.             final SpacecraftState rawState = getReferenceTrajectories()[k].getInitialState();
  63.             final SpacecraftState stateWithDerivatives = pde.setInitialJacobians(rawState);
  64.             getReferenceTrajectories()[k].resetInitialState(stateWithDerivatives);
  65.             mappers[k] = pde.getMapper();
  66.         }

  67.         // Update Jacobian mappers
  68.         setMappers(mappers);

  69.     }

  70.     /** {@inheritDoc} */
  71.     @Override
  72.     protected void analyticalDerivativeComputations(final AbstractJacobiansMapper mapper, final SpacecraftState state) {
  73.         // does nothing
  74.         // numerical method does not require analytical terms calculations
  75.     }

  76. }