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

public abstract Class AbstractFieldStepInterpolator<T extends RealFieldElement<T>>

extends Object
implements FieldStepInterpolator<T extends RealFieldElement<T>>
Class Inheritance
All Implemented Interfaces
org.apache.commons.math3.ode.sampling.FieldStepInterpolator
Known Direct Subclasses
org.apache.commons.math3.ode.nonstiff.AdamsFieldStepInterpolator, org.apache.commons.math3.ode.nonstiff.RungeKuttaFieldStepInterpolator
Type Parameters
<T>
the type of the field elements
Imports
org.apache.commons.math3.RealFieldElement, org.apache.commons.math3.exception.MaxCountExceededException, org.apache.commons.math3.ode.FieldEquationsMapper, .FieldODEStateAndDerivative

This abstract class represents an interpolator over the last step during an ODE integration.

The various ODE integrators provide objects extending this class to the step handlers. The handlers can use these objects to retrieve the state vector at intermediate times between the previous and the current grid points (dense output).

Since
3.6
See Also
org.apache.commons.math3.ode.FirstOrderFieldIntegrator, StepHandler

Field Summary

Modifier and TypeField and Description
private final boolean
forward

integration direction.

private final FieldODEStateAndDerivative<T>
globalCurrentState

Global current state.

private final FieldODEStateAndDerivative<T>
globalPreviousState

Global previous state.

private FieldEquationsMapper<T>
mapper

Mapper for ODE equations primary and secondary components.

private final FieldODEStateAndDerivative<T>
softCurrentState

Soft current state.

private final FieldODEStateAndDerivative<T>
softPreviousState

Soft previous state.

Constructor Summary

AccessConstructor and Description
protected
AbstractFieldStepInterpolator(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 abstract FieldODEStateAndDerivative<T>

Returns:

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

Compute the state and derivatives at the interpolated time.

protected abstract AbstractFieldStepInterpolator<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
)

Create a new instance.

public FieldODEStateAndDerivative<T>
public FieldODEStateAndDerivative<T>

Returns:

current global grid point state
getGlobalCurrentState
()

Get the current global grid point state.

public FieldODEStateAndDerivative<T>

Returns:

previous global grid point state
getGlobalPreviousState
()

Get the previous global grid point state.

public FieldODEStateAndDerivative<T>
getInterpolatedState(final T
time of the interpolated point
time
)

Implements org.apache.commons.math3.ode.sampling.FieldStepInterpolator.getInterpolatedState.

Get the state at interpolated time.

public FieldODEStateAndDerivative<T>
public boolean
isForward()

Implements org.apache.commons.math3.ode.sampling.FieldStepInterpolator.isForward.

Check if the natural integration direction is forward.

public AbstractFieldStepInterpolator<T>

Returns:

restricted version of the instance
restrictStep
(final FieldODEStateAndDerivative<T>
start of the restricted step
previousState
,
final FieldODEStateAndDerivative<T>
end of the restricted step
currentState
)

Create a new restricted version of the instance.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

forwardback to summary
private final boolean forward

integration direction.

globalCurrentStateback to summary
private final FieldODEStateAndDerivative<T> globalCurrentState

Global current state.

globalPreviousStateback to summary
private final FieldODEStateAndDerivative<T> globalPreviousState

Global previous state.

mapperback to summary
private FieldEquationsMapper<T> mapper

Mapper for ODE equations primary and secondary components.

softCurrentStateback to summary
private final FieldODEStateAndDerivative<T> softCurrentState

Soft current state.

softPreviousStateback to summary
private final FieldODEStateAndDerivative<T> softPreviousState

Soft previous state.

Constructor Detail

AbstractFieldStepInterpolatorback to summary
protected AbstractFieldStepInterpolator(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
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 abstract FieldODEStateAndDerivative<T> computeInterpolatedStateAndDerivatives(FieldEquationsMapper<T> equationsMapper, T time, T theta, T thetaH, T 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.

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

Exceptions
MaxCountExceededException:
if the number of functions evaluations is exceeded
createback to summary
protected abstract AbstractFieldStepInterpolator<T> create(boolean newForward, FieldODEStateAndDerivative<T> newGlobalPreviousState, FieldODEStateAndDerivative<T> newGlobalCurrentState, FieldODEStateAndDerivative<T> newSoftPreviousState, FieldODEStateAndDerivative<T> newSoftCurrentState, FieldEquationsMapper<T> newMapper)

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:AbstractFieldStepInterpolator<T>

a new instance

getCurrentStateback to summary
public FieldODEStateAndDerivative<T> getCurrentState()

Implements org.apache.commons.math3.ode.sampling.FieldStepInterpolator.getCurrentState.

Doc from org.apache.commons.math3.ode.sampling.FieldStepInterpolator.getCurrentState.

Get the state at current grid point time.

Returns:FieldODEStateAndDerivative<T>

state at current grid point time

getGlobalCurrentStateback to summary
public FieldODEStateAndDerivative<T> getGlobalCurrentState()

Get the current global grid point state.

Returns:FieldODEStateAndDerivative<T>

current global grid point state

getGlobalPreviousStateback to summary
public FieldODEStateAndDerivative<T> getGlobalPreviousState()

Get the previous global grid point state.

Returns:FieldODEStateAndDerivative<T>

previous global grid point state

getInterpolatedStateback to summary
public FieldODEStateAndDerivative<T> getInterpolatedState(final T time)

Implements org.apache.commons.math3.ode.sampling.FieldStepInterpolator.getInterpolatedState.

Doc from org.apache.commons.math3.ode.sampling.FieldStepInterpolator.getInterpolatedState.

Get the state at interpolated time.

Setting the time outside of the current step is allowed, but should be used with care since the accuracy of the interpolator will probably be very poor far from this step. This allowance has been added to simplify implementation of search algorithms near the step endpoints.

Parameters
time:T

time of the interpolated point

Returns:FieldODEStateAndDerivative<T>

state at interpolated time

getPreviousStateback to summary
public FieldODEStateAndDerivative<T> getPreviousState()

Implements org.apache.commons.math3.ode.sampling.FieldStepInterpolator.getPreviousState.

Doc from org.apache.commons.math3.ode.sampling.FieldStepInterpolator.getPreviousState.

Get the state at previous grid point time.

Returns:FieldODEStateAndDerivative<T>

state at previous grid point time

isForwardback to summary
public boolean isForward()

Implements org.apache.commons.math3.ode.sampling.FieldStepInterpolator.isForward.

Doc from org.apache.commons.math3.ode.sampling.FieldStepInterpolator.isForward.

Check if the natural integration direction is forward.

This method provides the integration direction as specified by the integrator itself, it avoid some nasty problems in degenerated cases like null steps due to cancellation at step initialization, step control or discrete events triggering.

Returns:boolean

true if the integration variable (time) increases during integration

restrictStepback to summary
public AbstractFieldStepInterpolator<T> restrictStep(final FieldODEStateAndDerivative<T> previousState, final FieldODEStateAndDerivative<T> currentState)

Create a new restricted version of the instance.

The instance is not changed at all.

Parameters
previousState:FieldODEStateAndDerivative<T>

start of the restricted step

currentState:FieldODEStateAndDerivative<T>

end of the restricted step

Returns:AbstractFieldStepInterpolator<T>

restricted version of the instance

See Also
getPreviousState(), getCurrentState()