Class RungeKuttaFieldIntegrator<T extends RealFieldElement<T>>

    • Constructor Detail

      • RungeKuttaFieldIntegrator

        protected RungeKuttaFieldIntegrator​(Field<T> field,
                                            String name,
                                            T step)
        Simple constructor. Build a Runge-Kutta integrator with the given step. The default step handler does nothing.
        Parameters:
        field - field to which the time and state vector elements belong
        name - name of the method
        step - integration step
    • Method Detail

      • fraction

        protected T fraction​(int p,
                             int q)
        Create a fraction.
        Parameters:
        p - numerator
        q - denominator
        Returns:
        p/q computed in the instance field
      • createInterpolator

        protected abstract org.apache.commons.math4.legacy.ode.nonstiff.RungeKuttaFieldStepInterpolator<TcreateInterpolator​(boolean forward,
                                                                                                                              T[][] yDotK,
                                                                                                                              FieldODEStateAndDerivative<T> globalPreviousState,
                                                                                                                              FieldODEStateAndDerivative<T> globalCurrentState,
                                                                                                                              FieldEquationsMapper<T> mapper)
        Create an interpolator.
        Parameters:
        forward - integration direction indicator
        yDotK - slopes at the intermediate points
        globalPreviousState - start of the global step
        globalCurrentState - end of the global step
        mapper - equations mapper for the all equations
        Returns:
        external weights for the high order method from Butcher array
      • singleStep

        public T[] singleStep​(FirstOrderFieldDifferentialEquations<T> equations,
                              T t0,
                              T[] y0,
                              T t)
        Fast computation of a single step of ODE integration.

        This method is intended for the limited use case of very fast computation of only one step without using any of the rich features of general integrators that may take some time to set up (i.e. no step handlers, no events handlers, no additional states, no interpolators, no error control, no evaluations count, no sanity checks ...). It handles the strict minimum of computation, so it can be embedded in outer loops.

        This method is not used at all by the integrate(FieldExpandableODE, FieldODEState, RealFieldElement) method. It also completely ignores the step set at construction time, and uses only a single step to go from t0 to t.

        As this method does not use any of the state-dependent features of the integrator, it should be reasonably thread-safe if and only if the provided differential equations are themselves thread-safe.

        Parameters:
        equations - differential equations to integrate
        t0 - initial time
        y0 - initial value of the state vector at t0
        t - target time for the integration (can be set to a value smaller than t0 for backward integration)
        Returns:
        state vector at t