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

pack-priv Class AdamsFieldStepInterpolator<T extends RealFieldElement<T>>

extends AbstractFieldStepInterpolator<T extends RealFieldElement<T>>
Class Inheritance
Type Parameters
<T>
the type of the field elements
Imports
java.util.Arrays, org.apache.commons.math3.RealFieldElement, org.apache.commons.math3.linear.Array2DRowFieldMatrix, org.apache.commons.math3.ode.FieldEquationsMapper, .FieldODEStateAndDerivative, org.apache.commons.math3.ode.sampling.AbstractFieldStepInterpolator, org.apache.commons.math3.util.MathArrays

This class implements an interpolator for Adams integrators using Nordsieck representation.

This interpolator computes dense output around the current point. The interpolation equation is based on Taylor series formulas.

Since
3.6
See Also
AdamsBashforthFieldIntegrator, AdamsMoultonFieldIntegrator

Field Summary

Modifier and TypeField and Description
private final Array2DRowFieldMatrix<T>
nordsieck

Nordsieck vector.

private final FieldODEStateAndDerivative<T>
reference

Reference state.

private final T[]
scaled

First scaled derivative.

private T
scalingH

Step size used in the first scaled derivative and Nordsieck vector.

Constructor Summary

AccessConstructor and Description
pack-priv
AdamsFieldStepInterpolator(final T
step size used in the scaled and Nordsieck arrays
stepSize
,
final FieldODEStateAndDerivative<T>
reference state from which Taylor expansion are estimated
reference
,
final T[]
first scaled derivative
scaled
,
final Array2DRowFieldMatrix<T>
Nordsieck vector
nordsieck
,
final boolean
integration direction indicator
isForward
,
final FieldODEStateAndDerivative<T>
start of the global step
globalPreviousState
,
final FieldODEStateAndDerivative<T>
end of the global step
globalCurrentState
,
final FieldEquationsMapper<T>
mapper for ODE equations primary and secondary components
equationsMapper
)

Simple constructor.

private
AdamsFieldStepInterpolator(final T
step size used in the scaled and Nordsieck arrays
stepSize
,
final FieldODEStateAndDerivative<T>
reference state from which Taylor expansion are estimated
reference
,
final T[]
first scaled derivative
scaled
,
final Array2DRowFieldMatrix<T>
Nordsieck vector
nordsieck
,
final boolean
integration direction indicator
isForward
,
final FieldODEStateAndDerivative<T>
start of the global step
globalPreviousState
,
final FieldODEStateAndDerivative<T>
end of the global step
globalCurrentState
,
final FieldODEStateAndDerivative<T>
start of the restricted step
softPreviousState
,
final FieldODEStateAndDerivative<T>
end of the restricted step
softCurrentState
,
final FieldEquationsMapper<T>
mapper for ODE equations primary and secondary components
equationsMapper
)

Simple constructor.

Method Summary

Modifier and TypeMethod and Description
protected FieldODEStateAndDerivative<T>
computeInterpolatedStateAndDerivatives(final FieldEquationsMapper<T>
mapper for ODE equations primary and secondary components
equationsMapper
,
final T
interpolation time
time
,
final T
normalized interpolation abscissa within the step (theta is zero at the previous time step and one at the current time step)
theta
,
final T
time gap between the previous time and the interpolated time
thetaH
,
final T
time gap between the interpolated time and the current time
oneMinusThetaH
)

Implements abstract org.apache.commons.math3.ode.sampling.AbstractFieldStepInterpolator.computeInterpolatedStateAndDerivatives.

Compute the state and derivatives at the interpolated time.

protected AdamsFieldStepInterpolator<T>

Returns:

a new instance
create
(boolean
integration direction indicator
newForward
,
FieldODEStateAndDerivative<T>
start of the global step
newGlobalPreviousState
,
FieldODEStateAndDerivative<T>
end of the global step
newGlobalCurrentState
,
FieldODEStateAndDerivative<T>
start of the restricted step
newSoftPreviousState
,
FieldODEStateAndDerivative<T>
end of the restricted step
newSoftCurrentState
,
FieldEquationsMapper<T>
equations mapper for the all equations
newMapper
)

Implements abstract org.apache.commons.math3.ode.sampling.AbstractFieldStepInterpolator.create.

Create a new instance.

public static <
the type of the field elements
S extends RealFieldElement<S>
>
FieldODEStateAndDerivative<S>

Returns:

estimated state
taylor
(final FieldODEStateAndDerivative<S>
reference state
reference
,
final S
time at which state must be estimated
time
,
final S
step size used in the scaled and Nordsieck arrays
stepSize
,
final S[]
first scaled derivative
scaled
,
final Array2DRowFieldMatrix<S>
Nordsieck vector
nordsieck
)

Estimate state by applying Taylor formula.

Inherited from org.apache.commons.math3.ode.sampling.AbstractFieldStepInterpolator:
getCurrentStategetGlobalCurrentStategetGlobalPreviousStategetInterpolatedStategetPreviousStateisForwardrestrictStep

Field Detail

nordsieckback to summary
private final Array2DRowFieldMatrix<T> nordsieck

Nordsieck vector.

referenceback to summary
private final FieldODEStateAndDerivative<T> reference

Reference state.

Sometimes, the reference state is the same as globalPreviousState, sometimes it is the same as globalCurrentState, so we use a separate field to avoid any confusion.

