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.radiation;
18  
19  import java.util.ArrayList;
20  import java.util.Collections;
21  import java.util.List;
22  
23  import org.hipparchus.CalculusFieldElement;
24  import org.hipparchus.geometry.euclidean.threed.FieldVector3D;
25  import org.hipparchus.geometry.euclidean.threed.Vector3D;
26  import org.hipparchus.util.FastMath;
27  import org.orekit.propagation.FieldSpacecraftState;
28  import org.orekit.propagation.SpacecraftState;
29  import org.orekit.utils.ParameterDriver;
30  
31  /** This class represents the features of a simplified spacecraft.
32   * <p>This model uses the classical thermo-optical coefficients
33   * Ca for absorption, Cs for specular reflection and Cd for diffuse
34   * reflection. The equation Ca + Cs + Cd = 1 always holds.
35   * </p>
36   * <p>
37   * A less standard set of coefficients α = Ca for absorption and
38   * τ = Cs/(1-Ca) for specular reflection is implemented in the sister
39   * class {@link IsotropicRadiationCNES95Convention}.
40   * </p>
41   *
42   * @see org.orekit.forces.BoxAndSolarArraySpacecraft
43   * @see org.orekit.forces.drag.IsotropicDrag
44   * @see IsotropicRadiationCNES95Convention
45   * @author Luc Maisonobe
46   * @since 7.1
47   */
48  public class IsotropicRadiationClassicalConvention implements RadiationSensitive {
49  
50      /** Parameters scaling factor.
51       * <p>
52       * We use a power of 2 to avoid numeric noise introduction
53       * in the multiplications/divisions sequences.
54       * </p>
55       */
56      private final double SCALE = FastMath.scalb(1.0, -3);
57  
58      /** Drivers for absorption and reflection coefficients. */
59      private final List<ParameterDriver> parameterDrivers;
60  
61      /** Cross section (m²). */
62      private final double crossSection;
63  
64      /** Simple constructor.
65       * @param crossSection Surface (m²)
66       * @param ca absorption coefficient Ca between 0.0 an 1.0
67       * @param cs specular reflection coefficient Cs between 0.0 an 1.0
68       */
69      public IsotropicRadiationClassicalConvention(final double crossSection, final double ca, final double cs) {
70          this.parameterDrivers = new ArrayList<>(3);
71          parameterDrivers.add(new ParameterDriver(RadiationSensitive.GLOBAL_RADIATION_FACTOR, 1.0, SCALE, 0.0, Double.POSITIVE_INFINITY));
72          parameterDrivers.add(new ParameterDriver(RadiationSensitive.ABSORPTION_COEFFICIENT, ca, SCALE, 0.0, 1.0));
73          parameterDrivers.add(new ParameterDriver(RadiationSensitive.REFLECTION_COEFFICIENT, cs, SCALE, 0.0, 1.0));
74          this.crossSection = crossSection;
75      }
76  
77      /** {@inheritDoc} */
78      @Override
79      public List<ParameterDriver> getRadiationParametersDrivers() {
80          return Collections.unmodifiableList(parameterDrivers);
81      }
82  
83      /** {@inheritDoc} */
84      @Override
85      public Vector3D radiationPressureAcceleration(final SpacecraftState state, final Vector3D flux,
86                                                    final double[] parameters) {
87          final double ca = parameters[1];
88          final double cs = parameters[2];
89          final double kP = parameters[0] * crossSection * (1 + 4 * (1.0 - ca - cs) / 9.0);
90          return new Vector3D(kP / state.getMass(), flux);
91      }
92  
93      /** {@inheritDoc} */
94      @Override
95      public <T extends CalculusFieldElement<T>> FieldVector3D<T>
96          radiationPressureAcceleration(final FieldSpacecraftState<T> state,
97                                        final FieldVector3D<T> flux,
98                                        final T[] parameters) {
99          final T ca = parameters[1];
100         final T cs = parameters[2];
101         final T kP = ca.add(cs).negate().add(1).multiply(4.0 / 9.0).add(1).
102                      multiply(parameters[0]).multiply(crossSection);
103         return new FieldVector3D<>(state.getMass().reciprocal().multiply(kP), flux);
104     }
105 }