org.apache.commons.math3.ode

## Class FieldExpandableODE<T extends RealFieldElement<T>>

- java.lang.Object
- - org.apache.commons.math3.ode.FieldExpandableODE<T>

- Type Parameters:
    `T` - the type of the field elements

      public class FieldExpandableODE<T extends RealFieldElement<T>>
      extends Object

  This class represents a combined set of first order differential equations, with at least a primary set of equations expandable by some sets of secondary equations.

  One typical use case is the computation of the Jacobian matrix for some ODE. In this case, the primary set of equations corresponds to the raw ODE, and we add to this set another bunch of secondary equations which represent the Jacobian matrix of the primary set.

  We want the integrator to use only the primary set to estimate the errors and hence the step sizes. It should not use the secondary equations in this computation. The `integrator` will be able to know where the primary set ends and so where the secondary sets begin.

  Since:
    3.6
  See Also:
    `FirstOrderFieldDifferentialEquations`, `FieldSecondaryEquations`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FieldExpandableODE(FirstOrderFieldDifferentialEquations<T> primary)` Build an expandable set from its primary ODE set.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `addSecondaryEquations(FieldSecondaryEquations<T> secondary)` Add a set of secondary equations to be integrated along with the primary set.
    `T[]` | `computeDerivatives(T t, T[] y)` Get the current time derivative of the complete state vector.
    `FieldEquationsMapper<T>` | `getMapper()` Get the mapper for the set of equations.
    `void` | `init(T t0, T[] y0, T finalTime)` Initialize equations at the start of an ODE integration.

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

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

- - ### Constructor Detail

    - #### FieldExpandableODE

          public FieldExpandableODE(FirstOrderFieldDifferentialEquations<T> primary)

      Build an expandable set from its primary ODE set.
      Parameters:
        `primary` - the primary set of differential equations to be integrated.

  - ### Method Detail

    - #### getMapper

          public FieldEquationsMapper<T> getMapper()

      Get the mapper for the set of equations.
      Returns:
        mapper for the set of equations

    - #### addSecondaryEquations

          public int addSecondaryEquations(FieldSecondaryEquations<T> secondary)

      Add a set of secondary equations to be integrated along with the primary set.
      Parameters:
        `secondary` - secondary equations set
      Returns:
        index of the secondary equation in the expanded state, to be used as the parameter to `FieldODEState.getSecondaryState(int)` and `FieldODEStateAndDerivative.getSecondaryDerivative(int)` (beware index 0 corresponds to main state, additional states start at 1)

    - #### init

          public void init(T t0,
                  T[] y0,
                  T finalTime)

      Initialize equations at the start of an ODE integration.
      Parameters:
        `t0` - value of the independent time variable at integration start
        `y0` - array containing the value of the state vector at integration start
        `finalTime` - target time for the integration
      Throws:
        `MaxCountExceededException` - if the number of functions evaluations is exceeded
        `DimensionMismatchException` - if arrays dimensions do not match equations settings

    - #### computeDerivatives

          public T[] computeDerivatives(T t,
                               T[] y)
                                                             throws MaxCountExceededException,
                                                                    DimensionMismatchException

      Get the current time derivative of the complete state vector.
      Parameters:
        `t` - current value of the independent time variable
        `y` - array containing the current value of the complete state vector
      Returns:
        time derivative of the complete state vector
      Throws:
        `MaxCountExceededException` - if the number of functions evaluations is exceeded
        `DimensionMismatchException` - if arrays dimensions do not match equations settings

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