Top Description Fields Constructors Methods
org.apache.commons.math3.ode.nonstiff

public Class DormandPrince853FieldIntegrator<T extends RealFieldElement<T>>

extends EmbeddedRungeKuttaFieldIntegrator<T extends RealFieldElement<T>>
Class Inheritance
Type Parameters
<T>
the type of the field elements
Imports
org.apache.commons.math3.Field, .RealFieldElement, org.apache.commons.math3.ode.FieldEquationsMapper, .FieldODEStateAndDerivative, org.apache.commons.math3.util.MathArrays, .MathUtils

This class implements the 8(5,3) Dormand-Prince integrator for Ordinary Differential Equations.

This integrator is an embedded Runge-Kutta integrator of order 8(5,3) used in local extrapolation mode (i.e. the solution is computed using the high order formula) with stepsize control (and automatic step initialization) and continuous output. This method uses 12 functions evaluations per step for integration and 4 evaluations for interpolation. However, since the first interpolation evaluation is the same as the first integration evaluation of the next step, we have included it in the integrator rather than in the interpolator and specified the method was an fsal. Hence, despite we have 13 stages here, the cost is really 12 evaluations per step even if no interpolation is done, and the overcost of interpolation is only 3 evaluations.

This method is based on an 8(6) method by Dormand and Prince (i.e. order 8 for the integration and order 6 for error estimation) modified by Hairer and Wanner to use a 5th order error estimator with 3rd order correction. This modification was introduced because the original method failed in some cases (wrong steps can be accepted when step size is too large, for example in the Brusselator problem) and also had severe difficulties when applied to problems with discontinuities. This modification is explained in the second edition of the first volume (Nonstiff Problems) of the reference book by Hairer, Norsett and Wanner: Solving Ordinary Differential Equations (Springer-Verlag, ISBN 3-540-56670-8).

Since
3.6

Field Summary

Modifier and TypeField and Description
private final T
e1_01

First error weights array, element 1.

private final T
e1_06

First error weights array, element 6.

private final T
e1_07

First error weights array, element 7.

private final T
e1_08

First error weights array, element 8.

private final T
e1_09

First error weights array, element 9.

private final T
e1_10

First error weights array, element 10.

private final T
e1_11

First error weights array, element 11.

private final T
e1_12

First error weights array, element 12.

private final T
e2_01

Second error weights array, element 1.

private final T
e2_06

Second error weights array, element 6.

private final T
e2_07

Second error weights array, element 7.

private final T
e2_08

Second error weights array, element 8.

private final T
e2_09

Second error weights array, element 9.

private final T
e2_10

Second error weights array, element 10.

private final T
e2_11

Second error weights array, element 11.

private final T
e2_12

Second error weights array, element 12.

private static final String
METHOD_NAME

Integrator method name.

Constructor Summary

AccessConstructor and Description
public
DormandPrince853FieldIntegrator(final Field<T>
field to which the time and state vector elements belong
field
,
final double
minimal step (sign is irrelevant, regardless of integration direction, forward or backward), the last step can be smaller than this
minStep
,
final double
maximal step (sign is irrelevant, regardless of integration direction, forward or backward), the last step can be smaller than this
maxStep
,
final double
allowed absolute error
scalAbsoluteTolerance
,
final double
allowed relative error
scalRelativeTolerance
)

Simple constructor.

public
DormandPrince853FieldIntegrator(final Field<T>
field to which the time and state vector elements belong
field
,
final double
minimal step (sign is irrelevant, regardless of integration direction, forward or backward), the last step can be smaller than this
minStep
,
final double
maximal step (sign is irrelevant, regardless of integration direction, forward or backward), the last step can be smaller than this
maxStep
,
final double[]
allowed absolute error
vecAbsoluteTolerance
,
final double[]
allowed relative error
vecRelativeTolerance
)

Simple constructor.

Method Summary

