Class NordsieckStepInterpolator
- java.lang.Object
-
- org.apache.commons.math.ode.sampling.AbstractStepInterpolator
-
- org.apache.commons.math.ode.sampling.NordsieckStepInterpolator
-
- All Implemented Interfaces:
java.io.Externalizable
,java.io.Serializable
,StepInterpolator
public class NordsieckStepInterpolator extends AbstractStepInterpolator
This class implements an interpolator for integrators using Nordsieck representation.This interpolator computes dense output around the current point. The interpolation equation is based on Taylor series formulas.
- Since:
- 2.0
- See Also:
AdamsBashforthIntegrator
,AdamsMoultonIntegrator
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NordsieckStepInterpolator()
Simple constructor.NordsieckStepInterpolator(NordsieckStepInterpolator interpolator)
Copy constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double[]
getInterpolatedStateVariation()
Get the state vector variation from current to interpolated state.void
readExternal(java.io.ObjectInput in)
void
reinitialize(double[] y, boolean forward)
Reinitialize the instance.void
reinitialize(double time, double stepSize, double[] scaledDerivative, Array2DRowRealMatrix nordsieckVector)
Reinitialize the instance.void
rescale(double stepSize)
Rescale the instance.void
writeExternal(java.io.ObjectOutput out)
-
Methods inherited from class org.apache.commons.math.ode.sampling.AbstractStepInterpolator
copy, finalizeStep, getCurrentTime, getGlobalCurrentTime, getGlobalPreviousTime, getInterpolatedDerivatives, getInterpolatedState, getInterpolatedTime, getPreviousTime, isForward, setInterpolatedTime, setSoftCurrentTime, setSoftPreviousTime, shift, storeTime
-
-
-
-
Constructor Detail
-
NordsieckStepInterpolator
public NordsieckStepInterpolator()
Simple constructor. This constructor builds an instance that is not usable yet, theAbstractStepInterpolator.reinitialize(double[], boolean)
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.
-
NordsieckStepInterpolator
public NordsieckStepInterpolator(NordsieckStepInterpolator interpolator)
Copy constructor.- Parameters:
interpolator
- interpolator to copy from. The copy is a deep copy: its arrays are separated from the original arrays of the instance
-
-
Method Detail
-
reinitialize
public void reinitialize(double[] y, boolean forward)
Reinitialize the instance.Beware that all arrays must be references to integrator arrays, in order to ensure proper update without copy.
- Parameters:
y
- reference to the integrator array holding the state at the end of the stepforward
- integration direction indicator
-
reinitialize
public void reinitialize(double time, double stepSize, double[] scaledDerivative, Array2DRowRealMatrix nordsieckVector)
Reinitialize the instance.Beware that all arrays must be references to integrator arrays, in order to ensure proper update without copy.
- Parameters:
time
- time at which all arrays are definedstepSize
- step size used in the scaled and nordsieck arraysscaledDerivative
- reference to the integrator array holding the first scaled derivativenordsieckVector
- reference to the integrator matrix holding the nordsieck vector
-
rescale
public void rescale(double stepSize)
Rescale the instance.Since the scaled and Nordiseck arrays are shared with the caller, this method has the side effect of rescaling this arrays in the caller too.
- Parameters:
stepSize
- new step size to use in the scaled and nordsieck arrays
-
getInterpolatedStateVariation
public double[] getInterpolatedStateVariation() throws DerivativeException
Get the state vector variation from current to interpolated state.This method is aimed at computing y(tinterpolation) -y(tcurrent) accurately by avoiding the cancellation errors that would occur if the subtraction were performed explicitly.
The returned vector is a reference to a reused array, so it should not be modified and it should be copied if it needs to be preserved across several calls.
- Returns:
- state vector at time
AbstractStepInterpolator.getInterpolatedTime()
- Throws:
DerivativeException
- if this call induces an automatic step finalization that throws one- See Also:
AbstractStepInterpolator.getInterpolatedDerivatives()
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
- Specified by:
writeExternal
in interfacejava.io.Externalizable
- Specified by:
writeExternal
in classAbstractStepInterpolator
- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
- Specified by:
readExternal
in interfacejava.io.Externalizable
- Specified by:
readExternal
in classAbstractStepInterpolator
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
-
-