SequentialBatchLSEstimator.java

  1. /* Copyright 2002-2025 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.leastsquares;

  18. import org.hipparchus.linear.MatrixDecomposer;
  19. import org.hipparchus.linear.QRDecomposer;
  20. import org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem.Evaluation;
  21. import org.hipparchus.optim.nonlinear.vector.leastsquares.SequentialGaussNewtonOptimizer;
  22. import org.orekit.propagation.conversion.PropagatorBuilder;

  23. /**
  24.  * Sequential least squares estimator for orbit determination.
  25.  * <p>
  26.  * When an orbit has already been estimated and new measurements are given, it is not efficient
  27.  * to re-optimize the whole problem. Only considering the new measures while optimizing
  28.  * will neither give good results as the old measurements will not be taken into account.
  29.  * Thus, a sequential estimator is used to estimate the orbit, which uses the old results
  30.  * of the estimation and the new measurements.
  31.  * <p>
  32.  * In order to perform a sequential optimization, the user must configure a
  33.  * {@link org.hipparchus.optim.nonlinear.vector.leastsquares.SequentialGaussNewtonOptimizer SequentialGaussNewtonOptimizer}.
  34.  * Depending if its input data are an empty {@link Evaluation}, a complete <code>Evaluation</code>
  35.  * or an a priori state and covariance, different configuration are possible.
  36.  * <p>
  37.  * <b>1. No input data from a previous estimation</b>
  38.  * <p>
  39.  * Then, the {@link SequentialBatchLSEstimator} can be used like a {@link BatchLSEstimator}
  40.  * to perform the estimation. The user can initialize the <code>SequentialGaussNewtonOptimizer</code>
  41.  * using the default constructor.
  42.  * <p>
  43.  * <code>final SequentialGaussNewtonOptimizer optimizer = new SequentialGaussNewtonOptimizer();</code>
  44.  * <p>
  45.  * By default, a {@link QRDecomposer} is used as decomposition algorithm. In addition, normal
  46.  * equations are not form. It is possible to update these two default configurations by using:
  47.  * <ul>
  48.  *   <li>{@link org.hipparchus.optim.nonlinear.vector.leastsquares.SequentialGaussNewtonOptimizer#withDecomposer(MatrixDecomposer) withDecomposer} method:
  49.  *       <code>optimizer.withDecomposer(newDecomposer);</code>
  50.  *   </li>
  51.  *   <li>{@link org.hipparchus.optim.nonlinear.vector.leastsquares.SequentialGaussNewtonOptimizer#withFormNormalEquations(boolean) withFormNormalEquations} method:
  52.  *       <code>optimizer.withFormNormalEquations(newFormNormalEquations);</code>
  53.  *   </li>
  54.  * </ul>
  55.  * <p>
  56.  * <b>2. Initialization using a previous <code>Evalutation</code></b>
  57.  * <p>
  58.  * In this situation, it is recommended to use the second constructor of the optimizer class.
  59.  * <p>
  60.  * <code>final SequentialGaussNewtonOptimizer optimizer = new SequentialGaussNewtonOptimizer(decomposer,
  61.  *                                                                                           formNormalEquations,
  62.  *                                                                                           evaluation);
  63.  * </code>
  64.  * <p>
  65.  * Using this constructor, the user can directly configure the MatrixDecomposer and set the flag for normal equations
  66.  * without calling the two previous presented methods.
  67.  * <p>
  68.  * <i>Note:</i> This constructor can also be used to perform the initialization of <b>1.</b>
  69.  * In this case, the <code>Evaluation evaluation</code> is <code>null</code>.
  70.  * <p>
  71.  * <b>3. Initialization using an a priori estimated state and covariance</b>
  72.  * <p>
  73.  * These situation is a classical satellite operation need. Indeed, a classical action is to use
  74.  * the results of a previous orbit determination (estimated state and covariance) performed a day before,
  75.  * to improve the initialization and the results of an orbit determination performed the current day.
  76.  * In this situation, the user can initialize the <code>SequentialGaussNewtonOptimizer</code>
  77.  * using the default constructor.
  78.  * <p>
  79.  * <code>final SequentialGaussNewtonOptimizer optimizer = new SequentialGaussNewtonOptimizer();</code>
  80.  * <p>
  81.  * The MatrixDecomposer and the flag about normal equations can again be updated using the two previous
  82.  * presented methods. The a priori state and covariance matrix can be set using:
  83.  * <ul>
  84.  *   <li>{@link org.hipparchus.optim.nonlinear.vector.leastsquares.SequentialGaussNewtonOptimizer#withAPrioriData(org.hipparchus.linear.RealVector, org.hipparchus.linear.RealMatrix) withAPrioriData} method:
  85.  *       <code>optimizer.withAPrioriData(aPrioriState, aPrioriCovariance);</code>
  86.  *   </li>
  87.  * </ul>
  88.  * @author Julie Bayard
  89.  * @since 11.0
  90.  */
  91. public class SequentialBatchLSEstimator extends BatchLSEstimator {

  92.     /**
  93.      * Simple constructor.
  94.      * <p>
  95.      * If multiple {@link PropagatorBuilder propagator builders} are set up, the
  96.      * orbits of several spacecrafts will be used simultaneously. This is useful
  97.      * if the propagators share some model or measurements parameters (typically
  98.      * pole motion, prime meridian correction or ground stations positions).
  99.      * </p>
  100.      * <p>
  101.      * Setting up multiple {@link PropagatorBuilder propagator builders} is also
  102.      * useful when inter-satellite measurements are used, even if only one of
  103.      * the orbit is estimated and the other ones are fixed. This is typically
  104.      * used when very high accuracy GNSS measurements are needed and the
  105.      * navigation bulletins are not considered accurate enough and the
  106.      * navigation constellation must be propagated numerically.
  107.      * </p>
  108.      * <p>
  109.      * The solver used for sequential least squares problem is a
  110.      * {@link org.hipparchus.optim.nonlinear.vector.leastsquares.SequentialGaussNewtonOptimizer
  111.      * sequential Gauss Newton optimizer}.
  112.      * Details about how initialize it are given in the class JavaDoc.
  113.      * </p>
  114.      *
  115.      * @param sequentialOptimizer solver for sequential least squares problem
  116.      * @param propagatorBuilder builders to use for propagation.
  117.      */
  118.     public SequentialBatchLSEstimator(final SequentialGaussNewtonOptimizer sequentialOptimizer,
  119.                                       final PropagatorBuilder... propagatorBuilder) {
  120.         super(sequentialOptimizer, propagatorBuilder);
  121.     }

  122. }