AdamsFieldIntegrator (Apache Commons Math 3.6.1 API)

org.apache.commons.math3.ode.nonstiff

## Class AdamsFieldIntegrator<T extends RealFieldElement<T>>

- java.lang.Object
- - org.apache.commons.math3.ode.AbstractFieldIntegrator<T>
  - - org.apache.commons.math3.ode.nonstiff.AdaptiveStepsizeFieldIntegrator<T>
    - - org.apache.commons.math3.ode.MultistepFieldIntegrator<T>
      - - org.apache.commons.math3.ode.nonstiff.AdamsFieldIntegrator<T>

- Type Parameters:
    `T` - the type of the field elements
  All Implemented Interfaces:
    FirstOrderFieldIntegrator<T>
  Direct Known Subclasses:
    AdamsBashforthFieldIntegrator, AdamsMoultonFieldIntegrator

      public abstract class AdamsFieldIntegrator<T extends RealFieldElement<T>>
      extends MultistepFieldIntegrator<T>

  Base class for `Adams-Bashforth` and `Adams-Moulton` integrators.
  Since:
    3.6

- - ### Field Summary

    - ### Fields inherited from class org.apache.commons.math3.ode.MultistepFieldIntegrator

      `nordsieck, scaled`

    - ### Fields inherited from class org.apache.commons.math3.ode.nonstiff.AdaptiveStepsizeFieldIntegrator

      `mainSetDimension, scalAbsoluteTolerance, scalRelativeTolerance, vecAbsoluteTolerance, vecRelativeTolerance`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AdamsFieldIntegrator(Field<T> field, String name, int nSteps, int order, double minStep, double maxStep, double[] vecAbsoluteTolerance, double[] vecRelativeTolerance)` Build an Adams integrator with the given order and step control parameters.
    `AdamsFieldIntegrator(Field<T> field, String name, int nSteps, int order, double minStep, double maxStep, double scalAbsoluteTolerance, double scalRelativeTolerance)` Build an Adams integrator with the given order and step control parameters.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected Array2DRowFieldMatrix<T>` | `initializeHighOrderDerivatives(T h, T[] t, T[][] y, T[][] yDot)` Initialize the high order scaled derivatives at step start.
    `abstract FieldODEStateAndDerivative<T>` | `integrate(FieldExpandableODE<T> equations, FieldODEState<T> initialState, T finalTime)` Integrate the differential equations up to the given time.
    `Array2DRowFieldMatrix<T>` | `updateHighOrderDerivativesPhase1(Array2DRowFieldMatrix<T> highOrder)` Update the high order scaled derivatives for Adams integrators (phase 1).
    `void` | `updateHighOrderDerivativesPhase2(T[] start, T[] end, Array2DRowFieldMatrix<T> highOrder)` Update the high order scaled derivatives Adams integrators (phase 2).

    - ### Methods inherited from class org.apache.commons.math3.ode.MultistepFieldIntegrator

      `computeStepGrowShrinkFactor, getMaxGrowth, getMinReduction, getNSteps, getSafety, getStarterIntegrator, rescale, setMaxGrowth, setMinReduction, setSafety, setStarterIntegrator, start`

    - ### Methods inherited from class org.apache.commons.math3.ode.nonstiff.AdaptiveStepsizeFieldIntegrator

      `filterStep, getMaxStep, getMinStep, initializeStep, resetInternalState, sanityChecks, setInitialStepSize, setStepSizeControl, setStepSizeControl`

    - ### Methods inherited from class org.apache.commons.math3.ode.AbstractFieldIntegrator

      `acceptStep, addEventHandler, addEventHandler, addStepHandler, clearEventHandlers, clearStepHandlers, computeDerivatives, getCurrentSignedStepsize, getCurrentStepStart, getEquations, getEvaluations, getEvaluationsCounter, getEventHandlers, getField, getMaxEvaluations, getName, getStepHandlers, getStepSize, getStepStart, initIntegration, isLastStep, resetOccurred, setIsLastStep, setMaxEvaluations, setStateInitialized, setStepSize, setStepStart`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AdamsFieldIntegrator

          public AdamsFieldIntegrator(Field<T> field,
                              String name,
                              int nSteps,
                              int order,
                              double minStep,
                              double maxStep,
                              double scalAbsoluteTolerance,
                              double scalRelativeTolerance)
                               throws NumberIsTooSmallException

      Build an Adams integrator with the given order and step control parameters.
      Parameters:
        `field` - field to which the time and state vector elements belong
        `name` - name of the method
        `nSteps` - number of steps of the method excluding the one being computed
        `order` - order of the method
        `minStep` - minimal step (sign is irrelevant, regardless of integration direction, forward or backward), the last step can be smaller than this
        `maxStep` - maximal step (sign is irrelevant, regardless of integration direction, forward or backward), the last step can be smaller than this
        `scalAbsoluteTolerance` - allowed absolute error
        `scalRelativeTolerance` - allowed relative error
      Throws:
        `NumberIsTooSmallException` - if order is 1 or less

    - #### AdamsFieldIntegrator

          public AdamsFieldIntegrator(Field<T> field,
                              String name,
                              int nSteps,
                              int order,
                              double minStep,
                              double maxStep,
                              double[] vecAbsoluteTolerance,
                              double[] vecRelativeTolerance)
                               throws IllegalArgumentException

      Build an Adams integrator with the given order and step control parameters.
      Parameters:
        `field` - field to which the time and state vector elements belong
        `name` - name of the method
        `nSteps` - number of steps of the method excluding the one being computed
        `order` - order of the method
        `minStep` - minimal step (sign is irrelevant, regardless of integration direction, forward or backward), the last step can be smaller than this
        `maxStep` - maximal step (sign is irrelevant, regardless of integration direction, forward or backward), the last step can be smaller than this
        `vecAbsoluteTolerance` - allowed absolute error
        `vecRelativeTolerance` - allowed relative error
      Throws:
        `IllegalArgumentException` - if order is 1 or less

  - ### Method Detail

    - #### integrate

          public abstract FieldODEStateAndDerivative<T> integrate(FieldExpandableODE<T> equations,
                                                FieldODEState<T> initialState,
                                                T finalTime)
                                                                                       throws NumberIsTooSmallException,
                                                                                              DimensionMismatchException,
                                                                                              MaxCountExceededException,
                                                                                              NoBracketingException

      Integrate the differential equations up to the given time.

      This method solves an Initial Value Problem (IVP).

      Since this method stores some internal state variables made available in its public interface during integration (`FirstOrderFieldIntegrator.getCurrentSignedStepsize()`), it is not thread-safe.

      Parameters:
        `equations` - differential equations to integrate
        `initialState` - initial state (time, primary and secondary state vectors)
        `finalTime` - target time for the integration (can be set to a value smaller than `t0` for backward integration)
      Returns:
        final state, its time will be the same as `finalTime` if integration reached its target, but may be different if some `FieldEventHandler` stops it at some point.
      Throws:
        `NumberIsTooSmallException` - if integration step is too small
        `MaxCountExceededException` - if the number of functions evaluations is exceeded
        `NoBracketingException` - if the location of an event cannot be bracketed
        `DimensionMismatchException`

    - #### initializeHighOrderDerivatives

          protected Array2DRowFieldMatrix<T> initializeHighOrderDerivatives(T h,
                                                                T[] t,
                                                                T[][] y,
                                                                T[][] yDot)

      Initialize the high order scaled derivatives at step start.
      Specified by:
        `initializeHighOrderDerivatives` in class `MultistepFieldIntegrator<T extends RealFieldElement<T>>`
      Parameters:
        `h` - step size to use for scaling
        `t` - first steps times
        `y` - first steps states
        `yDot` - first steps derivatives
      Returns:
        Nordieck vector at first step (h2/2 y''n, h3/6 y'''n ... hk/k! y(k)n)

    - #### updateHighOrderDerivativesPhase1

          public Array2DRowFieldMatrix<T> updateHighOrderDerivativesPhase1(Array2DRowFieldMatrix<T> highOrder)

      Update the high order scaled derivatives for Adams integrators (phase 1).

      The complete update of high order derivatives has a form similar to:

           rn+1 = (s1(n) - s1(n+1)) P-1 u + P-1 A P rn

      this method computes the P-1 A P rn part.
      Parameters:
        `highOrder` - high order scaled derivatives (h2/2 y'', ... hk/k! y(k))
      Returns:
        updated high order derivatives
      See Also:
        `updateHighOrderDerivativesPhase2(RealFieldElement[], RealFieldElement[], Array2DRowFieldMatrix)`

    - #### updateHighOrderDerivativesPhase2

          public void updateHighOrderDerivativesPhase2(T[] start,
                                              T[] end,
                                              Array2DRowFieldMatrix<T> highOrder)

      Update the high order scaled derivatives Adams integrators (phase 2).

      The complete update of high order derivatives has a form similar to:

           rn+1 = (s1(n) - s1(n+1)) P-1 u + P-1 A P rn

      this method computes the (s1(n) - s1(n+1)) P-1 u part.

      Phase 1 of the update must already have been performed.

      Parameters:
        `start` - first order scaled derivatives at step start
        `end` - first order scaled derivatives at step end
        `highOrder` - high order scaled derivatives, will be modified (h2/2 y'', ... hk/k! y(k))
      See Also:
        `updateHighOrderDerivativesPhase1(Array2DRowFieldMatrix)`

Copyright © 2003–2016 The Apache Software Foundation. All rights reserved.