|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math.ode.sampling.AbstractStepInterpolator
org.apache.commons.math.ode.nonstiff.GraggBulirschStoerStepInterpolator
class GraggBulirschStoerStepInterpolator
This class implements an interpolator for the Gragg-Bulirsch-Stoer integrator.
This interpolator compute dense output inside the last step produced by a Gragg-Bulirsch-Stoer integrator.
This implementation is basically a reimplementation in Java of the odex fortran code by E. Hairer and G. Wanner. The redistribution policy for this code is available here, for convenience, it is reproduced below.
Copyright (c) 2004, Ernst Hairer |
Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the following
conditions are met:
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
GraggBulirschStoerIntegrator
Field Summary | |
---|---|
private int |
currentDegree
Degree of the interpolation polynoms. |
private double[] |
errfac
Error coefficients for the interpolation. |
private double[][] |
polynoms
Interpolation polynoms. |
private static long |
serialVersionUID
Serializable version identifier. |
private double[] |
y0Dot
Slope at the beginning of the step. |
private double[] |
y1
State at the end of the step. |
private double[] |
y1Dot
Slope at the end of the step. |
private double[][] |
yMidDots
Derivatives at the middle of the step. |
Fields inherited from class org.apache.commons.math.ode.sampling.AbstractStepInterpolator |
---|
currentState, currentTime, h, interpolatedDerivatives, interpolatedState, interpolatedTime, previousTime |
Constructor Summary | |
---|---|
GraggBulirschStoerStepInterpolator()
Simple constructor. |
|
GraggBulirschStoerStepInterpolator(double[] y,
double[] y0Dot,
double[] y1,
double[] y1Dot,
double[][] yMidDots,
boolean forward)
Simple constructor. |
|
GraggBulirschStoerStepInterpolator(GraggBulirschStoerStepInterpolator interpolator)
Copy constructor. |
Method Summary | |
---|---|
void |
computeCoefficients(int mu,
double h)
Compute the interpolation coefficients for dense output. |
protected void |
computeInterpolatedStateAndDerivatives(double theta,
double oneMinusThetaH)
Compute the state and derivatives at the interpolated time. |
protected StepInterpolator |
doCopy()
Really copy the finalized instance. |
double |
estimateError(double[] scale)
Estimate interpolation error. |
void |
readExternal(java.io.ObjectInput in)
|
private void |
resetTables(int maxDegree)
Reallocate the internal tables. |
void |
writeExternal(java.io.ObjectOutput out)
|
Methods inherited from class org.apache.commons.math.ode.sampling.AbstractStepInterpolator |
---|
copy, doFinalize, finalizeStep, getCurrentTime, getInterpolatedDerivatives, 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 |
Field Detail |
---|
private static final long serialVersionUID
private double[] y0Dot
private double[] y1
private double[] y1Dot
private double[][] yMidDots
private double[][] polynoms
private double[] errfac
private int currentDegree
Constructor Detail |
---|
public GraggBulirschStoerStepInterpolator()
public GraggBulirschStoerStepInterpolator(double[] y, double[] y0Dot, double[] y1, double[] y1Dot, double[][] yMidDots, boolean forward)
y
- reference to the integrator array holding the current statey0Dot
- reference to the integrator array holding the slope
at the beginning of the stepy1
- reference to the integrator array holding the state at
the end of the stepy1Dot
- reference to the integrator array holding the slope
at the end of the stepyMidDots
- reference to the integrator array holding the
derivatives at the middle point of the stepforward
- integration direction indicatorpublic GraggBulirschStoerStepInterpolator(GraggBulirschStoerStepInterpolator interpolator)
interpolator
- interpolator to copy from. The copy is a deep
copy: its arrays are separated from the original arrays of the
instanceMethod Detail |
---|
private void resetTables(int maxDegree)
maxDegree
- maximal degree to handleprotected 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
public void computeCoefficients(int mu, double h)
mu
- degree of the interpolation polynomialh
- current steppublic double estimateError(double[] scale)
scale
- scaling array
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 time
DerivativeException
- this exception is propagated to the caller if the
underlying user function triggers onepublic void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
writeExternal
in class AbstractStepInterpolator
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException
readExternal
in interface java.io.Externalizable
readExternal
in class AbstractStepInterpolator
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |