Class MidpointFieldStepInterpolator<T extends RealFieldElement<T>>

  • Type Parameters:
    T - the type of the field elements
    All Implemented Interfaces:
    FieldStepInterpolator<T>

    class MidpointFieldStepInterpolator<T extends RealFieldElement<T>>
    extends RungeKuttaFieldStepInterpolator<T>
    This class implements a step interpolator for second order Runge-Kutta integrator.

    This interpolator computes dense output inside the last step computed. The interpolation equation is consistent with the integration scheme :

    • Using reference point at step start:
      y(tn + θ h) = y (tn) + θ h [(1 - θ) y'1 + θ y'2]
    • Using reference point at step end:
      y(tn + θ h) = y (tn + h) + (1-θ) h [θ y'1 - (1+θ) y'2]

    where θ belongs to [0 ; 1] and where y'1 and y'2 are the two evaluations of the derivatives already computed during the step.

    Since:
    3.6
    See Also:
    MidpointFieldIntegrator
    • Constructor Detail

      • MidpointFieldStepInterpolator

        MidpointFieldStepInterpolator​(Field<T> field,
                                      boolean forward,
                                      T[][] yDotK,
                                      FieldODEStateAndDerivative<T> globalPreviousState,
                                      FieldODEStateAndDerivative<T> globalCurrentState,
                                      FieldODEStateAndDerivative<T> softPreviousState,
                                      FieldODEStateAndDerivative<T> softCurrentState,
                                      FieldEquationsMapper<T> mapper)
        Simple constructor.
        Parameters:
        field - field to which the time and state vector elements belong
        forward - integration direction indicator
        yDotK - slopes at the intermediate points
        globalPreviousState - start of the global step
        globalCurrentState - end of the global step
        softPreviousState - start of the restricted step
        softCurrentState - end of the restricted step
        mapper - equations mapper for the all equations
    • Method Detail

      • computeInterpolatedStateAndDerivatives

        protected FieldODEStateAndDerivative<T> computeInterpolatedStateAndDerivatives​(FieldEquationsMapper<T> mapper,
                                                                                       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:
        mapper - 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