KalmanModel.java

  1. /* Copyright 2002-2022 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.MatricesHarvester;
  20. import org.orekit.propagation.PropagationType;
  21. import org.orekit.propagation.Propagator;
  22. import org.orekit.propagation.conversion.OrbitDeterminationPropagatorBuilder;
  23. import org.orekit.propagation.numerical.JacobiansMapper;
  24. import org.orekit.utils.ParameterDriversList;

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

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

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

  50.         // Update the reference trajectory propagator
  51.         setReferenceTrajectories(propagators);

  52.         // Jacobian harvesters
  53.         final MatricesHarvester[] harvesters = new MatricesHarvester[propagators.length];

  54.         for (int k = 0; k < propagators.length; ++k) {
  55.             // Link the partial derivatives to this new propagator
  56.             final String equationName = KalmanEstimator.class.getName() + "-derivatives-" + k;
  57.             harvesters[k] = getReferenceTrajectories()[k].setupMatricesComputation(equationName, null, null);
  58.         }

  59.         // Update Jacobian harvesters
  60.         setHarvesters(harvesters);

  61.     }

  62. }