Class GillStepInterpolator
- java.lang.Object
-
- org.apache.commons.math3.ode.sampling.AbstractStepInterpolator
-
- org.apache.commons.math3.ode.nonstiff.RungeKuttaStepInterpolator
-
- org.apache.commons.math3.ode.nonstiff.GillStepInterpolator
-
- All Implemented Interfaces:
java.io.Externalizable
,java.io.Serializable
,StepInterpolator
class GillStepInterpolator extends RungeKuttaStepInterpolator
This class implements a step interpolator for the Gill 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 :
- Using reference point at step start:
y(tn + θ h) = y (tn) + θ (h/6) [ (6 - 9 θ + 4 θ2) y'1 + ( 6 θ - 4 θ2) ((1-1/√2) y'2 + (1+1/√2)) y'3) + ( - 3 θ + 4 θ2) y'4 ] - Using reference point at step start:
y(tn + θ h) = y (tn + h) - (1 - θ) (h/6) [ (1 - 5 θ + 4 θ2) y'1 + (2 + 2 θ - 4 θ2) ((1-1/√2) y'2 + (1+1/√2)) y'3) + (1 + θ + 4 θ2) y'4 ]
- Since:
- 1.2
- See Also:
GillIntegrator
-
-
Field Summary
Fields Modifier and Type Field Description private static double
ONE_MINUS_INV_SQRT_2
First Gill coefficient.private static double
ONE_PLUS_INV_SQRT_2
Second Gill coefficient.private static long
serialVersionUID
Serializable version identifier.-
Fields inherited from class org.apache.commons.math3.ode.nonstiff.RungeKuttaStepInterpolator
integrator, previousState, yDotK
-
Fields inherited from class org.apache.commons.math3.ode.sampling.AbstractStepInterpolator
currentState, h, interpolatedDerivatives, interpolatedPrimaryDerivatives, interpolatedPrimaryState, interpolatedSecondaryDerivatives, interpolatedSecondaryState, interpolatedState, interpolatedTime
-
-
Constructor Summary
Constructors Constructor Description GillStepInterpolator()
Simple constructor.GillStepInterpolator(GillStepInterpolator interpolator)
Copy constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.-
Methods inherited from class org.apache.commons.math3.ode.nonstiff.RungeKuttaStepInterpolator
readExternal, reinitialize, shift, writeExternal
-
Methods inherited from class org.apache.commons.math3.ode.sampling.AbstractStepInterpolator
copy, doFinalize, finalizeStep, getCurrentTime, getGlobalCurrentTime, getGlobalPreviousTime, getInterpolatedDerivatives, getInterpolatedSecondaryDerivatives, getInterpolatedSecondaryState, getInterpolatedState, getInterpolatedTime, getPreviousTime, isForward, readBaseExternal, reinitialize, setInterpolatedTime, setSoftCurrentTime, setSoftPreviousTime, storeTime, writeBaseExternal
-
-
-
-
Field Detail
-
ONE_MINUS_INV_SQRT_2
private static final double ONE_MINUS_INV_SQRT_2
First Gill coefficient.
-
ONE_PLUS_INV_SQRT_2
private static final double ONE_PLUS_INV_SQRT_2
Second Gill coefficient.
-
serialVersionUID
private static final long serialVersionUID
Serializable version identifier.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GillStepInterpolator
public GillStepInterpolator()
Simple constructor. This constructor builds an instance that is not usable yet, theAbstractStepInterpolator.reinitialize(double[], boolean, org.apache.commons.math3.ode.EquationsMapper, org.apache.commons.math3.ode.EquationsMapper[])
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. TheRungeKuttaIntegrator
class uses the prototyping design pattern to create the step interpolators by cloning an uninitialized model and later initializing the copy.
-
GillStepInterpolator
GillStepInterpolator(GillStepInterpolator 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
-
doCopy
protected StepInterpolator doCopy()
Really copy the finalized instance.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.- Specified by:
doCopy
in classAbstractStepInterpolator
- Returns:
- a copy of the finalized instance
-
computeInterpolatedStateAndDerivatives
protected void computeInterpolatedStateAndDerivatives(double theta, double oneMinusThetaH)
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.- Specified by:
computeInterpolatedStateAndDerivatives
in classAbstractStepInterpolator
- 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
-
-