ConfigurableLowThrustManeuver.java

  1. /* Copyright 2020 Exotrail
  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.  * Exotrail 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;

  18. import org.hipparchus.geometry.euclidean.threed.Vector3D;
  19. import org.orekit.forces.maneuvers.propulsion.AbstractConstantThrustPropulsionModel;
  20. import org.orekit.forces.maneuvers.propulsion.BasicConstantThrustPropulsionModel;
  21. import org.orekit.forces.maneuvers.propulsion.ThrustDirectionAndAttitudeProvider;
  22. import org.orekit.forces.maneuvers.trigger.ManeuverTriggers;
  23. import org.orekit.time.AbsoluteDate;

  24. /**
  25.  * This class implements a configurable low thrust maneuver.
  26.  * <p>
  27.  * The maneuver is composed of succession of a burn interval. Burn intervals are
  28.  * defined by two detectors. See
  29.  * {@link org.orekit.forces.maneuvers.trigger.StartStopEventsTrigger
  30.  * StartStopEventsTrigger} for more details on the detectors. The attitude
  31.  * and the thrust direction are provided by an instance of
  32.  * ThrustDirectionProvider See
  33.  * {@link org.orekit.forces.maneuvers.propulsion.ThrustDirectionAndAttitudeProvider
  34.  * ThrustDirectionProvider} for more details on thrust direction and attitude.
  35.  * @author Mikael Fillastre
  36.  * @author Andrea Fiorentino
  37.  * @since 10.2
  38.  */

  39. public class ConfigurableLowThrustManeuver extends Maneuver {

  40.     /** To be used for ParameterDriver to make thrust non constant. */
  41.     private static String THRUST_MODEL_IDENTIFIER = "ConfigurableLowThrustManeuver";

  42.     /** Thrust direction and spacecraft attitude provided by an external object. */
  43.     private final ThrustDirectionAndAttitudeProvider thrustDirectionProvider;

  44.     /**
  45.      * Constructor.
  46.      * <p>
  47.      * See {@link org.orekit.forces.maneuvers.trigger.StartStopEventsTrigger
  48.      * StartStopEventsTrigger} for requirements on detectors
  49.      * </p>
  50.      * @param thrustDirectionProvider thrust direction and attitude provider
  51.      * @param trigger                 maneuver triggers
  52.      * @param thrust                  the thrust force (N)
  53.      * @param isp                     engine specific impulse (s)
  54.      * @since 11.1
  55.      */
  56.     public ConfigurableLowThrustManeuver(final ThrustDirectionAndAttitudeProvider thrustDirectionProvider,
  57.                                          final ManeuverTriggers trigger,
  58.                                          final double thrust, final double isp) {
  59.         super(thrustDirectionProvider.getManeuverAttitudeProvider(),
  60.               trigger,
  61.               buildBasicConstantThrustPropulsionModel(thrust, isp,
  62.                                                       thrustDirectionProvider.getThrusterAxisInSatelliteFrame()));
  63.         this.thrustDirectionProvider = thrustDirectionProvider;

  64.     }

  65.     /**
  66.      * Build a BasicConstantThrustPropulsionModel from thruster characteristics.
  67.      * @param thrust                       the thrust force (N)
  68.      * @param isp                          engine specific impulse (s)
  69.      * @param thrusterAxisInSatelliteFrame direction in spacecraft frame
  70.      * @return new instance of BasicConstantThrustPropulsionModel
  71.      */
  72.     private static BasicConstantThrustPropulsionModel buildBasicConstantThrustPropulsionModel(final double thrust,
  73.             final double isp, final Vector3D thrusterAxisInSatelliteFrame) {
  74.         return new BasicConstantThrustPropulsionModel(thrust, isp, thrusterAxisInSatelliteFrame,
  75.                 THRUST_MODEL_IDENTIFIER);
  76.     }

  77.     /**
  78.      * Getter on Thrust direction and spacecraft attitude provided by an external
  79.      * object.
  80.      * @return internal field
  81.      */
  82.     public ThrustDirectionAndAttitudeProvider getThrustDirectionProvider() {
  83.         return thrustDirectionProvider;
  84.     }

  85.     /**
  86.      * Get the thrust magnitude.
  87.      * @param date at which the Thrust wants to be known
  88.      * @return thrust force (N).
  89.      */
  90.     public double getThrustMagnitude(final AbsoluteDate date) {
  91.         return ((AbstractConstantThrustPropulsionModel) getPropulsionModel()).getThrustVector(date).getNorm();
  92.     }

  93.     /**
  94.      * Get the thrust magnitude.
  95.      * @return thrust force (N). Will throw
  96.      * an exception if the Thrust driver has several
  97.      * values driven
  98.      */
  99.     public double getThrustMagnitude() {
  100.         return ((AbstractConstantThrustPropulsionModel) getPropulsionModel()).getThrustVector().getNorm();
  101.     }

  102.     /**
  103.      * Get the specific impulse.
  104.      * @param date at which the ISP wants to be known
  105.      * @return specific impulse (s).
  106.      */
  107.     public double getIsp(final AbsoluteDate date) {
  108.         return ((AbstractConstantThrustPropulsionModel) getPropulsionModel()).getIsp(date);
  109.     }

  110.     /**
  111.      * Get the specific impulse.
  112.      * @return specific impulse (s). Will throw
  113.      * an exception if the Thrust driver has several
  114.      * values driven
  115.      */
  116.     public double getIsp() {
  117.         return ((AbstractConstantThrustPropulsionModel) getPropulsionModel()).getIsp();
  118.     }

  119. }