Class AbstractDragForceModel

    • Constructor Detail

      • AbstractDragForceModel

        protected AbstractDragForceModel​(Atmosphere atmosphere)
        Constructor with default value for finite differences flag.
        Parameters:
        atmosphere - atmospheric model
      • AbstractDragForceModel

        protected AbstractDragForceModel​(Atmosphere atmosphere,
                                         boolean useFiniteDifferencesOnDensityWrtPosition)
        Constructor.
        Parameters:
        atmosphere - atmospheric model
        useFiniteDifferencesOnDensityWrtPosition - flag to use finite differences to compute density derivatives w.r.t. position (is less accurate but can be faster depending on model)
        Since:
        12.1
    • Method Detail

      • getAtmosphere

        public Atmosphere getAtmosphere()
        Get the atmospheric model.
        Returns:
        atmosphere model
        Since:
        12.1
      • dependsOnPositionOnly

        public boolean dependsOnPositionOnly()
        Check if force model depends on position only at a given, fixed date.
        Specified by:
        dependsOnPositionOnly in interface ForceModel
        Returns:
        true if force model depends on position only, false if it depends on velocity, either directly or due to a dependency on attitude
      • isDSStateDerivative

        protected <T extends CalculusFieldElement<T>> boolean isDSStateDerivative​(FieldSpacecraftState<T> state)
        Check if a field state corresponds to derivatives with respect to state.
        Type Parameters:
        T - type of the field elements
        Parameters:
        state - state to check
        Returns:
        true if state corresponds to derivatives with respect to state
      • isGradientStateDerivative

        protected <T extends CalculusFieldElement<T>> boolean isGradientStateDerivative​(FieldSpacecraftState<T> state)
        Check if a field state corresponds to derivatives with respect to state.
        Type Parameters:
        T - type of the field elements
        Parameters:
        state - state to check
        Returns:
        true if state corresponds to derivatives with respect to state
      • getFieldDensity

        protected <T extends CalculusFieldElement<T>> T getFieldDensity​(FieldSpacecraftState<T> s)
        Evaluate the Field density.
        Type Parameters:
        T - field type
        Parameters:
        s - spacecraft state
        Returns:
        atmospheric density
        Since:
        12.1
      • isVariable

        protected boolean isVariable​(DerivativeStructure ds,
                                     int index)
        Check if a derivative represents a specified variable.
        Parameters:
        ds - derivative to check
        index - index of the variable
        Returns:
        true if the derivative represents a specified variable
      • isVariable

        protected boolean isVariable​(Gradient g,
                                     int index)
        Check if a derivative represents a specified variable.
        Parameters:
        g - derivative to check
        index - index of the variable
        Returns:
        true if the derivative represents a specified variable
      • getDSDensityWrtStateUsingFiniteDifferences

        protected DerivativeStructure getDSDensityWrtStateUsingFiniteDifferences​(AbsoluteDate date,
                                                                                 Frame frame,
                                                                                 FieldVector3D<DerivativeStructure> position)
        Compute density and its derivatives. Using finite differences for the derivatives. And doing the actual computation only for the derivatives with respect to position (others are set to 0.).

        From a theoretical point of view, this method computes the same values as Atmosphere.getDensity(FieldAbsoluteDate, FieldVector3D, Frame) in the specific case of DerivativeStructure with respect to state, so it is less general. However, it can be faster depending the Field implementation.

        The derivatives should be computed with respect to position. The input parameters already take into account the free parameters (6, 7 or 8 depending on derivation with respect to drag coefficient and lift ratio being considered or not) and order (always 1). Free parameters at indices 0, 1 and 2 correspond to derivatives with respect to position. Free parameters at indices 3, 4 and 5 correspond to derivatives with respect to velocity (these derivatives will remain zero as the atmospheric density does not depend on velocity). Free parameter at indexes 6 and 7 (if present) corresponds to derivatives with respect to drag coefficient and/or lift ratio (one of these or both). This 2 last derivatives will remain zero as atmospheric density does not depend on them.

        Parameters:
        date - current date
        frame - inertial reference frame for state (both orbit and attitude)
        position - position of spacecraft in inertial frame
        Returns:
        the density and its derivatives
      • getDSDensityWrtState

        protected DerivativeStructure getDSDensityWrtState​(AbsoluteDate date,
                                                           Frame frame,
                                                           FieldVector3D<DerivativeStructure> position)
        Compute density and its derivatives. And doing the actual computation only for the derivatives with respect to position (others are set to 0.).

        The derivatives should be computed with respect to position. The input parameters already take into account the free parameters (6, 7 or 8 depending on derivation with respect to drag coefficient and lift ratio being considered or not) and order (always 1). Free parameters at indices 0, 1 and 2 correspond to derivatives with respect to position. Free parameters at indices 3, 4 and 5 correspond to derivatives with respect to velocity (these derivatives will remain zero as the atmospheric density does not depend on velocity). Free parameter at indexes 6 and 7 (if present) corresponds to derivatives with respect to drag coefficient and/or lift ratio (one of these or both). This 2 last derivatives will remain zero as atmospheric density does not depend on them.

        Parameters:
        date - current date
        frame - inertial reference frame for state (both orbit and attitude)
        position - position of spacecraft in inertial frame
        Returns:
        the density and its derivatives
      • getGradientDensityWrtStateUsingFiniteDifferences

        protected Gradient getGradientDensityWrtStateUsingFiniteDifferences​(AbsoluteDate date,
                                                                            Frame frame,
                                                                            FieldVector3D<Gradient> position)
        Compute density and its derivatives. Using finite differences for the derivatives. And doing the actual computation only for the derivatives with respect to position (others are set to 0.).

        From a theoretical point of view, this method computes the same values as Atmosphere.getDensity(FieldAbsoluteDate, FieldVector3D, Frame) in the specific case of Gradient with respect to state, so it is less general. However, it can be faster depending the Field implementation.

        The derivatives should be computed with respect to position. The input parameters already take into account the free parameters (6, 7 or 8 depending on derivation with respect to drag coefficient and lift ratio being considered or not) and order (always 1). Free parameters at indices 0, 1 and 2 correspond to derivatives with respect to position. Free parameters at indices 3, 4 and 5 correspond to derivatives with respect to velocity (these derivatives will remain zero as the atmospheric density does not depend on velocity). Free parameter at indexes 6 and 7 (if present) corresponds to derivatives with respect to drag coefficient and/or lift ratio (one of these or both). This 2 last derivatives will remain zero as atmospheric density does not depend on them.

        Parameters:
        date - current date
        frame - inertial reference frame for state (both orbit and attitude)
        position - position of spacecraft in inertial frame
        Returns:
        the density and its derivatives
      • getGradientDensityWrtState

        protected Gradient getGradientDensityWrtState​(AbsoluteDate date,
                                                      Frame frame,
                                                      FieldVector3D<Gradient> position)
        Compute density and its derivatives.

        The derivatives should be computed with respect to position. The input parameters already take into account the free parameters (6, 7 or 8 depending on derivation with respect to drag coefficient and lift ratio being considered or not) and order (always 1). Free parameters at indices 0, 1 and 2 correspond to derivatives with respect to position. Free parameters at indices 3, 4 and 5 correspond to derivatives with respect to velocity (these derivatives will remain zero as the atmospheric density does not depend on velocity). Free parameter at indexes 6 and 7 (if present) corresponds to derivatives with respect to drag coefficient and/or lift ratio (one of these or both). This 2 last derivatives will remain zero as atmospheric density does not depend on them.

        Parameters:
        date - current date
        frame - inertial reference frame for state (both orbit and attitude)
        position - position of spacecraft in inertial frame
        Returns:
        the density and its derivatives
        Since:
        12.1