DSSTZonalContext.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.propagation.semianalytical.dsst.forces;

  18. import org.orekit.forces.gravity.potential.UnnormalizedSphericalHarmonicsProvider;
  19. import org.orekit.frames.Frame;
  20. import org.orekit.propagation.semianalytical.dsst.utilities.AuxiliaryElements;

  21. /**
  22.  * This class is a container for the common parameters used in {@link DSSTZonal}.
  23.  * <p>
  24.  * It performs parameters initialization at each integration step for the Zonal contribution
  25.  * to the central body gravitational perturbation.
  26.  * </p>
  27.  * @author Bryan Cazabonne
  28.  * @since 10.0
  29.  */
  30. public class DSSTZonalContext extends DSSTGravityContext {

  31.     /** &Chi;³ = 1 / B³. */
  32.     private final double chi3;

  33.     // Short period terms
  34.     /** h * k. */
  35.     private double hk;
  36.     /** k² - h². */
  37.     private double k2mh2;
  38.     /** (k² - h²) / 2. */
  39.     private double k2mh2o2;
  40.     /** 1 / (n² * a²). */
  41.     private double oon2a2;
  42.     /** 1 / (n² * a) . */
  43.     private double oon2a;
  44.     /** χ³ / (n² * a). */
  45.     private double x3on2a;
  46.     /** χ / (n² * a²). */
  47.     private double xon2a2;
  48.     /** (C * χ) / ( 2 * n² * a² ). */
  49.     private double cxo2n2a2;
  50.     /** (χ²) / (n² * a² * (χ + 1 ) ). */
  51.     private double x2on2a2xp1;
  52.     /** B * B. */
  53.     private double BB;

  54.     /**
  55.      * Constructor with central body frame potentially different than orbit frame.
  56.      *
  57.      * @param auxiliaryElements auxiliary elements related to the current orbit
  58.      * @param bodyFixedFrame    rotating body frame
  59.      * @param provider          provider for spherical harmonics
  60.      * @param parameters        values of the force model parameters
  61.      * @since 12.2
  62.      */
  63.     DSSTZonalContext(final AuxiliaryElements auxiliaryElements,
  64.                      final Frame bodyFixedFrame,
  65.                      final UnnormalizedSphericalHarmonicsProvider provider,
  66.                      final double[] parameters) {

  67.         super(auxiliaryElements, bodyFixedFrame, provider, parameters);

  68.         // Chi3
  69.         final double chi = getChi();
  70.         this.chi3 = chi * getChi2();

  71.         // Short period terms
  72.         // -----

  73.         // h * k.
  74.         hk = auxiliaryElements.getH() * auxiliaryElements.getK();
  75.         // k² - h².
  76.         k2mh2 = auxiliaryElements.getK() * auxiliaryElements.getK() - auxiliaryElements.getH() * auxiliaryElements.getH();
  77.         // (k² - h²) / 2.
  78.         k2mh2o2 = k2mh2 / 2.;
  79.         // 1 / (n² * a²) = 1 / (n * A)
  80.         oon2a2 = 1 / (getA() * getMeanMotion());
  81.         // 1 / (n² * a) = a / (n * A)
  82.         oon2a = auxiliaryElements.getSma() * oon2a2;
  83.         // χ³ / (n² * a)
  84.         x3on2a = chi3 * oon2a;
  85.         // χ / (n² * a²)
  86.         xon2a2 = getChi() * oon2a2;
  87.         // (C * χ) / ( 2 * n² * a² )
  88.         cxo2n2a2 = xon2a2 * auxiliaryElements.getC() / 2;
  89.         // (χ²) / (n² * a² * (χ + 1 ) )
  90.         x2on2a2xp1 = xon2a2 * chi / (chi + 1);
  91.         // B * B
  92.         BB = auxiliaryElements.getB() * auxiliaryElements.getB();
  93.     }

  94.     /** Getter for the &Chi;³.
  95.      * @return the &Chi;³
  96.      */
  97.     public double getChi3() {
  98.         return chi3;
  99.     }

  100.     /** Get h * k.
  101.      * @return hk
  102.      */
  103.     public double getHK() {
  104.         return hk;
  105.     }

  106.     /** Get k² - h².
  107.      * @return k2mh2
  108.      */
  109.     public double getK2MH2() {
  110.         return k2mh2;
  111.     }

  112.     /** Get (k² - h²) / 2.
  113.      * @return k2mh2o2
  114.      */
  115.     public double getK2MH2O2() {
  116.         return k2mh2o2;
  117.     }

  118.     /** Get 1 / (n² * a²).
  119.      * @return oon2a2
  120.      */
  121.     public double getOON2A2() {
  122.         return oon2a2;
  123.     }

  124.     /** Get χ³ / (n² * a).
  125.      * @return x3on2a
  126.      */
  127.     public double getX3ON2A() {
  128.         return x3on2a;
  129.     }

  130.     /** Get χ / (n² * a²).
  131.      * @return xon2a2
  132.      */
  133.     public double getXON2A2() {
  134.         return xon2a2;
  135.     }

  136.     /** Get (C * χ) / ( 2 * n² * a² ).
  137.      * @return cxo2n2a2
  138.      */
  139.     public double getCXO2N2A2() {
  140.         return cxo2n2a2;
  141.     }

  142.     /** Get (χ²) / (n² * a² * (χ + 1 ) ).
  143.      * @return x2on2a2xp1
  144.      */
  145.     public double getX2ON2A2XP1() {
  146.         return x2on2a2xp1;
  147.     }

  148.     /** Get B * B.
  149.      * @return BB
  150.      */
  151.     public double getBB() {
  152.         return BB;
  153.     }

  154. }