RadiationPressureModel.java

  1. /* Copyright 2022-2025 Romain Serra
  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. import org.hipparchus.CalculusFieldElement;
  19. import org.hipparchus.Field;
  20. import org.hipparchus.geometry.euclidean.threed.FieldVector3D;
  21. import org.hipparchus.geometry.euclidean.threed.Vector3D;
  22. import org.orekit.propagation.FieldSpacecraftState;
  23. import org.orekit.propagation.SpacecraftState;
  24. import org.orekit.propagation.events.EventDetector;
  25. import org.orekit.propagation.events.FieldEventDetector;
  26. import org.orekit.time.AbsoluteDate;
  27. import org.orekit.time.FieldAbsoluteDate;
  28. import org.orekit.utils.ParameterDriver;

  29. import java.util.List;
  30. import java.util.stream.Stream;

  31. /**
  32.  * Class representing a light-induced radiation pressure force, by leveraging on a given flux model.
  33.  *
  34.  * <p>
  35.  *     This class should not be used in addition to {@link SolarRadiationPressure}, which is another way of
  36.  *     representing the same orbital perturbation.
  37.  * </p>
  38.  *
  39.  * @author Romain Serra
  40.  * @see LightFluxModel
  41.  * @see RadiationSensitive
  42.  * @since 12.1
  43.  */
  44. public class RadiationPressureModel implements RadiationForceModel {

  45.     /**
  46.      * Light flux model (including eclipse conditions).
  47.      */
  48.     private final LightFluxModel lightFluxModel;

  49.     /**
  50.      * Object defining radiation properties defining the acceleration from the pressure.
  51.      */
  52.     private final RadiationSensitive radiationSensitive;

  53.     /**
  54.      * Constructor.
  55.      * @param lightFluxModel model for light flux
  56.      * @param radiationSensitive object defining radiation properties
  57.      */
  58.     public RadiationPressureModel(final LightFluxModel lightFluxModel,
  59.                                   final RadiationSensitive radiationSensitive) {
  60.         this.lightFluxModel = lightFluxModel;
  61.         this.radiationSensitive = radiationSensitive;
  62.     }

  63.     /**
  64.      * Getter for radiation sensitive object.
  65.      * @return radiation sensitive object
  66.      */
  67.     public RadiationSensitive getRadiationSensitive() {
  68.         return radiationSensitive;
  69.     }

  70.     /**
  71.      * Getter for light flux model.
  72.      * @return flux model
  73.      */
  74.     public LightFluxModel getLightFluxModel() {
  75.         return lightFluxModel;
  76.     }

  77.     /** {@inheritDoc} */
  78.     @Override
  79.     public boolean dependsOnPositionOnly() {
  80.         return radiationSensitive instanceof IsotropicRadiationClassicalConvention || radiationSensitive instanceof IsotropicRadiationCNES95Convention || radiationSensitive instanceof IsotropicRadiationSingleCoefficient;
  81.     }

  82.     /** {@inheritDoc} */
  83.     @Override
  84.     public void init(final SpacecraftState initialState, final AbsoluteDate target) {
  85.         RadiationForceModel.super.init(initialState, target);
  86.         lightFluxModel.init(initialState, target);
  87.     }

  88.     /** {@inheritDoc} */
  89.     @Override
  90.     public <T extends CalculusFieldElement<T>> void init(final FieldSpacecraftState<T> initialState,
  91.                                                          final FieldAbsoluteDate<T> target) {
  92.         RadiationForceModel.super.init(initialState, target);
  93.         lightFluxModel.init(initialState, target);
  94.     }

  95.     /** {@inheritDoc} */
  96.     @Override
  97.     public Vector3D acceleration(final SpacecraftState s, final double[] parameters) {
  98.         final Vector3D fluxVector = lightFluxModel.getLightFluxVector(s);
  99.         return radiationSensitive.radiationPressureAcceleration(s, fluxVector, parameters);
  100.     }

  101.     /** {@inheritDoc} */
  102.     @Override
  103.     public <T extends CalculusFieldElement<T>> FieldVector3D<T> acceleration(final FieldSpacecraftState<T> s, final T[] parameters) {
  104.         final FieldVector3D<T> fluxVector = lightFluxModel.getLightFluxVector(s);
  105.         return radiationSensitive.radiationPressureAcceleration(s, fluxVector, parameters);
  106.     }

  107.     /** {@inheritDoc} */
  108.     @Override
  109.     public List<ParameterDriver> getParametersDrivers() {
  110.         return radiationSensitive.getRadiationParametersDrivers();
  111.     }

  112.     /** {@inheritDoc} */
  113.     @Override
  114.     public Stream<EventDetector> getEventDetectors() {
  115.         final List<EventDetector> eventDetectors = lightFluxModel.getEclipseConditionsDetector();
  116.         return Stream.concat(RadiationForceModel.super.getEventDetectors(), eventDetectors.stream());
  117.     }

  118.     /** {@inheritDoc} */
  119.     @Override
  120.     public <T extends CalculusFieldElement<T>> Stream<FieldEventDetector<T>> getFieldEventDetectors(final Field<T> field) {
  121.         final List<FieldEventDetector<T>> eventDetectors = lightFluxModel.getFieldEclipseConditionsDetector(field);
  122.         return Stream.concat(RadiationForceModel.super.getFieldEventDetectors(field), eventDetectors.stream());
  123.     }
  124. }