Modifier and TypeMethod and Description
protected DormandPrince853FieldStepInterpolator<T>
createInterpolator(final boolean
integration direction indicator
forward
,
T[][]
slopes at the intermediate points
yDotK
,
final FieldODEStateAndDerivative<T>
start of the global step
globalPreviousState
,
final FieldODEStateAndDerivative<T>
end of the global step
globalCurrentState
,
final FieldEquationsMapper<T>
equations mapper for the all equations
mapper
)

Implements abstract org.apache.commons.math3.ode.nonstiff.EmbeddedRungeKuttaFieldIntegrator.createInterpolator.

Create an interpolator.

protected T
estimateError(final T[][]
derivatives computed during the first stages
yDotK
,
final T[]
estimate of the step at the start of the step
y0
,
final T[]
estimate of the step at the end of the step
y1
,
final T
current step
h
)

Implements abstract org.apache.commons.math3.ode.nonstiff.EmbeddedRungeKuttaFieldIntegrator.estimateError.

Compute the error ratio.

public T[][]
getA()

Implements org.apache.commons.math3.ode.nonstiff.FieldButcherArrayProvider.getA.

Get the internal weights from Butcher array (without the first empty row).

public T[]
getB()

Implements org.apache.commons.math3.ode.nonstiff.FieldButcherArrayProvider.getB.

Get the external weights for the high order method from Butcher array.

public T[]
getC()

Implements org.apache.commons.math3.ode.nonstiff.FieldButcherArrayProvider.getC.

Get the time steps from Butcher array (without the first zero).

public int
Inherited from org.apache.commons.math3.ode.nonstiff.EmbeddedRungeKuttaFieldIntegrator:
fractionfractiongetMaxGrowthgetMinReductiongetSafetyintegratesetMaxGrowthsetMinReductionsetSafety

Field Detail

e1_01back to summary
private final T e1_01

First error weights array, element 1.

e1_06back to summary
private final T e1_06

First error weights array, element 6.

e1_07back to summary
private final T e1_07

First error weights array, element 7.

e1_08back to summary
private final T e1_08

First error weights array, element 8.

e1_09back to summary
private final T e1_09

First error weights array, element 9.

e1_10back to summary
private final T e1_10

First error weights array, element 10.

e1_11back to summary
private final T e1_11

First error weights array, element 11.

e1_12back to summary
private final T e1_12

First error weights array, element 12.

e2_01back to summary
private final T e2_01

Second error weights array, element 1.

e2_06back to summary
private final T e2_06

Second error weights array, element 6.

e2_07back to summary
private final T e2_07

Second error weights array, element 7.

e2_08back to summary
private final T e2_08

Second error weights array, element 8.

e2_09back to summary
private final T e2_09

Second error weights array, element 9.

e2_10back to summary
private final T e2_10

Second error weights array, element 10.

e2_11back to summary
private final T e2_11

Second error weights array, element 11.

e2_12back to summary
private final T e2_12

Second error weights array, element 12.

METHOD_NAMEback to summary
private static final String METHOD_NAME

Integrator method name.

Constructor Detail

DormandPrince853FieldIntegratorback to summary
public DormandPrince853FieldIntegrator(final Field<T> field, final double minStep, final double maxStep, final double scalAbsoluteTolerance, final double scalRelativeTolerance)

Simple constructor. Build an eighth order Dormand-Prince integrator with the given step bounds

Parameters
field:Field<T>

field to which the time and state vector elements belong

minStep:double

minimal step (sign is irrelevant, regardless of integration direction, forward or backward), the last step can be smaller than this

maxStep:double

maximal step (sign is irrelevant, regardless of integration direction, forward or backward), the last step can be smaller than this

scalAbsoluteTolerance:double

allowed absolute error

scalRelativeTolerance:double

allowed relative error

