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
| Modifier and Type | Field and Description |
|---|---|
| private int | currentDegree
Degree of the interpolation polynomials. |
| private double[] | errfac
Error coefficients for the interpolation. |
| private double[][] | polynomials
Interpolation polynomials. |
| private static final 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. |
| Access | Constructor and Description |
|---|---|
| public | |
| pack-priv | GraggBulirschStoerStepInterpolator(final double[]
reference to the integrator array holding the current state y, final double[] reference to the integrator array holding the slope
at the beginning of the step y0Dot, final double[] reference to the integrator array holding the state at
the end of the step y1, final double[] reference to the integrator array holding the slope
at the end of the step y1Dot, final double[][] reference to the integrator array holding the
derivatives at the middle point of the step yMidDots, final boolean integration direction indicator forward, final EquationsMapper equations mapper for the primary equations set primaryMapper, final EquationsMapper[] equations mappers for the secondary equations sets secondaryMappers)Simple constructor. |
| pack-priv | GraggBulirschStoerStepInterpolator(final GraggBulirschStoerStepInterpolator
interpolator to copy from. The copy is a deep
copy: its arrays are separated from the original arrays of the
instance interpolator)Copy constructor. |
| Modifier and Type | Method and Description |
|---|---|
| public void | computeCoefficients(final int
degree of the interpolation polynomial mu, final double current step h)Compute the interpolation coefficients for dense output. |
| protected void | computeInterpolatedStateAndDerivatives(final double
normalized interpolation abscissa within the step
(theta is zero at the previous time step and one at the current time step) theta, final double time gap between the interpolated time and
the current time oneMinusThetaH)Implements abstract org. Compute the state and derivatives at the interpolated time. |
| protected StepInterpolator | doCopy()
Implements abstract org. Really copy the finalized instance. |
| public double | Returns: estimate of the interpolation errorscaling array scale)Estimate interpolation error. |
| public void | readExternal(final ObjectInput
the stream to read data from in order to restore the object in)Implements abstract org. Implements java. The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. |
| private void | |
| public void | writeExternal(final ObjectOutput
the stream to write the object to out)Implements abstract org. Implements java. The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays. |
| currentDegree | back to summary |
|---|---|
| private int currentDegree Degree of the interpolation polynomials. | |
| errfac | back to summary |
|---|---|
| private double[] errfac Error coefficients for the interpolation. | |
| polynomials | back to summary |
|---|---|
| private double[][] polynomials Interpolation polynomials. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Serializable version identifier. | |
| y0Dot | back to summary |
|---|---|
| private double[] y0Dot Slope at the beginning of the step. | |
| y1 | back to summary |
|---|---|
| private double[] y1 State at the end of the step. | |
| y1Dot | back to summary |
|---|---|
| private double[] y1Dot Slope at the end of the step. | |
| yMidDots | back to summary |
|---|---|
| private double[][] yMidDots Derivatives at the middle of the step. element 0 is state at midpoint, element 1 is first derivative ... | |
| GraggBulirschStoerStepInterpolator | back to summary |
|---|---|
| public GraggBulirschStoerStepInterpolator() Simple constructor. This constructor should not be used directly, it is only intended for the serialization process. | |
| GraggBulirschStoerStepInterpolator | back to summary |
|---|---|
| pack-priv GraggBulirschStoerStepInterpolator(final double[] y, final double[] y0Dot, final double[] y1, final double[] y1Dot, final double[][] yMidDots, final boolean forward, final EquationsMapper primaryMapper, final EquationsMapper[] secondaryMappers) Simple constructor.
| |
| GraggBulirschStoerStepInterpolator | back to summary |
|---|---|
| pack-priv GraggBulirschStoerStepInterpolator(final GraggBulirschStoerStepInterpolator interpolator) Copy constructor.
| |
| computeCoefficients | back to summary |
|---|---|
| public void computeCoefficients(final int mu, final double h) Compute the interpolation coefficients for dense output.
| |
| computeInterpolatedStateAndDerivatives | back to summary |
|---|---|
| protected void computeInterpolatedStateAndDerivatives(final double theta, final double oneMinusThetaH) Implements abstract org. 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.
| |
| doCopy | back to summary |
|---|---|
| protected StepInterpolator doCopy() Implements abstract org. Doc from org. Really copy the finalized instance. This method is called by
| |
| estimateError | back to summary |
|---|---|
| public double estimateError(final double[] scale) Estimate interpolation error.
| |
| readExternal | back to summary |
|---|---|
| public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException Implements abstract org. Implements java. Doc from org. The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. The readExternal method must read the values in the same sequence and with the same types as were written by writeExternal.
| |
| resetTables | back to summary |
|---|---|
| private void resetTables(final int maxDegree) Reallocate the internal tables. Reallocate the internal tables in order to be able to handle interpolation polynomials up to the given degree
| |
| writeExternal | back to summary |
|---|---|
| public void writeExternal(final ObjectOutput out) throws IOException Implements abstract org. Implements java. Doc from org. The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.
| |