LenseThirringRelativity.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.forces.gravity;

  18. import java.util.Collections;
  19. import java.util.List;

  20. import org.hipparchus.CalculusFieldElement;
  21. import org.hipparchus.geometry.euclidean.threed.FieldVector3D;
  22. import org.hipparchus.geometry.euclidean.threed.Vector3D;
  23. import org.hipparchus.util.FastMath;
  24. import org.orekit.forces.ForceModel;
  25. import org.orekit.frames.FieldStaticTransform;
  26. import org.orekit.frames.Frame;
  27. import org.orekit.frames.StaticTransform;
  28. import org.orekit.propagation.FieldSpacecraftState;
  29. import org.orekit.propagation.SpacecraftState;
  30. import org.orekit.utils.Constants;
  31. import org.orekit.utils.FieldPVCoordinates;
  32. import org.orekit.utils.PVCoordinates;
  33. import org.orekit.utils.ParameterDriver;

  34. /**
  35.  * Lense-Thirring post-Newtonian correction force due to general relativity.
  36.  * <p>
  37.  * Lense-Thirring term causes a precession of the orbital plane at a rate of
  38.  * the order of 0.8 mas per year (geostationary) to 180 mas per year (low orbit).
  39.  * </p>
  40.  * @see "Petit, G. and Luzum, B. (eds.), IERS Conventions (2010), Chapter 10,
  41.  * General relativistic models for space-time coordinates and equations of motion (2010)"
  42.  *
  43.  * @author Bryan Cazabonne
  44.  * @since 10.3
  45.  */
  46. public class LenseThirringRelativity implements ForceModel {

  47.     /** Intensity of the Earth's angular momentum per unit mass [m²/s]. */
  48.     private static final double J = 9.8e8;

  49.     /** Central attraction scaling factor.
  50.      * <p>
  51.      * We use a power of 2 to avoid numeric noise introduction
  52.      * in the multiplications/divisions sequences.
  53.      * </p>
  54.      */
  55.     private static final double MU_SCALE = FastMath.scalb(1.0, 32);

  56.     /** Driver for gravitational parameter. */
  57.     private final ParameterDriver gmParameterDriver;

  58.     /** Central body frame. */
  59.     private final Frame bodyFrame;

  60.     /**
  61.      * Constructor.
  62.      * @param gm Earth's gravitational parameter.
  63.      * @param bodyFrame central body frame
  64.      */
  65.     public LenseThirringRelativity(final double gm, final Frame bodyFrame) {
  66.         gmParameterDriver = new ParameterDriver(NewtonianAttraction.CENTRAL_ATTRACTION_COEFFICIENT,
  67.                                                 gm, MU_SCALE,
  68.                                                 0.0, Double.POSITIVE_INFINITY);
  69.         this.bodyFrame = bodyFrame;
  70.     }

  71.     /** {@inheritDoc} */
  72.     @Override
  73.     public boolean dependsOnPositionOnly() {
  74.         return false;
  75.     }

  76.     /** {@inheritDoc} */
  77.     @Override
  78.     public Vector3D acceleration(final SpacecraftState s, final double[] parameters) {

  79.         // Useful constant
  80.         final double c2 = Constants.SPEED_OF_LIGHT * Constants.SPEED_OF_LIGHT;

  81.         // Earth's gravitational parameter
  82.         final double gm = parameters[0];

  83.         // Satellite position and velocity with respect to the Earth
  84.         final PVCoordinates pv = s.getPVCoordinates();
  85.         final Vector3D p = pv.getPosition();
  86.         final Vector3D v = pv.getVelocity();

  87.         // Radius
  88.         final double r  = p.getNorm();
  89.         final double r2 = r * r;

  90.         // Earth’s angular momentum per unit mass
  91.         final StaticTransform t =
  92.                 bodyFrame.getStaticTransformTo(s.getFrame(), s.getDate());
  93.         final Vector3D  j = t.transformVector(Vector3D.PLUS_K).scalarMultiply(J);

  94.         // Eq. 10.12
  95.         return new Vector3D(3.0 * p.dotProduct(j) / r2,
  96.                             p.crossProduct(v),
  97.                             1.0,
  98.                             v.crossProduct(j))
  99.                             .scalarMultiply((2.0 * gm) / (r2 * r * c2));
  100.     }

  101.     /** {@inheritDoc} */
  102.     @Override
  103.     public <T extends CalculusFieldElement<T>> FieldVector3D<T> acceleration(final FieldSpacecraftState<T> s,
  104.                                                                          final T[] parameters) {

  105.         // Useful constant
  106.         final double c2 = Constants.SPEED_OF_LIGHT * Constants.SPEED_OF_LIGHT;

  107.         // Earth's gravitational parameter
  108.         final T gm = parameters[0];

  109.         // Satellite position and velocity with respect to the Earth
  110.         final FieldPVCoordinates<T> pv = s.getPVCoordinates();
  111.         final FieldVector3D<T> p = pv.getPosition();
  112.         final FieldVector3D<T> v = pv.getVelocity();

  113.         // Radius
  114.         final T r  = p.getNorm();
  115.         final T r2 = r.square();

  116.         // Earth’s angular momentum per unit mass
  117.         final FieldStaticTransform<T> t = bodyFrame.getStaticTransformTo(s.getFrame(), s.getDate());
  118.         final FieldVector3D<T>        j = t.transformVector(Vector3D.PLUS_K).scalarMultiply(J);

  119.         return new FieldVector3D<>(p.dotProduct(j).multiply(3.0).divide(r2),
  120.                                    p.crossProduct(v),
  121.                                    r.getField().getOne(),
  122.                                    v.crossProduct(j))
  123.                                    .scalarMultiply(gm.multiply(2.0).divide(r2.multiply(r).multiply(c2)));
  124.     }

  125.     /** {@inheritDoc} */
  126.     @Override
  127.     public List<ParameterDriver> getParametersDrivers() {
  128.         return Collections.singletonList(gmParameterDriver);
  129.     }

  130. }