GHIJjsPolynomials.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.utilities;


  18. /** Compute the G<sub>js</sub>, H<sub>js</sub>, I<sub>js</sub> and J<sub>js</sub>
  19.  *  polynomials in the equinoctial elements h, k and the direction cosines α and β
  20.  *  and their partial derivatives with respect to k, h, α and β.
  21.  *  <p>
  22.  *  The expressions used are equations 4.1-(10) from the Danielson paper.
  23.  *  </p>
  24.  *  @author Lucian Barbulescu
  25.  */
  26. public class GHIJjsPolynomials {

  27.     /** C<sub>j</sub>(k, h), S<sub>j</sub>(k, h) coefficient.
  28.      * (k, h) are the (x, y) component of the eccentricity vector in equinoctial elements
  29.      */
  30.     private final CjSjCoefficient cjsjKH;

  31.     /** C<sub>j</sub>(α, β), S<sub>j</sub>(α, β) coefficient.
  32.      * (α, β) are the direction cosines
  33.      */
  34.     private final CjSjCoefficient cjsjAB;

  35.     /** Create a set of G<sub>js</sub>, H<sub>js</sub>, I<sub>js</sub> and J<sub>js</sub> polynomials.
  36.      *  @param k X component of the eccentricity vector
  37.      *  @param h Y component of the eccentricity vector
  38.      *  @param alpha direction cosine α
  39.      *  @param beta direction cosine β
  40.      **/
  41.     public GHIJjsPolynomials(final double k, final double h,
  42.                             final double alpha, final double beta) {
  43.         this.cjsjKH = new CjSjCoefficient(k, h);
  44.         this.cjsjAB = new CjSjCoefficient(alpha, beta);
  45.     }

  46.     /** Get the G<sub>js</sub> coefficient.
  47.      * @param j j subscript
  48.      * @param s s subscript
  49.      * @return the G<sub>js</sub>
  50.      */
  51.     public double getGjs(final int j, final int s) {
  52.         return cjsjKH.getCj(j) * cjsjAB.getCj(s) + cjsjKH.getSj(j) * cjsjAB.getSj(s);
  53.     }

  54.     /** Get the dG<sub>js</sub> / dk coefficient.
  55.      * @param j j subscript
  56.      * @param s s subscript
  57.      * @return the dG<sub>js</sub> / dk
  58.      */
  59.     public double getdGjsdk(final int j, final int s) {
  60.         return cjsjKH.getDcjDk(j) * cjsjAB.getCj(s) + cjsjKH.getDsjDk(j) * cjsjAB.getSj(s);
  61.     }

  62.     /** Get the dG<sub>js</sub> / dh coefficient.
  63.      * @param j j subscript
  64.      * @param s s subscript
  65.      * @return the dG<sub>js</sub> / dh
  66.      */
  67.     public double getdGjsdh(final int j, final int s) {
  68.         return cjsjKH.getDcjDh(j) * cjsjAB.getCj(s) + cjsjKH.getDsjDh(j) * cjsjAB.getSj(s);
  69.     }

  70.     /** Get the dG<sub>js</sub> / dα coefficient.
  71.      * @param j j subscript
  72.      * @param s s subscript
  73.      * @return the dG<sub>js</sub> / dα
  74.      */
  75.     public double getdGjsdAlpha(final int j, final int s) {
  76.         return cjsjKH.getCj(j) * cjsjAB.getDcjDk(s) + cjsjKH.getSj(j) * cjsjAB.getDsjDk(s);
  77.     }

  78.     /** Get the dG<sub>js</sub> / dβ coefficient.
  79.      * @param j j subscript
  80.      * @param s s subscript
  81.      * @return the dG<sub>js</sub> / dβ
  82.      */
  83.     public double getdGjsdBeta(final int j, final int s) {
  84.         return cjsjKH.getCj(j) * cjsjAB.getDcjDh(s) + cjsjKH.getSj(j) * cjsjAB.getDsjDh(s);
  85.     }

  86.     /** Get the H<sub>js</sub> coefficient.
  87.      * @param j j subscript
  88.      * @param s s subscript
  89.      * @return the H<sub>js</sub>
  90.      */
  91.     public double getHjs(final int j, final int s) {
  92.         return cjsjKH.getCj(j) * cjsjAB.getSj(s) - cjsjKH.getSj(j) * cjsjAB.getCj(s);
  93.     }

  94.     /** Get the dH<sub>js</sub> / dk coefficient.
  95.      * @param j j subscript
  96.      * @param s s subscript
  97.      * @return the H<sub>js</sub> / dk
  98.      */
  99.     public double getdHjsdk(final int j, final int s) {
  100.         return cjsjKH.getDcjDk(j) * cjsjAB.getSj(s) - cjsjKH.getDsjDk(j) * cjsjAB.getCj(s);
  101.     }

  102.     /** Get the dH<sub>js</sub> / dh coefficient.
  103.      * @param j j subscript
  104.      * @param s s subscript
  105.      * @return the H<sub>js</sub> / dh
  106.      */
  107.     public double getdHjsdh(final int j, final int s) {
  108.         return cjsjKH.getDcjDh(j) * cjsjAB.getSj(s) - cjsjKH.getDsjDh(j) * cjsjAB.getCj(s);
  109.     }

  110.     /** Get the dH<sub>js</sub> / dα coefficient.
  111.      * @param j j subscript
  112.      * @param s s subscript
  113.      * @return the H<sub>js</sub> / dα
  114.      */
  115.     public double getdHjsdAlpha(final int j, final int s) {
  116.         return cjsjKH.getCj(j) * cjsjAB.getDsjDk(s) - cjsjKH.getSj(j) * cjsjAB.getDcjDk(s);
  117.     }

  118.     /** Get the dH<sub>js</sub> / dβ coefficient.
  119.      * @param j j subscript
  120.      * @param s s subscript
  121.      * @return the H<sub>js</sub> / dβ
  122.      */
  123.     public double getdHjsdBeta(final int j, final int s) {
  124.         return cjsjKH.getCj(j) * cjsjAB.getDsjDh(s) - cjsjKH.getSj(j) * cjsjAB.getDcjDh(s);
  125.     }

  126.     /** Get the I<sub>js</sub> coefficient.
  127.      * @param j j subscript
  128.      * @param s s subscript
  129.      * @return the I<sub>js</sub>
  130.      */
  131.     public double getIjs(final int j, final int s) {
  132.         return cjsjKH.getCj(j) * cjsjAB.getSj(s) + cjsjKH.getSj(j) * cjsjAB.getCj(s);
  133.     }

  134.     /** Get the dI<sub>js</sub> / dk coefficient.
  135.      * @param j j subscript
  136.      * @param s s subscript
  137.      * @return the I<sub>js</sub> / dk
  138.      */
  139.     public double getdIjsdk(final int j, final int s) {
  140.         return cjsjKH.getDcjDk(j) * cjsjAB.getSj(s) + cjsjKH.getDsjDk(j) * cjsjAB.getCj(s);
  141.     }

  142.     /** Get the dI<sub>js</sub> / dh coefficient.
  143.      * @param j j subscript
  144.      * @param s s subscript
  145.      * @return the I<sub>js</sub> / dh
  146.      */
  147.     public double getdIjsdh(final int j, final int s) {
  148.         return cjsjKH.getDcjDh(j) * cjsjAB.getSj(s) + cjsjKH.getDsjDh(j) * cjsjAB.getCj(s);
  149.     }

  150.     /** Get the dI<sub>js</sub> / dα coefficient.
  151.      * @param j j subscript
  152.      * @param s s subscript
  153.      * @return the I<sub>js</sub> / dα
  154.      */
  155.     public double getdIjsdAlpha(final int j, final int s) {
  156.         return cjsjKH.getCj(j) * cjsjAB.getDsjDk(s) + cjsjKH.getSj(j) * cjsjAB.getDcjDk(s);
  157.     }

  158.     /** Get the dI<sub>js</sub> / dβ coefficient.
  159.      * @param j j subscript
  160.      * @param s s subscript
  161.      * @return the I<sub>js</sub> / dβ
  162.      */
  163.     public double getdIjsdBeta(final int j, final int s) {
  164.         return cjsjKH.getCj(j) * cjsjAB.getDsjDh(s) + cjsjKH.getSj(j) * cjsjAB.getDcjDh(s);
  165.     }

  166.     /** Get the J<sub>js</sub> coefficient.
  167.      * @param j j subscript
  168.      * @param s s subscript
  169.      * @return the J<sub>js</sub>
  170.      */
  171.     public double getJjs(final int j, final int s) {
  172.         return cjsjKH.getCj(j) * cjsjAB.getCj(s) - cjsjKH.getSj(j) * cjsjAB.getSj(s);
  173.     }

  174.     /** Get the dJ<sub>js</sub> / dk coefficient.
  175.      * @param j j subscript
  176.      * @param s s subscript
  177.      * @return the J<sub>js</sub> / dk
  178.      */
  179.     public double getdJjsdk(final int j, final int s) {
  180.         return cjsjKH.getDcjDk(j) * cjsjAB.getCj(s) - cjsjKH.getDsjDk(j) * cjsjAB.getSj(s);
  181.     }
  182.     /** Get the dJ<sub>js</sub> / dh coefficient.
  183.      * @param j j subscript
  184.      * @param s s subscript
  185.      * @return the J<sub>js</sub> / dh
  186.      */
  187.     public double getdJjsdh(final int j, final int s) {
  188.         return cjsjKH.getDcjDh(j) * cjsjAB.getCj(s) - cjsjKH.getDsjDh(j) * cjsjAB.getSj(s);
  189.     }
  190.     /** Get the dJ<sub>js</sub> / dα coefficient.
  191.      * @param j j subscript
  192.      * @param s s subscript
  193.      * @return the J<sub>js</sub> / dα
  194.      */
  195.     public double getdJjsdAlpha(final int j, final int s) {
  196.         return cjsjKH.getCj(j) * cjsjAB.getDcjDk(s) - cjsjKH.getSj(j) * cjsjAB.getDsjDk(s);
  197.     }
  198.     /** Get the dJ<sub>js</sub> / dβ coefficient.
  199.      * @param j j subscript
  200.      * @param s s subscript
  201.      * @return the J<sub>js</sub> / dβ
  202.      */
  203.     public double getdJjsdBeta(final int j, final int s) {
  204.         return cjsjKH.getCj(j) * cjsjAB.getDcjDh(s) - cjsjKH.getSj(j) * cjsjAB.getDsjDh(s);
  205.     }
  206. }