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

pack-priv abstract Class RungeKuttaStepInterpolator

extends AbstractStepInterpolator
Class Inheritance
Known Direct Subclasses
org.apache.commons.math3.ode.nonstiff.ThreeEighthesStepInterpolator, org.apache.commons.math3.ode.nonstiff.DormandPrince853StepInterpolator, org.apache.commons.math3.ode.nonstiff.EulerStepInterpolator, org.apache.commons.math3.ode.nonstiff.GillStepInterpolator, org.apache.commons.math3.ode.nonstiff.ClassicalRungeKuttaStepInterpolator, org.apache.commons.math3.ode.nonstiff.DormandPrince54StepInterpolator, org.apache.commons.math3.ode.nonstiff.HighamHall54StepInterpolator, org.apache.commons.math3.ode.nonstiff.LutherStepInterpolator, org.apache.commons.math3.ode.nonstiff.MidpointStepInterpolator
Imports
java.io.IOException, .ObjectInput, .ObjectOutput, org.apache.commons.math3.ode.AbstractIntegrator, .EquationsMapper, org.apache.commons.math3.ode.sampling.AbstractStepInterpolator

This class represents an interpolator over the last step during an ODE integration for Runge-Kutta and embedded Runge-Kutta integrators.
Since
1.2
See Also
RungeKuttaIntegrator, EmbeddedRungeKuttaIntegrator

Field Summary

Modifier and TypeField and Description
protected AbstractIntegrator
integrator

Reference to the integrator.

protected double[]
previousState

Previous state.

protected double[][]
yDotK

Slopes at the intermediate points

Inherited from org.apache.commons.math3.ode.sampling.AbstractStepInterpolator:
currentStatehinterpolatedDerivativesinterpolatedPrimaryDerivativesinterpolatedPrimaryStateinterpolatedSecondaryDerivativesinterpolatedSecondaryStateinterpolatedStateinterpolatedTime

Constructor Summary

AccessConstructor and Description
protected
RungeKuttaStepInterpolator()

Simple constructor.

pack-priv
RungeKuttaStepInterpolator(final RungeKuttaStepInterpolator
interpolator to copy from.
interpolator
)

Copy constructor.

Method Summary

Modifier and TypeMethod and Description
public void
readExternal(final ObjectInput
the stream to read data from in order to restore the object
in
)

Implements abstract org.apache.commons.math3.ode.sampling.AbstractStepInterpolator.readExternal.

Implements java.io.Externalizable.readExternal.

The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays.

public void
reinitialize(final AbstractIntegrator
integrator being used
rkIntegrator
,
final double[]
reference to the integrator array holding the state at the end of the step
y
,
final double[][]
reference to the integrator array holding all the intermediate slopes
yDotArray
,
final boolean
integration direction indicator
forward
,
final EquationsMapper
equations mapper for the primary equations set
primaryMapper
,
final EquationsMapper[]
equations mappers for the secondary equations sets
secondaryMappers
)

Reinitialize the instance

Some Runge-Kutta integrators need fewer functions evaluations than their counterpart step interpolators.

public void
public void
writeExternal(final ObjectOutput
the stream to write the object to
out
)

Implements abstract org.apache.commons.math3.ode.sampling.AbstractStepInterpolator.writeExternal.

Implements java.io.Externalizable.writeExternal.

The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Inherited from org.apache.commons.math3.ode.sampling.AbstractStepInterpolator:
computeInterpolatedStateAndDerivativescopydoCopydoFinalizefinalizeStepgetCurrentTimegetGlobalCurrentTimegetGlobalPreviousTimegetInterpolatedDerivativesgetInterpolatedSecondaryDerivativesgetInterpolatedSecondaryStategetInterpolatedStategetInterpolatedTimegetPreviousTimeisForwardreadBaseExternalreinitializesetInterpolatedTimesetSoftCurrentTimesetSoftPreviousTimestoreTimewriteBaseExternal

Field Detail

integratorback to summary
protected AbstractIntegrator integrator

Reference to the integrator.

