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.propagation.numerical;
18  
19  import org.orekit.errors.OrekitException;
20  import org.orekit.errors.OrekitMessages;
21  import org.orekit.forces.ForceModel;
22  import org.orekit.propagation.SpacecraftState;
23  import org.orekit.propagation.integration.AdditionalDerivativesProvider;
24  import org.orekit.utils.ParameterDriver;
25  
26  /** {@link AdditionalDerivativesProvider derivatives provider} computing the partial derivatives
27   * of the state (orbit) with respect to initial state and force models parameters.
28   * <p>
29   * This set of equations are automatically added to a {@link NumericalPropagator numerical propagator}
30   * in order to compute partial derivatives of the orbit along with the orbit itself. This is
31   * useful for example in orbit determination applications.
32   * </p>
33   * <p>
34   * The partial derivatives with respect to initial state can be either dimension 6
35   * (orbit only) or 7 (orbit and mass).
36   * </p>
37   * <p>
38   * The partial derivatives with respect to force models parameters has a dimension
39   * equal to the number of selected parameters. Parameters selection is implemented at
40   * {@link ForceModel force models} level. Users must retrieve a {@link ParameterDriver
41   * parameter driver} using {@link ForceModel#getParameterDriver(String)} and then
42   * select it by calling {@link ParameterDriver#setSelected(boolean) setSelected(true)}.
43   * </p>
44   * <p>
45   * If several force models provide different {@link ParameterDriver drivers} for the
46   * same parameter name, selecting any of these drivers has the side effect of
47   * selecting all the drivers for this shared parameter. In this case, the partial
48   * derivatives will be the sum of the partial derivatives contributed by the
49   * corresponding force models. This case typically arises for central attraction
50   * coefficient, which has an influence on {@link org.orekit.forces.gravity.NewtonianAttraction
51   * Newtonian attraction}, {@link org.orekit.forces.gravity.HolmesFeatherstoneAttractionModel
52   * gravity field}, and {@link org.orekit.forces.gravity.Relativity relativity}.
53   * </p>
54   * @deprecated as of 11.1, this class is not used anymore
55   * @author Vincent Mouraux
56   * @author Bryan Cazabonne
57   * @since 10.2
58   */
59  @Deprecated
60  public class AbsolutePartialDerivativesEquations extends PartialDerivativesEquations {
61  
62      /** Name. */
63      private final String name;
64  
65      /** Simple constructor.
66       * <p>
67       * Upon construction, this set of equations is <em>automatically</em> added to
68       * the propagator by calling its {@link
69       * NumericalPropagator#addAdditionalDerivativesProvider(AdditionalDerivativesProvider)} method. So
70       * there is no need to call this method explicitly for these equations.
71       * </p>
72       * @param name name of the partial derivatives equations
73       * @param propagator the propagator that will handle the orbit propagation
74       */
75      public AbsolutePartialDerivativesEquations(final String name, final NumericalPropagator propagator) {
76          super(name, propagator);
77          this.name = name;
78      }
79  
80      /** Get a mapper between two-dimensional Jacobians and one-dimensional additional state.
81       * @return a mapper between two-dimensional Jacobians and one-dimensional additional state,
82       * with the same name as the instance
83       * @see #setInitialJacobians(SpacecraftState)
84       * @see #setInitialJacobians(SpacecraftState, double[][], double[][])
85       */
86      @Override
87      public AbsoluteJacobiansMapper getMapper() {
88          if (!isInitialize()) {
89              throw new OrekitException(OrekitMessages.STATE_JACOBIAN_NOT_INITIALIZED);
90          }
91          return new AbsoluteJacobiansMapper(name, getSelectedParameters());
92      }
93  
94  }
95