IsotropicRadiationClassicalConvention.java

  1. /* Copyright 2002-2016 CS Systèmes d'Information
  2.  * Licensed to CS Systèmes d'Information (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.radiation;

  18. import org.apache.commons.math3.analysis.differentiation.DerivativeStructure;
  19. import org.apache.commons.math3.geometry.euclidean.threed.FieldRotation;
  20. import org.apache.commons.math3.geometry.euclidean.threed.FieldVector3D;
  21. import org.apache.commons.math3.geometry.euclidean.threed.Rotation;
  22. import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;
  23. import org.orekit.errors.OrekitException;
  24. import org.orekit.errors.OrekitMessages;
  25. import org.orekit.forces.radiation.RadiationSensitive;
  26. import org.orekit.frames.Frame;
  27. import org.orekit.time.AbsoluteDate;

  28. /** This class represents the features of a simplified spacecraft.
  29.  * <p>This model uses the classical thermo-optical coefficients
  30.  * Ca for absorption, Cs for specular reflection and Kd for diffuse
  31.  * reflection. The equation Ca + Cs + Cd = 1 always holds.
  32.  * </p>
  33.  * <p>
  34.  * A less standard set of coefficients α = Ca for absorption and
  35.  * τ = Cs/(1-Ca) for specular reflection is implemented in the sister
  36.  * class {@link IsotropicRadiationCNES95Convention}.
  37.  * </p>
  38.  *
  39.  * @see org.orekit.forces.BoxAndSolarArraySpacecraft
  40.  * @see org.orekit.forces.drag.IsotropicDrag
  41.  * @see IsotropicRadiationCNES95Convention
  42.  * @author Luc Maisonobe
  43.  * @since 7.1
  44.  */
  45. public class IsotropicRadiationClassicalConvention implements RadiationSensitive {

  46.     /** Cross section (m²). */
  47.     private final double crossSection;

  48.     /** Absorption coefficient. */
  49.     private double ca;

  50.     /** Specular reflection coefficient. */
  51.     private double cs;

  52.     /** Simple constructor.
  53.      * @param crossSection Surface (m²)
  54.      * @param ca absorption coefficient Ca between 0.0 an 1.0
  55.      * @param cs specular reflection coefficient Cs between 0.0 an 1.0
  56.      */
  57.     public IsotropicRadiationClassicalConvention(final double crossSection, final double ca, final double cs) {
  58.         this.crossSection = crossSection;
  59.         this.ca           = ca;
  60.         this.cs           = cs;
  61.     }

  62.     /** {@inheritDoc} */
  63.     public Vector3D radiationPressureAcceleration(final AbsoluteDate date, final Frame frame, final Vector3D position,
  64.                                                   final Rotation rotation, final double mass, final Vector3D flux) {
  65.         final double kP = crossSection * (1 + 4 * (1.0 - ca - cs) / 9.0);
  66.         return new Vector3D(kP / mass, flux);
  67.     }

  68.     /** {@inheritDoc} */
  69.     public FieldVector3D<DerivativeStructure> radiationPressureAcceleration(final AbsoluteDate date, final Frame frame, final FieldVector3D<DerivativeStructure> position,
  70.                                                                             final FieldRotation<DerivativeStructure> rotation, final DerivativeStructure mass,
  71.                                                                             final FieldVector3D<DerivativeStructure> flux) {
  72.         final double kP = crossSection * (1 + 4 * (1.0 - ca - cs) / 9.0);
  73.         return new FieldVector3D<DerivativeStructure>(mass.reciprocal().multiply(kP), flux);
  74.     }

  75.     /** {@inheritDoc} */
  76.     public FieldVector3D<DerivativeStructure> radiationPressureAcceleration(final AbsoluteDate date, final Frame frame, final Vector3D position,
  77.                                                                             final Rotation rotation, final double mass,
  78.                                                                             final Vector3D flux, final String paramName)
  79.         throws OrekitException {

  80.         final DerivativeStructure caDS;
  81.         final DerivativeStructure csDS;
  82.         if (ABSORPTION_COEFFICIENT.equals(paramName)) {
  83.             caDS = new DerivativeStructure(1, 1, 0, ca);
  84.             csDS = new DerivativeStructure(1, 1,    cs);
  85.         } else if (REFLECTION_COEFFICIENT.equals(paramName)) {
  86.             caDS = new DerivativeStructure(1, 1,    ca);
  87.             csDS = new DerivativeStructure(1, 1, 0, cs);
  88.         } else {
  89.             throw new OrekitException(OrekitMessages.UNSUPPORTED_PARAMETER_NAME, paramName,
  90.                                       ABSORPTION_COEFFICIENT + ", " + REFLECTION_COEFFICIENT);
  91.         }

  92.         final DerivativeStructure kP =
  93.                 caDS.add(csDS).subtract(1).multiply(-4.0 / 9.0).add(1).multiply(crossSection);
  94.         return new FieldVector3D<DerivativeStructure>(kP.divide(mass), flux);

  95.     }

  96.     /** {@inheritDoc} */
  97.     public void setAbsorptionCoefficient(final double value) {
  98.         ca = value;
  99.     }

  100.     /** {@inheritDoc} */
  101.     public double getAbsorptionCoefficient() {
  102.         return ca;
  103.     }

  104.     /** {@inheritDoc} */
  105.     public void setReflectionCoefficient(final double value) {
  106.         cs = value;
  107.     }

  108.     /** {@inheritDoc} */
  109.     public double getReflectionCoefficient() {
  110.         return cs;
  111.     }

  112. }