org.apache.commons.math.ode
Class DormandPrince54StepInterpolator

java.lang.Object
  extended by org.apache.commons.math.ode.AbstractStepInterpolator
      extended by org.apache.commons.math.ode.RungeKuttaStepInterpolator
          extended by org.apache.commons.math.ode.DormandPrince54StepInterpolator
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, StepInterpolator

 class DormandPrince54StepInterpolator
extends RungeKuttaStepInterpolator

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

Since:
1.2
Version:
$Revision: 620312 $ $Date: 2008-02-10 12:28:59 -0700 (Sun, 10 Feb 2008) $
See Also:
DormandPrince54Integrator

Field Summary
private static double a70
          Last row of the Butcher-array internal weights, element 0.
private static double a72
          Last row of the Butcher-array internal weights, element 2.
private static double a73
          Last row of the Butcher-array internal weights, element 3.
private static double a74
          Last row of the Butcher-array internal weights, element 4.
private static double a75
          Last row of the Butcher-array internal weights, element 5.
private static double d0
          Shampine (1986) Dense output, element 0.
private static double d2
          Shampine (1986) Dense output, element 2.
private static double d3
          Shampine (1986) Dense output, element 3.
private static double d4
          Shampine (1986) Dense output, element 4.
private static double d5
          Shampine (1986) Dense output, element 5.
private static double d6
          Shampine (1986) Dense output, element 6.
private static long serialVersionUID
          Serializable version identifier
private  double[] v1
          First vector for interpolation.
private  double[] v2
          Second vector for interpolation.
private  double[] v3
          Third vector for interpolation.
private  double[] v4
          Fourth vector for interpolation.
private  boolean vectorsInitialized
          Initialization indicator for the interpolation vectors.
 
Fields inherited from class org.apache.commons.math.ode.RungeKuttaStepInterpolator
equations, yDotK
 
Fields inherited from class org.apache.commons.math.ode.AbstractStepInterpolator
currentState, currentTime, h, interpolatedState, interpolatedTime, previousTime
 
Constructor Summary
DormandPrince54StepInterpolator()
          Simple constructor.
DormandPrince54StepInterpolator(DormandPrince54StepInterpolator interpolator)
          Copy constructor.
 
Method Summary
protected  void computeInterpolatedState(double theta, double oneMinusThetaH)
          Compute the state at the interpolated time.
protected  StepInterpolator doCopy()
          Really copy the finalized instance.
 void reinitialize(FirstOrderDifferentialEquations equations, double[] y, double[][] yDotK, boolean forward)
          Reinitialize the instance
 void storeTime(double t)
          Store the current step time.
 
Methods inherited from class org.apache.commons.math.ode.RungeKuttaStepInterpolator
readExternal, writeExternal
 
Methods inherited from class org.apache.commons.math.ode.AbstractStepInterpolator
copy, doFinalize, finalizeStep, getCurrentTime, getInterpolatedState, getInterpolatedTime, getPreviousTime, isForward, readBaseExternal, reinitialize, setInterpolatedTime, shift, writeBaseExternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

v1

private double[] v1
First vector for interpolation.


v2

private double[] v2
Second vector for interpolation.


v3

private double[] v3
Third vector for interpolation.


v4

private double[] v4
Fourth vector for interpolation.


vectorsInitialized

private boolean vectorsInitialized
Initialization indicator for the interpolation vectors.


a70

private static final double a70
Last row of the Butcher-array internal weights, element 0.

See Also:
Constant Field Values

a72

private static final double a72
Last row of the Butcher-array internal weights, element 2.

See Also:
Constant Field Values

a73

private static final double a73
Last row of the Butcher-array internal weights, element 3.

See Also:
Constant Field Values

a74

private static final double a74
Last row of the Butcher-array internal weights, element 4.

See Also:
Constant Field Values

a75

private static final double a75
Last row of the Butcher-array internal weights, element 5.

See Also:
Constant Field Values

d0

private static final double d0
Shampine (1986) Dense output, element 0.

See Also:
Constant Field Values

d2

private static final double d2
Shampine (1986) Dense output, element 2.

See Also:
Constant Field Values

d3

private static final double d3
Shampine (1986) Dense output, element 3.

See Also:
Constant Field Values

d4

private static final double d4
Shampine (1986) Dense output, element 4.

See Also:
Constant Field Values

d5

private static final double d5
Shampine (1986) Dense output, element 5.

See Also:
Constant Field Values

d6

private static final double d6
Shampine (1986) Dense output, element 6.

See Also:
Constant Field Values

serialVersionUID

private static final long serialVersionUID
Serializable version identifier

See Also:
Constant Field Values
Constructor Detail

DormandPrince54StepInterpolator

public DormandPrince54StepInterpolator()
Simple constructor. This constructor builds an instance that is not usable yet, the reinitialize(org.apache.commons.math.ode.FirstOrderDifferentialEquations, double[], double[][], boolean) 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.


DormandPrince54StepInterpolator

public DormandPrince54StepInterpolator(DormandPrince54StepInterpolator 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.

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

reinitialize

public void reinitialize(FirstOrderDifferentialEquations equations,
                         double[] y,
                         double[][] yDotK,
                         boolean forward)
Reinitialize the instance

Overrides:
reinitialize in class RungeKuttaStepInterpolator
Parameters:
equations - set of differential equations being integrated
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

storeTime

public void storeTime(double t)
Store the current step time.

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

computeInterpolatedState

protected void computeInterpolatedState(double theta,
                                        double oneMinusThetaH)
                                 throws DerivativeException
Compute the state at the interpolated time.

Specified by:
computeInterpolatedState 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:
DerivativeException - this exception is propagated to the caller if the underlying user function triggers one