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

public abstract Class AdamsIntegrator

extends MultistepIntegrator
Class Inheritance
Known Direct Subclasses
org.apache.commons.math3.ode.nonstiff.AdamsMoultonIntegrator, org.apache.commons.math3.ode.nonstiff.AdamsBashforthIntegrator
Imports
org.apache.commons.math3.exception.DimensionMismatchException, .MaxCountExceededException, .NoBracketingException, .NumberIsTooSmallException, org.apache.commons.math3.linear.Array2DRowRealMatrix, org.apache.commons.math3.ode.ExpandableStatefulODE, .MultistepIntegrator

Base class for Adams-Bashforth and Adams-Moulton integrators.
Since
2.0

Field Summary

Modifier and TypeField and Description
private final AdamsNordsieckTransformer
transformer

Transformer.

Inherited from org.apache.commons.math3.ode.MultistepIntegrator:
nordsieckscaled

Constructor Summary

AccessConstructor and Description
public
AdamsIntegrator(final String
name of the method
name
,
final int
number of steps of the method excluding the one being computed
nSteps
,
final int
order of the method
order
,
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
)

Build an Adams integrator with the given order and step control parameters.

public
AdamsIntegrator(final String
name of the method
name
,
final int
number of steps of the method excluding the one being computed
nSteps
,
final int
order of the method
order
,
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
)

Build an Adams integrator with the given order and step control parameters.

Method Summary

Modifier and TypeMethod and Description
protected Array2DRowRealMatrix
initializeHighOrderDerivatives(final double
step size to use for scaling
h
,
final double[]
first steps times
t
,
final double[][]
first steps states
y
,
final double[][]
first steps derivatives
yDot
)

Implements abstract org.apache.commons.math3.ode.MultistepIntegrator.initializeHighOrderDerivatives.

Initialize the high order scaled derivatives at step start.

public abstract void
integrate(final ExpandableStatefulODE
complete set of differential equations to integrate
equations
,
final double
target time for the integration (can be set to a value smaller than t0 for backward integration)
t
)

Implements abstract org.apache.commons.math3.ode.nonstiff.AdaptiveStepsizeIntegrator.integrate.

Integrate a set of differential equations up to the given time.

public Array2DRowRealMatrix

Returns:

updated high order derivatives
updateHighOrderDerivativesPhase1
(final Array2DRowRealMatrix
high order scaled derivatives (h2/2 y'', ... hk/k! y(k))
highOrder
)

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

public void
updateHighOrderDerivativesPhase2(final double[]
first order scaled derivatives at step start
start
,
final double[]
first order scaled derivatives at step end
end
,
final Array2DRowRealMatrix
high order scaled derivatives, will be modified (h2/2 y'', ... hk/k! y(k))
highOrder
)

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

Inherited from org.apache.commons.math3.ode.MultistepIntegrator:
computeStepGrowShrinkFactorgetMaxGrowthgetMinReductiongetNStepsgetSafetygetStarterIntegratorsetMaxGrowthsetMinReductionsetSafetysetStarterIntegratorstart

Field Detail

transformerback to summary
private final AdamsNordsieckTransformer transformer

Transformer.

Constructor Detail

AdamsIntegratorback to summary
public AdamsIntegrator(final String name, final int nSteps, final int order, final double minStep, final double maxStep, final double scalAbsoluteTolerance, final double scalRelativeTolerance) throws NumberIsTooSmallException

Build an Adams integrator with the given order and step control parameters.

Parameters
name:String

name of the method

nSteps:int

number of steps of the method excluding the one being computed

order:int

order of the method

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

Exceptions
NumberIsTooSmallException:
if order is 1 or less
AdamsIntegratorback to summary
public AdamsIntegrator(final String name, final int nSteps, final int order, final double minStep, final double maxStep, final double[] vecAbsoluteTolerance, final double[] vecRelativeTolerance) throws IllegalArgumentException

Build an Adams integrator with the given order and step control parameters.

Parameters
name:String

name of the method

nSteps:int

number of steps of the method excluding the one being computed

order:int

order of the method

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

Exceptions
IllegalArgumentException:
if order is 1 or less

Method Detail

initializeHighOrderDerivativesback to summary
protected Array2DRowRealMatrix initializeHighOrderDerivatives(final double h, final double[] t, final double[][] y, final double[][] yDot)

Implements abstract org.apache.commons.math3.ode.MultistepIntegrator.initializeHighOrderDerivatives.

Doc from org.apache.commons.math3.ode.MultistepIntegrator.initializeHighOrderDerivatives.

Initialize the high order scaled derivatives at step start.

Parameters
h:double

step size to use for scaling

t:double[]

first steps times

y:double[][]

first steps states

yDot:double[][]

first steps derivatives

Returns:Array2DRowRealMatrix

Nordieck vector at first step (h2/2 y''n, h3/6 y'''n ... hk/k! y(k)n)

Annotations
@Override
integrateback to summary
public abstract void integrate(final ExpandableStatefulODE equations, final double t) throws NumberIsTooSmallException, DimensionMismatchException, MaxCountExceededException, NoBracketingException

Implements abstract org.apache.commons.math3.ode.nonstiff.AdaptiveStepsizeIntegrator.integrate.

Doc from org.apache.commons.math3.ode.nonstiff.AdaptiveStepsizeIntegrator.integrate.

Integrate a set of differential equations up to the given time.

This method solves an Initial Value Problem (IVP).

The set of differential equations is composed of a main set, which can be extended by some sets of secondary equations. The set of equations must be already set up with initial time and partial states. At integration completion, the final time and partial states will be available in the same object.

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

Parameters
equations:ExpandableStatefulODE

Doc from org.apache.commons.math3.ode.AbstractIntegrator.integrate.

complete set of differential equations to integrate

t:double

Doc from org.apache.commons.math3.ode.AbstractIntegrator.integrate.

target time for the integration (can be set to a value smaller than t0 for backward integration)

Annotations
@Override
Exceptions
NumberIsTooSmallException:

Doc from org.apache.commons.math3.ode.AbstractIntegrator.integrate.

if integration step is too small

DimensionMismatchException:

Doc from org.apache.commons.math3.ode.AbstractIntegrator.integrate.

if the dimension of the complete state does not match the complete equations sets dimension

MaxCountExceededException:

Doc from org.apache.commons.math3.ode.AbstractIntegrator.integrate.

if the number of functions evaluations is exceeded

NoBracketingException:

Doc from org.apache.commons.math3.ode.AbstractIntegrator.integrate.

if the location of an event cannot be bracketed

updateHighOrderDerivativesPhase1back to summary
public Array2DRowRealMatrix updateHighOrderDerivativesPhase1(final Array2DRowRealMatrix 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:Array2DRowRealMatrix

high order scaled derivatives (h2/2 y'', ... hk/k! y(k))

Returns:Array2DRowRealMatrix

updated high order derivatives

See Also
updateHighOrderDerivativesPhase2(double[], double[], Array2DRowRealMatrix)
updateHighOrderDerivativesPhase2back to summary
public void updateHighOrderDerivativesPhase2(final double[] start, final double[] end, final Array2DRowRealMatrix 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:double[]

first order scaled derivatives at step start

end:double[]

first order scaled derivatives at step end

highOrder:Array2DRowRealMatrix

high order scaled derivatives, will be modified (h2/2 y'', ... hk/k! y(k))

See Also
updateHighOrderDerivativesPhase1(Array2DRowRealMatrix)