org.apache.commons.math3.ode.nonstiff

## Class DormandPrince853StepInterpolator

- java.lang.Object
- - org.apache.commons.math3.ode.sampling.AbstractStepInterpolator
  - - org.apache.commons.math3.ode.nonstiff.RungeKuttaStepInterpolator
    - - org.apache.commons.math3.ode.nonstiff.DormandPrince853StepInterpolator

All Implemented Interfaces:
  Externalizable, Serializable, StepInterpolator

     class DormandPrince853StepInterpolator
    extends RungeKuttaStepInterpolator

This class represents an interpolator over the last step during an ODE integration for the 8(5,3) Dormand-Prince integrator.

Since:
  1.2
Version:
  $Id: DormandPrince853StepInterpolator.java 1416643 2012-12-03 19:37:14Z tn $
See Also:
  `DormandPrince853Integrator`

### Field Summary

Fields
`private static double` `B_01` Propagation weights, element 1.
`private static double` `B_06` Propagation weights, element 6.
`private static double` `B_07` Propagation weights, element 7.
`private static double` `B_08` Propagation weights, element 8.
`private static double` `B_09` Propagation weights, element 9.
`private static double` `B_10` Propagation weights, element 10.
`private static double` `B_11` Propagation weights, element 11.
`private static double` `B_12` Propagation weights, element 12.
`private static double` `C14` Time step for stage 14 (interpolation only).
`private static double` `C15` Time step for stage 15 (interpolation only).
`private static double` `C16` Time step for stage 16 (interpolation only).
`private static double[][]` `D` Interpolation weights.
`private static double` `K14_01` Internal weights for stage 14, element 1.
`private static double` `K14_06` Internal weights for stage 14, element 6.
`private static double` `K14_07` Internal weights for stage 14, element 7.
`private static double` `K14_08` Internal weights for stage 14, element 8.
`private static double` `K14_09` Internal weights for stage 14, element 9.
`private static double` `K14_10` Internal weights for stage 14, element 10.
`private static double` `K14_11` Internal weights for stage 14, element 11.
`private static double` `K14_12` Internal weights for stage 14, element 12.
`private static double` `K14_13` Internal weights for stage 14, element 13.
`private static double` `K15_01` Internal weights for stage 15, element 1.
`private static double` `K15_06` Internal weights for stage 15, element 6.
`private static double` `K15_07` Internal weights for stage 15, element 7.
`private static double` `K15_08` Internal weights for stage 15, element 8.
`private static double` `K15_09` Internal weights for stage 15, element 9.
`private static double` `K15_10` Internal weights for stage 15, element 10.
`private static double` `K15_11` Internal weights for stage 15, element 11.
`private static double` `K15_12` Internal weights for stage 15, element 12.
`private static double` `K15_13` Internal weights for stage 15, element 13.
`private static double` `K15_14` Internal weights for stage 15, element 14.
`private static double` `K16_01` Internal weights for stage 16, element 1.
`private static double` `K16_06` Internal weights for stage 16, element 6.
`private static double` `K16_07` Internal weights for stage 16, element 7.
`private static double` `K16_08` Internal weights for stage 16, element 8.
`private static double` `K16_09` Internal weights for stage 16, element 9.
`private static double` `K16_10` Internal weights for stage 16, element 10.
`private static double` `K16_11` Internal weights for stage 16, element 11.
`private static double` `K16_12` Internal weights for stage 16, element 12.
`private static double` `K16_13` Internal weights for stage 16, element 13.
`private static double` `K16_14` Internal weights for stage 16, element 14.
`private static double` `K16_15` Internal weights for stage 16, element 15.
`private static long` `serialVersionUID` Serializable version identifier.
`private double[][]` `v` Vectors for interpolation.
`private boolean` `vectorsInitialized` Initialization indicator for the interpolation vectors.
`private double[][]` `yDotKLast` Last evaluations.

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

`integrator, previousState, yDotK`

### Fields inherited from class org.apache.commons.math3.ode.sampling.AbstractStepInterpolator

`currentState, h, interpolatedDerivatives, interpolatedPrimaryDerivatives, interpolatedPrimaryState, interpolatedSecondaryDerivatives, interpolatedSecondaryState, interpolatedState, interpolatedTime`

### Constructor Summary

Constructors
Constructor and Description
`DormandPrince853StepInterpolator()` Simple constructor.
`DormandPrince853StepInterpolator(DormandPrince853StepInterpolator interpolator)` Copy constructor.

### Method Summary

Methods
`protected void` `computeInterpolatedStateAndDerivatives(double theta, double oneMinusThetaH)` Compute the state and derivatives at the interpolated time.
`protected StepInterpolator` `doCopy()` Really copy the finalized instance.
`protected void` `doFinalize()` Really finalize the step.
`void` `readExternal(ObjectInput in)`
`void` `reinitialize(AbstractIntegrator integrator, double[] y, double[][] yDotK, boolean forward, EquationsMapper primaryMapper, EquationsMapper[] secondaryMappers)` Reinitialize the instance
`void` `storeTime(double t)` Store the current step time.
`void` `writeExternal(ObjectOutput out)`

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

