Alfriend1999Max.java

  1. /* Copyright 2002-2024 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.ssa.collision.shorttermencounter.probability.twod;

  18. import org.hipparchus.CalculusFieldElement;
  19. import org.hipparchus.util.FastMath;

  20. /**
  21.  * Compute the probability of collision assuming the worst case described in : "Kyle Alfriend, Maruthi Akella, Joseph
  22.  * Frisbee, James Foster, Deok-Jin Lee, and Matthew Wilkins. Probability of ProbabilityOfCollision Error Analysis. Space
  23.  * Debris, 1(1):21–35, 1999.".
  24.  * <p>It assumes:
  25.  *     <ul>
  26.  *         <li>Short encounter leading to a linear relative motion.</li>
  27.  *         <li>Spherical collision object.</li>
  28.  *         <li>Uncorrelated positional covariance.</li>
  29.  *         <li>Gaussian distribution of the position uncertainties.</li>
  30.  *         <li>Deterministic velocity i.e. no velocity uncertainties.</li>
  31.  *         <li>Both objects are in circular orbits (eq 14).</li>
  32.  *         <li>Probability density function is constant over the collision circle (eq 18).</li>
  33.  *         <li>Covariance multiplied by a coefficient KSquared = MahalanobisDistanceSquared / 2 (eq 19-20).</li>
  34.  *     </ul>
  35.  * <p>
  36.  * By assuming a constant probability density function over the collision circle this method will,
  37.  * <b>most of the time</b>, give much higher probability of collision than other regular methods.
  38.  * That is why it is qualified as a maximum probability of collision computing method.
  39.  *
  40.  * @author Vincent Cucchietti
  41.  * @see <a href="https://en.wikipedia.org/wiki/Mahalanobis_distance">Mahalanobis distance.</a>
  42.  * @since 12.0
  43.  */
  44. public class Alfriend1999Max extends AbstractAlfriend1999 {

  45.     /** Empty constructor. */
  46.     public Alfriend1999Max() {
  47.         super(ShortTermEncounter2DPOCMethodType.ALFRIEND_1999_MAX.name());
  48.     }

  49.     /**
  50.      * Compute the value of the probability of collision.
  51.      *
  52.      * @param radius sum of primary and secondary collision object equivalent sphere radii (m)
  53.      * @param squaredMahalanobisDistance squared Mahalanobis distance
  54.      * @param covarianceMatrixDeterminant covariance matrix determinant
  55.      *
  56.      * @return value of the probability of collision
  57.      */
  58.     @Override
  59.     public double computeValue(final double radius, final double squaredMahalanobisDistance,
  60.                                final double covarianceMatrixDeterminant) {
  61.         return radius * radius / (squaredMahalanobisDistance * FastMath.sqrt(covarianceMatrixDeterminant) * FastMath.E);
  62.     }

  63.     /**
  64.      * Compute the value of the probability of collision.
  65.      *
  66.      * @param radius sum of primary and secondary collision object equivalent sphere radii (m)
  67.      * @param squaredMahalanobisDistance squared Mahalanobis distance
  68.      * @param covarianceMatrixDeterminant covariance matrix determinant
  69.      * @param <T> type of the field elements
  70.      *
  71.      * @return value of the probability of collision
  72.      */
  73.     @Override
  74.     public <T extends CalculusFieldElement<T>> T computeValue(final T radius, final T squaredMahalanobisDistance,
  75.                                                               final T covarianceMatrixDeterminant) {
  76.         return radius.multiply(radius).divide(squaredMahalanobisDistance.multiply(covarianceMatrixDeterminant.sqrt())
  77.                                                                         .multiply(FastMath.E));
  78.     }

  79.     /** {@inheritDoc} */
  80.     @Override
  81.     public boolean isAMaximumProbabilityOfCollisionMethod() {
  82.         return true;
  83.     }

  84.     /** {@inheritDoc} */
  85.     @Override
  86.     public ShortTermEncounter2DPOCMethodType getType() {
  87.         return ShortTermEncounter2DPOCMethodType.ALFRIEND_1999_MAX;
  88.     }
  89. }