DormandPrince853FieldIntegratorback to summary
public DormandPrince853FieldIntegrator(final Field<T> field, final double minStep, final double maxStep, final double[] vecAbsoluteTolerance, final double[] vecRelativeTolerance)

Simple constructor. Build an eighth order Dormand-Prince integrator with the given step bounds

Parameters
field:Field<T>

field to which the time and state vector elements belong

minStep:double

minimal step (sign is irrelevant, regardless of integration direction, forward or backward), the last step can be smaller than this

maxStep:double

maximal step (sign is irrelevant, regardless of integration direction, forward or backward), the last step can be smaller than this

vecAbsoluteTolerance:double[]

allowed absolute error

vecRelativeTolerance:double[]

allowed relative error

Method Detail

createInterpolatorback to summary
protected DormandPrince853FieldStepInterpolator<T> createInterpolator(final boolean forward, T[][] yDotK, final FieldODEStateAndDerivative<T> globalPreviousState, final FieldODEStateAndDerivative<T> globalCurrentState, final FieldEquationsMapper<T> mapper)

Implements abstract org.apache.commons.math3.ode.nonstiff.EmbeddedRungeKuttaFieldIntegrator.createInterpolator.

Doc from org.apache.commons.math3.ode.nonstiff.EmbeddedRungeKuttaFieldIntegrator.createInterpolator.

Create an interpolator.

Parameters
forward:boolean

integration direction indicator

yDotK:T[][]

slopes at the intermediate points

globalPreviousState:FieldODEStateAndDerivative<T>

start of the global step

globalCurrentState:FieldODEStateAndDerivative<T>

end of the global step

mapper:FieldEquationsMapper<T>

equations mapper for the all equations

Returns:DormandPrince853FieldStepInterpolator<T>

external weights for the high order method from Butcher array

Annotations
@Override
estimateErrorback to summary
protected T estimateError(final T[][] yDotK, final T[] y0, final T[] y1, final T h)

Implements abstract org.apache.commons.math3.ode.nonstiff.EmbeddedRungeKuttaFieldIntegrator.estimateError.

Doc from org.apache.commons.math3.ode.nonstiff.EmbeddedRungeKuttaFieldIntegrator.estimateError.

Compute the error ratio.

Parameters
yDotK:T[][]

derivatives computed during the first stages

y0:T[]

estimate of the step at the start of the step

y1:T[]

estimate of the step at the end of the step

h:T

current step

Returns:T

error ratio, greater than 1 if step should be rejected

Annotations
@Override
getAback to summary
public T[][] getA()

Implements org.apache.commons.math3.ode.nonstiff.FieldButcherArrayProvider.getA.

Doc from org.apache.commons.math3.ode.nonstiff.FieldButcherArrayProvider.getA.

Get the internal weights from Butcher array (without the first empty row).

Returns:T[][]

internal weights from Butcher array (without the first empty row)

getBback to summary
public T[] getB()

Implements org.apache.commons.math3.ode.nonstiff.FieldButcherArrayProvider.getB.

Doc from org.apache.commons.math3.ode.nonstiff.FieldButcherArrayProvider.getB.

Get the external weights for the high order method from Butcher array.

Returns:T[]

external weights for the high order method from Butcher array

getCback to summary
public T[] getC()

Implements org.apache.commons.math3.ode.nonstiff.FieldButcherArrayProvider.getC.

Doc from org.apache.commons.math3.ode.nonstiff.FieldButcherArrayProvider.getC.

Get the time steps from Butcher array (without the first zero).

Returns:T[]

time steps from Butcher array (without the first zero

getOrderback to summary
public int getOrder()

Implements abstract org.apache.commons.math3.ode.nonstiff.EmbeddedRungeKuttaFieldIntegrator.getOrder.

Doc from org.apache.commons.math3.ode.nonstiff.EmbeddedRungeKuttaFieldIntegrator.getOrder.

Get the order of the method.

Returns:int

order of the method

Annotations
@Override