PropulsionModel.java

  1. /* Copyright 2002-2022 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.maneuvers.propulsion;

  18. import java.util.Collections;
  19. import java.util.List;

  20. import org.hipparchus.CalculusFieldElement;
  21. import org.hipparchus.geometry.euclidean.threed.FieldVector3D;
  22. import org.hipparchus.geometry.euclidean.threed.Vector3D;
  23. import org.orekit.attitudes.Attitude;
  24. import org.orekit.attitudes.FieldAttitude;
  25. import org.orekit.forces.maneuvers.Maneuver;
  26. import org.orekit.propagation.FieldSpacecraftState;
  27. import org.orekit.propagation.SpacecraftState;
  28. import org.orekit.time.AbsoluteDate;
  29. import org.orekit.time.FieldAbsoluteDate;
  30. import org.orekit.utils.ParameterDriver;

  31. /** Generic interface for a propulsion model used in a {@link Maneuver}.
  32.  * @author Maxime Journot
  33.  * @since 10.2
  34.  */
  35. public interface PropulsionModel {

  36.     /** Initialization method.
  37.      *  Called in when Maneuver.init(...) is called (from ForceModel.init(...))
  38.      * @param initialState initial spacecraft state (at the start of propagation).
  39.      * @param target date of propagation. Not equal to {@code initialState.getDate()}.
  40.      */
  41.     default void init(SpacecraftState initialState, AbsoluteDate target) {
  42.     }

  43.     /** Initialization method.
  44.      *  Called in when Maneuver.init(...) is called (from ForceModel.init(...))
  45.      * @param initialState initial spacecraft state (at the start of propagation).
  46.      * @param target date of propagation. Not equal to {@code initialState.getDate()}.
  47.      * @param <T> type of the elements
  48.      * @since 11.1
  49.      */
  50.     default <T extends CalculusFieldElement<T>> void init(FieldSpacecraftState<T> initialState, FieldAbsoluteDate<T> target) {
  51.         init(initialState.toSpacecraftState(), target.toAbsoluteDate());
  52.     }

  53.     /** Get the acceleration of the spacecraft during maneuver and in maneuver frame.
  54.      * @param s current spacecraft state
  55.      * @param maneuverAttitude current attitude in maneuver
  56.      * @param parameters propulsion model parameters
  57.      * @return acceleration
  58.      */
  59.     Vector3D getAcceleration(SpacecraftState s, Attitude maneuverAttitude, double[] parameters);

  60.     /** Get the acceleration of the spacecraft during maneuver and in maneuver frame.
  61.      * @param s current spacecraft state
  62.      * @param maneuverAttitude current attitude in maneuver
  63.      * @param parameters propulsion model parameters
  64.      * @param <T> extends CalculusFieldElement&lt;T&gt;
  65.      * @return acceleration
  66.      */
  67.     <T extends CalculusFieldElement<T>> FieldVector3D<T> getAcceleration(FieldSpacecraftState<T> s,
  68.                                                                      FieldAttitude<T> maneuverAttitude,
  69.                                                                      T[] parameters);

  70.     /** Get the mass derivative (i.e. flow rate in kg/s) during maneuver.
  71.      * @param s current spacecraft state
  72.      * @param parameters propulsion model parameters
  73.      * @return mass derivative in kg/s
  74.      */
  75.     double getMassDerivatives(SpacecraftState s, double[] parameters);

  76.     /** Get the mass derivative (i.e. flow rate in kg/s) during maneuver.
  77.      * @param s current spacecraft state
  78.      * @param parameters propulsion model parameters
  79.      * @param <T> extends CalculusFieldElement&lt;T&gt;
  80.      * @return mass derivative in kg/s
  81.      */
  82.     <T extends CalculusFieldElement<T>> T getMassDerivatives(FieldSpacecraftState<T> s,
  83.                                                          T[] parameters);

  84.     /** Get the propulsion model parameter drivers.
  85.      * @return propulsion model parameter drivers
  86.      */
  87.     default List<ParameterDriver> getParametersDrivers() {
  88.         return Collections.emptyList();
  89.     }

  90.     /** Get the maneuver name.
  91.      * @return the maneuver name
  92.      */
  93.     default String getName() {
  94.         return "";
  95.     }

  96. }