Class AdamsFieldStepInterpolator<T extends RealFieldElement<T>>

java.lang.Object
org.apache.commons.math3.ode.sampling.AbstractFieldStepInterpolator<T>
org.apache.commons.math3.ode.nonstiff.AdamsFieldStepInterpolator<T>
Type Parameters:
T - the type of the field elements
All Implemented Interfaces:
FieldStepInterpolator<T>

class AdamsFieldStepInterpolator<T extends RealFieldElement<T>> extends AbstractFieldStepInterpolator<T>
This class implements an interpolator for Adams integrators using Nordsieck representation.

This interpolator computes dense output around the current point. The interpolation equation is based on Taylor series formulas.

Since:
3.6
See Also:
  • Field Details

    • scalingH

      private T extends RealFieldElement<T> scalingH
      Step size used in the first scaled derivative and Nordsieck vector.
    • reference

      private final FieldODEStateAndDerivative<T extends RealFieldElement<T>> reference
      Reference state.

      Sometimes, the reference state is the same as globalPreviousState, sometimes it is the same as globalCurrentState, so we use a separate field to avoid any confusion.

    • scaled

      private final T extends RealFieldElement<T>[] scaled
      First scaled derivative.
    • nordsieck

      private final Array2DRowFieldMatrix<T extends RealFieldElement<T>> nordsieck
      Nordsieck vector.
  • Constructor Details

    • AdamsFieldStepInterpolator

      AdamsFieldStepInterpolator(T stepSize, FieldODEStateAndDerivative<T> reference, T[] scaled, Array2DRowFieldMatrix<T> nordsieck, boolean isForward, FieldODEStateAndDerivative<T> globalPreviousState, FieldODEStateAndDerivative<T> globalCurrentState, FieldEquationsMapper<T> equationsMapper)
      Simple constructor.
      Parameters:
      stepSize - step size used in the scaled and Nordsieck arrays
      reference - reference state from which Taylor expansion are estimated
      scaled - first scaled derivative
      nordsieck - Nordsieck vector
      isForward - integration direction indicator
      globalPreviousState - start of the global step
      globalCurrentState - end of the global step
      equationsMapper - mapper for ODE equations primary and secondary components
    • AdamsFieldStepInterpolator

      private AdamsFieldStepInterpolator(T stepSize, FieldODEStateAndDerivative<T> reference, T[] scaled, Array2DRowFieldMatrix<T> nordsieck, boolean isForward, FieldODEStateAndDerivative<T> globalPreviousState, FieldODEStateAndDerivative<T> globalCurrentState, FieldODEStateAndDerivative<T> softPreviousState, FieldODEStateAndDerivative<T> softCurrentState, FieldEquationsMapper<T> equationsMapper)
      Simple constructor.
      Parameters:
      stepSize - step size used in the scaled and Nordsieck arrays
      reference - reference state from which Taylor expansion are estimated
      scaled - first scaled derivative
      nordsieck - Nordsieck vector
      isForward - integration direction indicator
      globalPreviousState - start of the global step
      globalCurrentState - end of the global step
      softPreviousState - start of the restricted step
      softCurrentState - end of the restricted step
      equationsMapper - mapper for ODE equations primary and secondary components
  • Method Details

    • create

      protected AdamsFieldStepInterpolator<T> create(boolean newForward, FieldODEStateAndDerivative<T> newGlobalPreviousState, FieldODEStateAndDerivative<T> newGlobalCurrentState, FieldODEStateAndDerivative<T> newSoftPreviousState, FieldODEStateAndDerivative<T> newSoftCurrentState, FieldEquationsMapper<T> newMapper)
      Create a new instance.
      Specified by:
      create in class AbstractFieldStepInterpolator<T extends RealFieldElement<T>>
      Parameters:
      newForward - integration direction indicator
      newGlobalPreviousState - start of the global step
      newGlobalCurrentState - end of the global step
      newSoftPreviousState - start of the restricted step
      newSoftCurrentState - end of the restricted step
      newMapper - equations mapper for the all equations
      Returns:
      a new instance
    • computeInterpolatedStateAndDerivatives

      protected FieldODEStateAndDerivative<T> computeInterpolatedStateAndDerivatives(FieldEquationsMapper<T> equationsMapper, T time, T theta, T thetaH, T oneMinusThetaH)
      Compute the state and derivatives at the interpolated time. This is the main processing method that should be implemented by the derived classes to perform the interpolation.
      Specified by:
      computeInterpolatedStateAndDerivatives in class AbstractFieldStepInterpolator<T extends RealFieldElement<T>>
      Parameters:
      equationsMapper - mapper for ODE equations primary and secondary components
      time - interpolation time
      theta - normalized interpolation abscissa within the step (theta is zero at the previous time step and one at the current time step)
      thetaH - time gap between the previous time and the interpolated time
      oneMinusThetaH - time gap between the interpolated time and the current time
      Returns:
      interpolated state and derivatives
    • taylor

      public static <S extends RealFieldElement<S>> FieldODEStateAndDerivative<S> taylor(FieldODEStateAndDerivative<S> reference, S time, S stepSize, S[] scaled, Array2DRowFieldMatrix<S> nordsieck)
      Estimate state by applying Taylor formula.
      Type Parameters:
      S - the type of the field elements
      Parameters:
      reference - reference state
      time - time at which state must be estimated
      stepSize - step size used in the scaled and Nordsieck arrays
      scaled - first scaled derivative
      nordsieck - Nordsieck vector
      Returns:
      estimated state