scaledback to summary
private final T[] scaled

First scaled derivative.

scalingHback to summary
private T scalingH

Step size used in the first scaled derivative and Nordsieck vector.

Constructor Detail

AdamsFieldStepInterpolatorback to summary
pack-priv AdamsFieldStepInterpolator(final T stepSize, final FieldODEStateAndDerivative<T> reference, final T[] scaled, final Array2DRowFieldMatrix<T> nordsieck, final boolean isForward, final FieldODEStateAndDerivative<T> globalPreviousState, final FieldODEStateAndDerivative<T> globalCurrentState, final FieldEquationsMapper<T> equationsMapper)

Simple constructor.

Parameters
stepSize:T

step size used in the scaled and Nordsieck arrays

reference:FieldODEStateAndDerivative<T>

reference state from which Taylor expansion are estimated

scaled:T[]

first scaled derivative

nordsieck:Array2DRowFieldMatrix<T>

Nordsieck vector

isForward:boolean

integration direction indicator

globalPreviousState:FieldODEStateAndDerivative<T>

start of the global step

globalCurrentState:FieldODEStateAndDerivative<T>

end of the global step

equationsMapper:FieldEquationsMapper<T>

mapper for ODE equations primary and secondary components

AdamsFieldStepInterpolatorback to summary
private AdamsFieldStepInterpolator(final T stepSize, final FieldODEStateAndDerivative<T> reference, final T[] scaled, final Array2DRowFieldMatrix<T> nordsieck, final boolean isForward, final FieldODEStateAndDerivative<T> globalPreviousState, final FieldODEStateAndDerivative<T> globalCurrentState, final FieldODEStateAndDerivative<T> softPreviousState, final FieldODEStateAndDerivative<T> softCurrentState, final FieldEquationsMapper<T> equationsMapper)

Simple constructor.

Parameters
stepSize:T

step size used in the scaled and Nordsieck arrays

reference:FieldODEStateAndDerivative<T>

reference state from which Taylor expansion are estimated

scaled:T[]

first scaled derivative

nordsieck:Array2DRowFieldMatrix<T>

Nordsieck vector

isForward:boolean

integration direction indicator

globalPreviousState:FieldODEStateAndDerivative<T>

start of the global step

globalCurrentState:FieldODEStateAndDerivative<T>

end of the global step

softPreviousState:FieldODEStateAndDerivative<T>

start of the restricted step

softCurrentState:FieldODEStateAndDerivative<T>

end of the restricted step

equationsMapper:FieldEquationsMapper<T>

mapper for ODE equations primary and secondary components

Method Detail

computeInterpolatedStateAndDerivativesback to summary
protected FieldODEStateAndDerivative<T> computeInterpolatedStateAndDerivatives(final FieldEquationsMapper<T> equationsMapper, final T time, final T theta, final T thetaH, final T oneMinusThetaH)

Implements abstract org.apache.commons.math3.ode.sampling.AbstractFieldStepInterpolator.computeInterpolatedStateAndDerivatives.

Doc from org.apache.commons.math3.ode.sampling.AbstractFieldStepInterpolator.computeInterpolatedStateAndDerivatives.

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.

Parameters
equationsMapper:FieldEquationsMapper<T>

mapper for ODE equations primary and secondary components

time:T

interpolation time

theta:T

normalized interpolation abscissa within the step (theta is zero at the previous time step and one at the current time step)

thetaH:T

time gap between the previous time and the interpolated time

oneMinusThetaH:T

time gap between the interpolated time and the current time

Returns:FieldODEStateAndDerivative<T>

interpolated state and derivatives

Annotations
@Override
createback to summary
protected AdamsFieldStepInterpolator<T> create(boolean newForward, FieldODEStateAndDerivative<T> newGlobalPreviousState, FieldODEStateAndDerivative<T> newGlobalCurrentState, FieldODEStateAndDerivative<T> newSoftPreviousState, FieldODEStateAndDerivative<T> newSoftCurrentState, FieldEquationsMapper<T> newMapper)

Implements abstract org.apache.commons.math3.ode.sampling.AbstractFieldStepInterpolator.create.

Create a new instance.

Parameters
newForward:boolean

integration direction indicator

newGlobalPreviousState:FieldODEStateAndDerivative<T>

start of the global step

newGlobalCurrentState:FieldODEStateAndDerivative<T>

end of the global step

newSoftPreviousState:FieldODEStateAndDerivative<T>

start of the restricted step

newSoftCurrentState:FieldODEStateAndDerivative<T>

end of the restricted step

newMapper:FieldEquationsMapper<T>

equations mapper for the all equations

Returns:AdamsFieldStepInterpolator<T>

a new instance

Annotations
@Override
taylorback to summary
public static <S extends RealFieldElement<S>> FieldODEStateAndDerivative<S> taylor(final FieldODEStateAndDerivative<S> reference, final S time, final S stepSize, final S[] scaled, final Array2DRowFieldMatrix<S> nordsieck)

Estimate state by applying Taylor formula.

Parameters
<S>
the type of the field elements
reference:FieldODEStateAndDerivative<S>

reference state

time:S

time at which state must be estimated

stepSize:S

step size used in the scaled and Nordsieck arrays

scaled:S[]

first scaled derivative

nordsieck:Array2DRowFieldMatrix<S>

Nordsieck vector

Returns:FieldODEStateAndDerivative<S>

estimated state