RadiationPressureModel.java

  1. /* Copyright 2022-2024 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.utils.ParameterDriver;

  27. import java.util.List;
  28. import java.util.stream.Stream;

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

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

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

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

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

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

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

  80.     /** {@inheritDoc} */
  81.     @Override
  82.     public Vector3D acceleration(final SpacecraftState s, final double[] parameters) {
  83.         final Vector3D fluxVector = lightFluxModel.getLightFluxVector(s);
  84.         return radiationSensitive.radiationPressureAcceleration(s, fluxVector, parameters);
  85.     }

  86.     /** {@inheritDoc} */
  87.     @Override
  88.     public <T extends CalculusFieldElement<T>> FieldVector3D<T> acceleration(final FieldSpacecraftState<T> s, final T[] parameters) {
  89.         final FieldVector3D<T> fluxVector = lightFluxModel.getLightFluxVector(s);
  90.         return radiationSensitive.radiationPressureAcceleration(s, fluxVector, parameters);
  91.     }

  92.     /** {@inheritDoc} */
  93.     @Override
  94.     public List<ParameterDriver> getParametersDrivers() {
  95.         return radiationSensitive.getRadiationParametersDrivers();
  96.     }

  97.     /** {@inheritDoc} */
  98.     @Override
  99.     public Stream<EventDetector> getEventDetectors() {
  100.         final List<EventDetector> eventDetectors = lightFluxModel.getEclipseConditionsDetector();
  101.         return Stream.concat(RadiationForceModel.super.getEventDetectors(), eventDetectors.stream());
  102.     }

  103.     /** {@inheritDoc} */
  104.     @Override
  105.     public <T extends CalculusFieldElement<T>> Stream<FieldEventDetector<T>> getFieldEventDetectors(final Field<T> field) {
  106.         final List<FieldEventDetector<T>> eventDetectors = lightFluxModel.getFieldEclipseConditionsDetector(field);
  107.         return Stream.concat(RadiationForceModel.super.getFieldEventDetectors(field), eventDetectors.stream());
  108.     }
  109. }