EcksteinHechlerTheory.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.conversion.osc2mean;

  18. import org.hipparchus.CalculusFieldElement;
  19. import org.orekit.forces.gravity.potential.GravityFieldFactory;
  20. import org.orekit.forces.gravity.potential.TideSystem;
  21. import org.orekit.forces.gravity.potential.UnnormalizedSphericalHarmonicsProvider;
  22. import org.orekit.orbits.FieldOrbit;
  23. import org.orekit.orbits.Orbit;
  24. import org.orekit.orbits.OrbitType;
  25. import org.orekit.propagation.PropagationType;
  26. import org.orekit.propagation.analytical.EcksteinHechlerPropagator;
  27. import org.orekit.propagation.analytical.FieldEcksteinHechlerPropagator;

  28. /**
  29.  * Eckstein-Hechler theory for osculating to mean orbit conversion.
  30.  *
  31.  * @author Pascal Parraud
  32.  * @since 13.0
  33.  */
  34. public class EcksteinHechlerTheory implements MeanTheory {

  35.     /** Theory used for converting from osculating to mean orbit. */
  36.     public static final String THEORY = "Eckstein-Hechler";

  37.     /** Unnormalized spherical harmonics provider. */
  38.     private final UnnormalizedSphericalHarmonicsProvider provider;

  39.     /**
  40.      * Constructor.
  41.      * @param provider unnormalized spherical harmonics provider
  42.      */
  43.     public EcksteinHechlerTheory(final UnnormalizedSphericalHarmonicsProvider provider) {
  44.         this.provider = provider;
  45.     }

  46.     /**
  47.      * Constructor.
  48.      * @param referenceRadius reference radius of the Earth for the potential model (m)
  49.      * @param mu central attraction coefficient (m³/s²)
  50.      * @param c20 un-normalized zonal coefficient (about -1.08e-3 for Earth)
  51.      * @param c30 un-normalized zonal coefficient (about +2.53e-6 for Earth)
  52.      * @param c40 un-normalized zonal coefficient (about +1.62e-6 for Earth)
  53.      * @param c50 un-normalized zonal coefficient (about +2.28e-7 for Earth)
  54.      * @param c60 un-normalized zonal coefficient (about -5.41e-7 for Earth)
  55.      */
  56.     public EcksteinHechlerTheory(final double referenceRadius,
  57.                                  final double mu,
  58.                                  final double c20,
  59.                                  final double c30,
  60.                                  final double c40,
  61.                                  final double c50,
  62.                                  final double c60) {
  63.         this(GravityFieldFactory.getUnnormalizedProvider(referenceRadius, mu,
  64.                                                          TideSystem.UNKNOWN,
  65.                                                          new double[][] { { 0 }, { 0 }, { c20 }, { c30 }, { c40 }, { c50 }, { c60 } },
  66.                                                          new double[][] { { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 } }));
  67.     }

  68.     /** {@inheritDoc} */
  69.     @Override
  70.     public String getTheoryName() {
  71.         return THEORY;
  72.     }

  73.     /** {@inheritDoc} */
  74.     @Override
  75.     public double getReferenceRadius() {
  76.         return provider.getAe();
  77.     };

  78.     /** {@inheritDoc} */
  79.     @Override
  80.     public Orbit meanToOsculating(final Orbit mean) {
  81.         final EcksteinHechlerPropagator propagator =
  82.                         new EcksteinHechlerPropagator(mean, provider, PropagationType.MEAN);
  83.         return propagator.getOsculatingCircularOrbit(mean.getDate());
  84.     }

  85.     /** {@inheritDoc} */
  86.     @Override
  87.     public <T extends CalculusFieldElement<T>> FieldOrbit<T> meanToOsculating(final FieldOrbit<T> mean) {
  88.         final FieldEcksteinHechlerPropagator<T> propagator =
  89.                         new FieldEcksteinHechlerPropagator<>(mean, provider, PropagationType.MEAN);
  90.         return propagator.getOsculatingCircularOrbit(mean.getDate());
  91.     }

  92.     /** Post-treatment of the converted mean orbit.
  93.      * <p>The mean orbit returned is circular.</p>
  94.      * @param osculating the osculating orbit to be converted
  95.      * @param mean the converted mean orbit
  96.      * @return postprocessed mean orbit
  97.      */
  98.     @Override
  99.     public Orbit postprocessing(final Orbit osculating, final Orbit mean) {
  100.         return OrbitType.CIRCULAR.convertType(mean);
  101.     }

  102.     /** Post-treatment of the converted mean orbit.
  103.      * <p>The mean orbit returned is circular.</p>
  104.      * @param <T> type of the field elements
  105.      * @param osculating the osculating orbit to be converted
  106.      * @param mean the converted mean orbit
  107.      * @return postprocessed mean orbit
  108.      */
  109.     @Override
  110.     public <T extends CalculusFieldElement<T>> FieldOrbit<T> postprocessing(final FieldOrbit<T> osculating,
  111.                                                                             final FieldOrbit<T> mean) {
  112.         return OrbitType.CIRCULAR.convertType(mean);
  113.     }
  114. }