Class GraggBulirschStoerStateInterpolator
- All Implemented Interfaces:
Serializable
,ODEStateInterpolator
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:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
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.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionGraggBulirschStoerStateInterpolator
(boolean forward, ODEStateAndDerivative globalPreviousState, ODEStateAndDerivative globalCurrentState, ODEStateAndDerivative softPreviousState, ODEStateAndDerivative softCurrentState, EquationsMapper mapper, double[][] yMidDots, int mu) Simple constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected ODEStateAndDerivative
computeInterpolatedStateAndDerivatives
(EquationsMapper mapper, double time, double theta, double thetaH, double oneMinusThetaH) Compute the state and derivatives at the interpolated time.protected GraggBulirschStoerStateInterpolator
create
(boolean newForward, ODEStateAndDerivative newGlobalPreviousState, ODEStateAndDerivative newGlobalCurrentState, ODEStateAndDerivative newSoftPreviousState, ODEStateAndDerivative newSoftCurrentState, EquationsMapper newMapper) Create a new instance.double
estimateError
(double[] scale) Estimate interpolation error.Methods inherited from class org.hipparchus.ode.sampling.AbstractODEStateInterpolator
getCurrentState, getGlobalCurrentState, getGlobalPreviousState, getInterpolatedState, getMapper, getPreviousState, isCurrentStateInterpolated, isForward, isPreviousStateInterpolated, restrictStep
-
Constructor Details
-
GraggBulirschStoerStateInterpolator
public GraggBulirschStoerStateInterpolator(boolean forward, ODEStateAndDerivative globalPreviousState, ODEStateAndDerivative globalCurrentState, ODEStateAndDerivative softPreviousState, ODEStateAndDerivative softCurrentState, EquationsMapper mapper, double[][] yMidDots, int mu) Simple constructor.- Parameters:
forward
- integration direction indicatorglobalPreviousState
- start of the global stepglobalCurrentState
- end of the global stepsoftPreviousState
- start of the restricted stepsoftCurrentState
- end of the restricted stepmapper
- equations mapper for the all equationsyMidDots
- scaled derivatives at the middle of the step $\tau$ (element k is $h^{k} d^{k}y(\tau)/dt^{k}$ where h is step size...)mu
- degree of the interpolation polynomial
-
-
Method Details
-
create
protected GraggBulirschStoerStateInterpolator create(boolean newForward, ODEStateAndDerivative newGlobalPreviousState, ODEStateAndDerivative newGlobalCurrentState, ODEStateAndDerivative newSoftPreviousState, ODEStateAndDerivative newSoftCurrentState, EquationsMapper newMapper) Create a new instance.- Specified by:
create
in classAbstractODEStateInterpolator
- Parameters:
newForward
- integration direction indicatornewGlobalPreviousState
- start of the global stepnewGlobalCurrentState
- end of the global stepnewSoftPreviousState
- start of the restricted stepnewSoftCurrentState
- end of the restricted stepnewMapper
- equations mapper for the all equations- Returns:
- a new instance
-
estimateError
public double estimateError(double[] scale) Estimate interpolation error.- Parameters:
scale
- scaling array- Returns:
- estimate of the interpolation error
-
computeInterpolatedStateAndDerivatives
protected ODEStateAndDerivative computeInterpolatedStateAndDerivatives(EquationsMapper mapper, double time, double theta, double thetaH, 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 classAbstractODEStateInterpolator
- Parameters:
mapper
- mapper for ODE equations primary and secondary componentstime
- interpolation timetheta
- normalized interpolation abscissa within the step (theta is zero at the previous time step and one at the current time step)thetaH
- time gap between the previous time and the interpolated timeoneMinusThetaH
- time gap between the interpolated time and the current time- Returns:
- interpolated state and derivatives
-