J2SquaredModel.java

  1. /* Copyright 2022 Bryan Cazabonne
  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.  * Bryan Cazabonne 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.semianalytical.dsst.forces;

  18. import org.hipparchus.CalculusFieldElement;
  19. import org.orekit.propagation.FieldSpacecraftState;
  20. import org.orekit.propagation.PropagationType;
  21. import org.orekit.propagation.SpacecraftState;
  22. import org.orekit.propagation.semianalytical.dsst.utilities.AuxiliaryElements;
  23. import org.orekit.propagation.semianalytical.dsst.utilities.FieldAuxiliaryElements;

  24. import java.util.Collections;
  25. import java.util.List;

  26. /**
  27.  * Semi-analytical J2-squared model.
  28.  * <p>
  29.  * This interface is implemented by models providing J2-squared
  30.  * second-order terms in equinoctial elements. These terms are
  31.  * used in the computation of the closed-form J2-squared perturbation
  32.  * in semi-analytical satellite theory.
  33.  * </p>
  34.  * @see ZeisModel
  35.  * @author Bryan Cazabonne
  36.  * @since 12.0
  37.  */
  38. public interface J2SquaredModel {

  39.     /**
  40.      * Compute the J2-squared second-order terms in equinoctial elements.
  41.      * @param context model context
  42.      * @return the J2-squared second-order terms in equinoctial elements.
  43.      *         Order must follow: [A, K, H, Q, P, M]
  44.      */
  45.     double[] computeMeanEquinoctialSecondOrderTerms(DSSTJ2SquaredClosedFormContext context);

  46.     /**
  47.      * Compute the J2-squared second-order terms in equinoctial elements.
  48.      * @param context model context
  49.      * @param <T> type of the elements
  50.      * @return the J2-squared second-order terms in equinoctial elements.
  51.      *         Order must follow: [A, K, H, Q, P, M]
  52.      */
  53.     <T extends CalculusFieldElement<T>> T[] computeMeanEquinoctialSecondOrderTerms(FieldDSSTJ2SquaredClosedFormContext<T> context);

  54.     /**
  55.      * Performs initialization of J2-squared short period terms prior to propagation.
  56.      * @param auxiliaryElements auxiliary elements
  57.      * @param type type of the elements used (MEAN or OSCULATING)
  58.      * @param parameters force model parameters
  59.      * @return a list containing the initialized short period terms
  60.      * @since 12.2
  61.      */
  62.     default List<ShortPeriodTerms> initializeShortPeriodTerms(final AuxiliaryElements auxiliaryElements,
  63.                                                               final PropagationType type,
  64.                                                               final double[] parameters) {
  65.         return Collections.emptyList();
  66.     }

  67.     /**
  68.      * Performs initialization of J2-squared short period terms prior to propagation.
  69.      * @param auxiliaryElements auxiliary elements
  70.      * @param type type of the orbital elements used (MEAN or OSCULATING)
  71.      * @param parameters force model parameters
  72.      * @param <T> type of the field elements
  73.      * @return a list containing the initialized short period terms
  74.      * @since 12.2
  75.      */
  76.     default <T extends CalculusFieldElement<T>> List<FieldShortPeriodTerms<T>> initializeShortPeriodTerms(final FieldAuxiliaryElements<T> auxiliaryElements,
  77.                                                                                                           final PropagationType type,
  78.                                                                                                           final T[] parameters) {
  79.         return Collections.emptyList();
  80.     }

  81.     /** Update the J2-squared short period terms.
  82.      * <p>
  83.      * The {@link ShortPeriodTerms short period terms} that will be updated
  84.      * are the ones that were returned during the call to {@link
  85.      * #initializeShortPeriodTerms(AuxiliaryElements, PropagationType, double[])}.
  86.      * </p>
  87.      * @param parameters force model parameters
  88.      * @param meanStates mean states information: date, kinematics, attitude
  89.      * @since 12.2
  90.      */
  91.     default void updateShortPeriodTerms(final double[] parameters, final SpacecraftState... meanStates) {
  92.         // Does nothing by default
  93.     }

  94.     /** Update the J2-squared short period terms.
  95.      * <p>
  96.      * The {@link ShortPeriodTerms short period terms} that will be updated
  97.      * are the ones that were returned during the call to {@link
  98.      * #initializeShortPeriodTerms(AuxiliaryElements, PropagationType, double[])}.
  99.      * </p>
  100.      * @param parameters force model parameters
  101.      * @param meanStates mean states information: date, kinematics, attitude
  102.      * @param <T> type of the field elements
  103.      * @since 12.2
  104.      */
  105.     @SuppressWarnings("unchecked")
  106.     default <T extends CalculusFieldElement<T>> void updateShortPeriodTerms(final T[] parameters, final FieldSpacecraftState<T>... meanStates) {
  107.         // Does nothing by default
  108.     }

  109. }