DSSTBatchLSModel.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.orekit.estimation.measurements.ObservedMeasurement;
  19. import org.orekit.orbits.Orbit;
  20. import org.orekit.propagation.MatricesHarvester;
  21. import org.orekit.propagation.PropagationType;
  22. import org.orekit.propagation.Propagator;
  23. import org.orekit.propagation.SpacecraftState;
  24. import org.orekit.propagation.conversion.PropagatorBuilder;
  25. import org.orekit.propagation.semianalytical.dsst.DSSTPropagator;
  26. import org.orekit.utils.ParameterDriversList;

  27. import java.util.List;

  28. /** Bridge between {@link ObservedMeasurement measurements} and {@link
  29.  * org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem
  30.  * least squares problems}.
  31.  * <p>
  32.  * This class is an adaption of the {@link BatchLSModel} class
  33.  * for the {@link DSSTPropagator DSST propagator}.
  34.  * </p>
  35.  * @author Luc Maisonobe
  36.  * @author Bryan Cazabonne
  37.  * @since 10.0
  38.  *
  39.  */
  40. public class DSSTBatchLSModel extends AbstractBatchLSModel {

  41.     /** Name of the State Transition Matrix state. */
  42.     private static final String STM_NAME = DSSTBatchLSModel.class.getName() + "-derivatives";

  43.     /** Type of the orbit used for the propagation.*/
  44.     private PropagationType propagationType;

  45.     /** Simple constructor.
  46.      * @param propagatorBuilders builders to use for propagation
  47.      * @param measurements measurements
  48.      * @param estimatedMeasurementsParameters estimated measurements parameters
  49.      * @param observer observer to be notified at model calls
  50.      * @param propagationType type of the orbit used for the propagation (mean or osculating)
  51.      */
  52.     public DSSTBatchLSModel(final PropagatorBuilder[] propagatorBuilders,
  53.                             final List<ObservedMeasurement<?>> measurements,
  54.                             final ParameterDriversList estimatedMeasurementsParameters,
  55.                             final ModelObserver observer,
  56.                             final PropagationType propagationType) {
  57.         // call super constructor
  58.         super(propagatorBuilders, measurements, estimatedMeasurementsParameters, observer);
  59.         this.propagationType = propagationType;
  60.     }

  61.     /** {@inheritDoc} */
  62.     @Override
  63.     protected MatricesHarvester configureHarvester(final Propagator propagator) {
  64.         return propagator.setupMatricesComputation(STM_NAME, null, null);
  65.     }

  66.     /** {@inheritDoc} */
  67.     @Override
  68.     protected Orbit configureOrbits(final MatricesHarvester harvester, final Propagator propagator) {
  69.         // Cast
  70.         final DSSTPropagator dsstPropagator = (DSSTPropagator) propagator;
  71.         // Mean orbit
  72.         final SpacecraftState initial = dsstPropagator.initialIsOsculating() ?
  73.                        DSSTPropagator.computeMeanState(dsstPropagator.getInitialState(), dsstPropagator.getAttitudeProvider(), dsstPropagator.getAllForceModels()) :
  74.                        dsstPropagator.getInitialState();
  75.         // Compute short period derivatives at the beginning of the iteration
  76.         harvester.setReferenceState(initial);
  77.         return initial.getOrbit();
  78.     }

  79. }