org.apache.commons.math.ode
Class ClassicalRungeKuttaStepInterpolator
java.lang.Object
org.apache.commons.math.ode.AbstractStepInterpolator
org.apache.commons.math.ode.RungeKuttaStepInterpolator
org.apache.commons.math.ode.ClassicalRungeKuttaStepInterpolator
- All Implemented Interfaces:
- java.io.Externalizable, java.io.Serializable, StepInterpolator
class ClassicalRungeKuttaStepInterpolator
- extends RungeKuttaStepInterpolator
This class implements a step interpolator for the classical fourth
order Runge-Kutta integrator.
This interpolator allows to compute 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/6) [ (-4 theta^2 + 5 theta - 1) y'_1
+(4 theta^2 - 2 theta - 2) (y'_2 + y'_3)
-(4 theta^2 + theta + 1) y'_4
]
where theta belongs to [0 ; 1] and where y'_1 to y'_4 are the four
evaluations of the derivatives already computed during the
step.
- Since:
- 1.2
- Version:
- $Revision: 620312 $ $Date: 2008-02-10 12:28:59 -0700 (Sun, 10 Feb 2008) $
- See Also:
ClassicalRungeKuttaIntegrator
Field Summary |
private static long |
serialVersionUID
Serializable version identifier |
Methods inherited from class org.apache.commons.math.ode.AbstractStepInterpolator |
copy, doFinalize, finalizeStep, getCurrentTime, getInterpolatedState, getInterpolatedTime, getPreviousTime, isForward, readBaseExternal, reinitialize, setInterpolatedTime, shift, storeTime, writeBaseExternal |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
serialVersionUID
private static final long serialVersionUID
- Serializable version identifier
- See Also:
- Constant Field Values
ClassicalRungeKuttaStepInterpolator
public ClassicalRungeKuttaStepInterpolator()
- Simple constructor.
This constructor builds an instance that is not usable yet, the
RungeKuttaStepInterpolator.reinitialize(org.apache.commons.math.ode.FirstOrderDifferentialEquations, double[], 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 latter initializing
the copy.
ClassicalRungeKuttaStepInterpolator
public ClassicalRungeKuttaStepInterpolator(ClassicalRungeKuttaStepInterpolator 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
doCopy
protected StepInterpolator doCopy()
- Really copy the finalized instance.
- Specified by:
doCopy
in class AbstractStepInterpolator
- Returns:
- a copy of the finalized instance
computeInterpolatedState
protected void computeInterpolatedState(double theta,
double oneMinusThetaH)
throws DerivativeException
- Compute the state at the interpolated time.
This is the main processing method that should be implemented by
the derived classes to perform the interpolation.
- Specified by:
computeInterpolatedState
in class AbstractStepInterpolator
- Parameters:
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 time
- Throws:
DerivativeException
- this exception is propagated to the caller if the
underlying user function triggers one