org.apache.commons.math.ode.nonstiff
class MidpointStepInterpolator extends RungeKuttaStepInterpolator
This interpolator computes dense output inside the last step computed. The interpolation equation is consistent with the integration scheme :
y(t_n + theta h) = y (t_n + h) + (1-theta) h [theta y'_1 - (1+theta) y'_2]where theta belongs to [0 ; 1] and where y'_1 and y'_2 are the two evaluations of the derivatives already computed during the step.
MidpointIntegrator
Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID
Serializable version identifier
|
integrator, yDotK
currentState, h, interpolatedDerivatives, interpolatedState, interpolatedTime
Constructor and Description |
---|
MidpointStepInterpolator()
Simple constructor.
|
MidpointStepInterpolator(MidpointStepInterpolator interpolator)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
computeInterpolatedStateAndDerivatives(double theta,
double oneMinusThetaH)
Compute the state and derivatives at the interpolated time.
|
protected StepInterpolator |
doCopy()
Really copy the finalized instance.
|
readExternal, reinitialize, writeExternal
copy, doFinalize, finalizeStep, getCurrentTime, getGlobalCurrentTime, getGlobalPreviousTime, getInterpolatedDerivatives, getInterpolatedState, getInterpolatedTime, getPreviousTime, isForward, readBaseExternal, reinitialize, setInterpolatedTime, setSoftCurrentTime, setSoftPreviousTime, shift, storeTime, writeBaseExternal
private static final long serialVersionUID
public MidpointStepInterpolator()
AbstractStepInterpolator.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. The RungeKuttaIntegrator
class uses the prototyping design pattern
to create the step interpolators by cloning an uninitialized model
and later initializing the copy.public MidpointStepInterpolator(MidpointStepInterpolator interpolator)
interpolator
- interpolator to copy from. The copy is a deep
copy: its arrays are separated from the original arrays of the
instanceprotected StepInterpolator doCopy()
This method is called by AbstractStepInterpolator.copy()
after the
step has been finalized. It must perform a deep copy
to have an new instance completely independent for the
original instance.
doCopy
in class AbstractStepInterpolator
protected void computeInterpolatedStateAndDerivatives(double theta, double oneMinusThetaH) throws DerivativeException
computeInterpolatedStateAndDerivatives
in class AbstractStepInterpolator
theta
- normalized interpolation abscissa within the step
(theta is zero at the previous time step and one at the current time step)oneMinusThetaH
- time gap between the interpolated time and
the current timeDerivativeException
- this exception is propagated to the caller if the
underlying user function triggers oneCopyright (c) 2003-2013 Apache Software Foundation