`shift`

### Methods inherited from class org.apache.commons.math3.ode.sampling.AbstractStepInterpolator

`copy, finalizeStep, getCurrentTime, getGlobalCurrentTime, getGlobalPreviousTime, getInterpolatedDerivatives, getInterpolatedSecondaryDerivatives, getInterpolatedSecondaryState, getInterpolatedState, getInterpolatedTime, getPreviousTime, isForward, readBaseExternal, reinitialize, setInterpolatedTime, setSoftCurrentTime, setSoftPreviousTime, writeBaseExternal`

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

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

### Field Detail

#### serialVersionUID

    private static final long serialVersionUID

Serializable version identifier.

See Also:
  Constant Field Values

#### B_01

    private static final double B_01

Propagation weights, element 1.

See Also:
  Constant Field Values

#### B_06

    private static final double B_06

Propagation weights, element 6.

See Also:
  Constant Field Values

#### B_07

    private static final double B_07

Propagation weights, element 7.

See Also:
  Constant Field Values

#### B_08

    private static final double B_08

Propagation weights, element 8.

See Also:
  Constant Field Values

#### B_09

    private static final double B_09

Propagation weights, element 9.

See Also:
  Constant Field Values

#### B_10

    private static final double B_10

Propagation weights, element 10.

See Also:
  Constant Field Values

#### B_11

    private static final double B_11

Propagation weights, element 11.

See Also:
  Constant Field Values

#### B_12

    private static final double B_12

Propagation weights, element 12.

See Also:
  Constant Field Values

#### C14

    private static final double C14

Time step for stage 14 (interpolation only).

See Also:
  Constant Field Values

#### K14_01

    private static final double K14_01

Internal weights for stage 14, element 1.

See Also:
  Constant Field Values

#### K14_06

    private static final double K14_06

Internal weights for stage 14, element 6.

See Also:
  Constant Field Values

#### K14_07

    private static final double K14_07

Internal weights for stage 14, element 7.

See Also:
  Constant Field Values

#### K14_08

    private static final double K14_08

Internal weights for stage 14, element 8.

See Also:
  Constant Field Values

#### K14_09

    private static final double K14_09

Internal weights for stage 14, element 9.

See Also:
  Constant Field Values

#### K14_10

    private static final double K14_10

Internal weights for stage 14, element 10.

See Also:
  Constant Field Values

#### K14_11

    private static final double K14_11

Internal weights for stage 14, element 11.

See Also:
  Constant Field Values

#### K14_12

    private static final double K14_12

Internal weights for stage 14, element 12.

See Also:
  Constant Field Values

#### K14_13

    private static final double K14_13

Internal weights for stage 14, element 13.

See Also:
  Constant Field Values

#### C15

    private static final double C15

Time step for stage 15 (interpolation only).

See Also:
  Constant Field Values

#### K15_01

    private static final double K15_01

Internal weights for stage 15, element 1.

See Also:
  Constant Field Values

#### K15_06

    private static final double K15_06

Internal weights for stage 15, element 6.

See Also:
  Constant Field Values

#### K15_07

    private static final double K15_07

Internal weights for stage 15, element 7.

See Also:
  Constant Field Values

#### K15_08

    private static final double K15_08

Internal weights for stage 15, element 8.

See Also:
  Constant Field Values

#### K15_09

    private static final double K15_09

Internal weights for stage 15, element 9.

See Also:
  Constant Field Values

#### K15_10

    private static final double K15_10

Internal weights for stage 15, element 10.

See Also:
  Constant Field Values

#### K15_11

    private static final double K15_11

Internal weights for stage 15, element 11.

See Also:
  Constant Field Values

#### K15_12

    private static final double K15_12

Internal weights for stage 15, element 12.

See Also:
  Constant Field Values

#### K15_13

    private static final double K15_13

Internal weights for stage 15, element 13.

See Also:
  Constant Field Values

#### K15_14

    private static final double K15_14

Internal weights for stage 15, element 14.

See Also:
  Constant Field Values

#### C16

    private static final double C16

Time step for stage 16 (interpolation only).

See Also:
  Constant Field Values

#### K16_01

    private static final double K16_01

Internal weights for stage 16, element 1.

See Also:
  Constant Field Values

#### K16_06

    private static final double K16_06

Internal weights for stage 16, element 6.

See Also:
  Constant Field Values

#### K16_07

    private static final double K16_07

Internal weights for stage 16, element 7.

See Also:
  Constant Field Values

#### K16_08

    private static final double K16_08

Internal weights for stage 16, element 8.

See Also:
  Constant Field Values

#### K16_09

    private static final double K16_09

Internal weights for stage 16, element 9.

See Also:
  Constant Field Values

#### K16_10

    private static final double K16_10

Internal weights for stage 16, element 10.

See Also:
  Constant Field Values

#### K16_11

    private static final double K16_11

