BrouwerLyddaneTheory.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.hipparchus.Field;
  20. import org.orekit.forces.gravity.potential.GravityFieldFactory;
  21. import org.orekit.forces.gravity.potential.TideSystem;
  22. import org.orekit.forces.gravity.potential.UnnormalizedSphericalHarmonicsProvider;
  23. import org.orekit.orbits.FieldOrbit;
  24. import org.orekit.orbits.Orbit;
  25. import org.orekit.propagation.PropagationType;
  26. import org.orekit.propagation.analytical.BrouwerLyddanePropagator;
  27. import org.orekit.propagation.analytical.FieldBrouwerLyddanePropagator;
  28. import org.orekit.time.FieldAbsoluteDate;

  29. /**
  30.  * Brouwer-Lyddane theory for osculating to mean orbit conversion.
  31.  *
  32.  * @author Pascal Parraud
  33.  * @since 13.0
  34.  */
  35. public class BrouwerLyddaneTheory implements MeanTheory {

  36.     /** Theory used for converting from osculating to mean orbit. */
  37.     public static final String THEORY = "Brouwer-Lyddane";

  38.     /** Provider for un-normalized spherical harmonics coefficients. */
  39.     private final UnnormalizedSphericalHarmonicsProvider provider;

  40.     /** Value of the M2 parameter. */
  41.     private final double m2Value;

  42.     /**
  43.      * Constructor.
  44.      * @param provider unnormalized spherical harmonics provider
  45.      * @param m2Value  value of empirical drag coefficient in rad/s².
  46.      *        If equal to {@link BrouwerLyddanePropagator#M2} drag is not computed
  47.      */
  48.     public BrouwerLyddaneTheory(final UnnormalizedSphericalHarmonicsProvider provider,
  49.                                 final double m2Value) {
  50.         this.provider = provider;
  51.         this.m2Value  = m2Value;
  52.     }

  53.     /**
  54.      * Constructor.
  55.      * @param referenceRadius reference radius of the Earth for the potential model (m)
  56.      * @param mu central attraction coefficient (m³/s²)
  57.      * @param c20 un-normalized zonal coefficient (about -1.08e-3 for Earth)
  58.      * @param c30 un-normalized zonal coefficient (about +2.53e-6 for Earth)
  59.      * @param c40 un-normalized zonal coefficient (about +1.62e-6 for Earth)
  60.      * @param c50 un-normalized zonal coefficient (about +2.28e-7 for Earth)
  61.      * @param m2Value value of empirical drag coefficient in rad/s².
  62.      *        If equal to {@link BrouwerLyddanePropagator#M2} drag is not computed
  63.      */
  64.     public BrouwerLyddaneTheory(final double referenceRadius,
  65.                                 final double mu,
  66.                                 final double c20,
  67.                                 final double c30,
  68.                                 final double c40,
  69.                                 final double c50,
  70.                                 final double m2Value) {
  71.         this(GravityFieldFactory.getUnnormalizedProvider(referenceRadius, mu,
  72.                                                          TideSystem.UNKNOWN,
  73.                                                          new double[][] { { 0 }, { 0 }, { c20 }, { c30 }, { c40 }, { c50 } },
  74.                                                          new double[][] { { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 } }),
  75.              m2Value);
  76.     }

  77.     /** {@inheritDoc} */
  78.     @Override
  79.     public String getTheoryName() {
  80.         return THEORY;
  81.     }

  82.     /** {@inheritDoc} */
  83.     @Override
  84.     public double getReferenceRadius() {
  85.         return provider.getAe();
  86.     };

  87.     /** {@inheritDoc} */
  88.     @Override
  89.     public Orbit meanToOsculating(final Orbit mean) {
  90.         final BrouwerLyddanePropagator propagator =
  91.                         new BrouwerLyddanePropagator(mean, provider, PropagationType.MEAN, m2Value);
  92.         return propagator.propagateOrbit(mean.getDate());
  93.     }

  94.     /** {@inheritDoc} */
  95.     @Override
  96.     public <T extends CalculusFieldElement<T>> FieldOrbit<T> meanToOsculating(final FieldOrbit<T> mean) {

  97.         final FieldAbsoluteDate<T> date = mean.getDate();
  98.         final Field<T> field = date.getField();

  99.         final FieldBrouwerLyddanePropagator<T> propagator =
  100.                         new FieldBrouwerLyddanePropagator<>(mean, provider, PropagationType.MEAN, m2Value);
  101.         return propagator.propagateOrbit(date, propagator.getParameters(field, date));
  102.     }
  103. }