previousStateback to summary
protected double[] previousState

Previous state.

yDotKback to summary
protected double[][] yDotK

Slopes at the intermediate points

Constructor Detail

RungeKuttaStepInterpolatorback to summary
protected RungeKuttaStepInterpolator()

Simple constructor. This constructor builds an instance that is not usable yet, the reinitialize 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 RungeKuttaIntegrator and EmbeddedRungeKuttaIntegrator classes use the prototyping design pattern to create the step interpolators by cloning an uninitialized model and latter initializing the copy.

RungeKuttaStepInterpolatorback to summary
pack-priv RungeKuttaStepInterpolator(final RungeKuttaStepInterpolator interpolator)

Copy constructor.

The copied interpolator should have been finalized before the copy, otherwise the copy will not be able to perform correctly any interpolation and will throw a NullPointerException later. Since we don't want this constructor to throw the exceptions finalization may involve and since we don't want this method to modify the state of the copied interpolator, finalization is not done automatically, it remains under user control.

The copy is a deep copy: its arrays are separated from the original arrays of the instance.

Parameters
interpolator:RungeKuttaStepInterpolator

interpolator to copy from.

Method Detail

readExternalback to summary
public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException

Implements abstract org.apache.commons.math3.ode.sampling.AbstractStepInterpolator.readExternal.

Implements java.io.Externalizable.readExternal.

Doc from org.apache.commons.math3.ode.sampling.AbstractStepInterpolator.readExternal.

The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. The readExternal method must read the values in the same sequence and with the same types as were written by writeExternal.

Parameters
in:ObjectInput

Doc from java.io.Externalizable.readExternal.

the stream to read data from in order to restore the object

Annotations
@Override
Exceptions
IOException:

Doc from java.io.Externalizable.readExternal.

if I/O errors occur

ClassNotFoundException:

Doc from java.io.Externalizable.readExternal.

If the class for an object being restored cannot be found.

reinitializeback to summary
public void reinitialize(final AbstractIntegrator rkIntegrator, final double[] y, final double[][] yDotArray, final boolean forward, final EquationsMapper primaryMapper, final EquationsMapper[] secondaryMappers)

Reinitialize the instance

Some Runge-Kutta integrators need fewer functions evaluations than their counterpart step interpolators. So the interpolator should perform the last evaluations they need by themselves. The RungeKuttaIntegrator and EmbeddedRungeKuttaIntegrator abstract classes call this method in order to let the step interpolator perform the evaluations it needs. These evaluations will be performed during the call to doFinalize if any, i.e. only if the step handler either calls the finalizeStep method or the getInterpolatedState method (for an interpolator which needs a finalization) or if it clones the step interpolator.

Parameters
rkIntegrator:AbstractIntegrator

integrator being used

y:double[]

reference to the integrator array holding the state at the end of the step

yDotArray:double[][]

reference to the integrator array holding all the intermediate slopes

forward:boolean

integration direction indicator

primaryMapper:EquationsMapper

equations mapper for the primary equations set

secondaryMappers:EquationsMapper[]

equations mappers for the secondary equations sets

shiftback to summary
public void shift()

Overrides org.apache.commons.math3.ode.sampling.AbstractStepInterpolator.shift.

Doc from org.apache.commons.math3.ode.sampling.AbstractStepInterpolator.shift.

Shift one step forward. Copy the current time into the previous time, hence preparing the interpolator for future calls to storeTime

Annotations
@Override
writeExternalback to summary
public void writeExternal(final ObjectOutput out) throws IOException

Implements abstract org.apache.commons.math3.ode.sampling.AbstractStepInterpolator.writeExternal.

Implements java.io.Externalizable.writeExternal.

Doc from org.apache.commons.math3.ode.sampling.AbstractStepInterpolator.writeExternal.

The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Parameters
out:ObjectOutput

Doc from java.io.Externalizable.writeExternal.

the stream to write the object to

Annotations
@Override
Exceptions
IOException:

Doc from java.io.Externalizable.writeExternal.

Includes any I/O exceptions that may occur