Internal weights for stage 16, element 11.

See Also:
  Constant Field Values

#### K16_12

    private static final double K16_12

Internal weights for stage 16, element 12.

See Also:
  Constant Field Values

#### K16_13

    private static final double K16_13

Internal weights for stage 16, element 13.

See Also:
  Constant Field Values

#### K16_14

    private static final double K16_14

Internal weights for stage 16, element 14.

See Also:
  Constant Field Values

#### K16_15

    private static final double K16_15

Internal weights for stage 16, element 15.

See Also:
  Constant Field Values

#### D

    private static final double[][] D

Interpolation weights. (beware that only the non-null values are in the table)

#### yDotKLast

    private double[][] yDotKLast

Last evaluations.

#### v

    private double[][] v

Vectors for interpolation.

#### vectorsInitialized

    private boolean vectorsInitialized

Initialization indicator for the interpolation vectors.

### Constructor Detail

#### DormandPrince853StepInterpolator

    public DormandPrince853StepInterpolator()

Simple constructor. This constructor builds an instance that is not usable yet, the `reinitialize(org.apache.commons.math3.ode.AbstractIntegrator, double[], double[][], boolean, org.apache.commons.math3.ode.EquationsMapper, org.apache.commons.math3.ode.EquationsMapper[])` method should be called before using the instance in order to initialize the internal arrays. This constructor is used only in order to delay the initialization in some cases. The `EmbeddedRungeKuttaIntegrator` uses the prototyping design pattern to create the step interpolators by cloning an uninitialized model and latter initializing the copy.

#### DormandPrince853StepInterpolator

    public DormandPrince853StepInterpolator(DormandPrince853StepInterpolator interpolator)

Copy constructor.

Parameters:
  `interpolator` - interpolator to copy from. The copy is a deep copy: its arrays are separated from the original arrays of the instance

### Method Detail

#### doCopy

    protected StepInterpolator doCopy()

Really copy the finalized instance.

This method is called by `AbstractStepInterpolator.copy()` after the step has been finalized. It must perform a deep copy to have an new instance completely independent for the original instance.

Specified by:
  `doCopy` in class `AbstractStepInterpolator`
Returns:
  a copy of the finalized instance

#### reinitialize

    public void reinitialize(AbstractIntegrator integrator,
                    double[] y,
                    double[][] yDotK,
                    boolean forward,
                    EquationsMapper primaryMapper,
                    EquationsMapper[] secondaryMappers)

Reinitialize the instance

Some Runge-Kutta integrators need fewer functions evaluations than their counterpart step interpolators. So the interpolator should perform the last evaluations they need by themselves. The `RungeKuttaIntegrator` and `EmbeddedRungeKuttaIntegrator` abstract classes call this method in order to let the step interpolator perform the evaluations it needs. These evaluations will be performed during the call to `doFinalize` if any, i.e. only if the step handler either calls the `finalizeStep` method or the `getInterpolatedState` method (for an interpolator which needs a finalization) or if it clones the step interpolator.

Overrides:
  `reinitialize` in class `RungeKuttaStepInterpolator`
Parameters:
  `integrator` - integrator being used
  `y` - reference to the integrator array holding the state at the end of the step
  `yDotK` - reference to the integrator array holding all the intermediate slopes
  `forward` - integration direction indicator
  `primaryMapper` - equations mapper for the primary equations set
  `secondaryMappers` - equations mappers for the secondary equations sets

#### storeTime

    public void storeTime(double t)

Store the current step time.

Overrides:
  `storeTime` in class `AbstractStepInterpolator`
Parameters:
  `t` - current time

#### computeInterpolatedStateAndDerivatives

    protected void computeInterpolatedStateAndDerivatives(double theta,
                                              double oneMinusThetaH)
                                                   throws MaxCountExceededException

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 `AbstractStepInterpolator`
Parameters:
  `theta` - normalized interpolation abscissa within the step (theta is zero at the previous time step and one at the current time step)
  `oneMinusThetaH` - time gap between the interpolated time and the current time
Throws:
  `MaxCountExceededException` - if the number of functions evaluations is exceeded

#### doFinalize

    protected void doFinalize()
                       throws MaxCountExceededException

Really finalize the step. The default implementation of this method does nothing.

Overrides:
  `doFinalize` in class `AbstractStepInterpolator`
Throws:
  `MaxCountExceededException` - if the number of functions evaluations is exceeded

#### writeExternal

    public void writeExternal(ObjectOutput out)
                       throws IOException

Specified by:
  `writeExternal` in interface `Externalizable`
Overrides:
  `writeExternal` in class `RungeKuttaStepInterpolator`
Throws:
  `IOException`

#### readExternal

    public void readExternal(ObjectInput in)
                      throws IOException,
                             ClassNotFoundException

Specified by:
  `readExternal` in interface `Externalizable`
Overrides:
  `readExternal` in class `RungeKuttaStepInterpolator`
Throws:
  `IOException`
  `ClassNotFoundException`