agi.foundation.numericalmethods
(agi.foundation.core-2024r2.jar)

## Class RungeKuttaVerner89Integrator

• All Implemented Interfaces:

```public class RungeKuttaVerner89Integrator
This is an eighth order Runge-Kutta algorithm with error control based on the work of Verner which can adapt the size of the integration step based on comparing the ninth order evaluation with the eighth order evaluation to produce an estimate of the numerical error produced by a given integration step.

The coefficients used for this integrator come from a website of Jim Verner: people.math.sfu.ca/~jverner/

• ### Constructor Summary

Constructors
Modifier Constructor and Description
` ` `RungeKuttaVerner89Integrator()`
Initializes a new instance.
` ` ```RungeKuttaVerner89Integrator(DependentVariableDerivatives system, double initialStepSize)```
Initializes a new instance based on the given system of equations and initial step size.
`protected ` ```RungeKuttaVerner89Integrator(RungeKuttaVerner89Integrator existingInstance, CopyContext context)```
Initializes a new instance as a copy of an existing instance.
• ### Method Summary

All Methods
Modifier and Type Method and Description
`boolean` `adaptStep()`
This method updates the `CurrentStepSize` (`get`) to account for error in the state and its derivatives.
`Object` `clone(CopyContext context)`
Create a copy of this integrator.
`double` `getAbsoluteTolerance()`
Gets the tolerance which provides a baseline for the error control.
`double` `getRelativeTolerance()`
Gets the tolerance which provides a relative weight for the numerical error based on the dependent variables.
`void` ```initialize(double x, double[] y)```
Initialize the integrator's initial independent and dependent variables and reset the integration parameters.
`void` `setAbsoluteTolerance(double value)`
Sets the tolerance which provides a baseline for the error control.
`void` `setRelativeTolerance(double value)`
Sets the tolerance which provides a relative weight for the numerical error based on the dependent variables.

`getTableau, reintegrate, setTableau`

`adjustStep, boundAndTruncateStepSize, getAdaptiveWeights, getCurrentStepSize, getIterations, getMaximumIterations, getMaximumStepSize, getMinimumStepSize, getStepDeflationExponent, getStepDeflationFactor, getStepInflationExponent, getStepInflationFactor, getStepSizeBehavior, getStepTruncationOrder, integrate, integrate, setAdaptiveWeights, setCurrentStepSize, setIterations, setMaximumIterations, setMaximumStepSize, setMinimumStepSize, setStepDeflationExponent, setStepDeflationFactor, setStepInflationExponent, setStepInflationFactor, setStepSizeBehavior, setStepTruncationOrder`
• ### Methods inherited from class agi.foundation.numericalmethods.NumericalIntegrator

`getDimension, getDirection, getFinalDependentVariableValues, getFinalIndependentVariableValue, getInitialDependentVariableValues, getInitialIndependentVariableValue, getInitialStepSize, getIsThreadSafe, getPreviousStepSize, getStepSizeInformation, getSystemOfEquations, setDirection, setFinalDependentVariableValues, setFinalIndependentVariableValue, setInitialDependentVariableValues, setInitialIndependentVariableValue, setInitialStepSize, setStepSizeInformation, setSystemOfEquations, startNextStep`
• ### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ### Constructor Detail

• #### RungeKuttaVerner89Integrator

`public RungeKuttaVerner89Integrator()`
Initializes a new instance.
• #### RungeKuttaVerner89Integrator

```public RungeKuttaVerner89Integrator(DependentVariableDerivatives system,
double initialStepSize)```
Initializes a new instance based on the given system of equations and initial step size.
Parameters:
`system` - The system of equations that define the derivatives for the dependent variables.
`initialStepSize` - The initial size of the integration step.
• #### RungeKuttaVerner89Integrator

```protected RungeKuttaVerner89Integrator(@Nonnull
RungeKuttaVerner89Integrator existingInstance,
@Nonnull
CopyContext context)```
Initializes a new instance as a copy of an existing instance.

See `ICloneWithContext.clone(CopyContext)` for more information about how to implement this constructor in a derived class.

Parameters:
`existingInstance` - The existing instance to copy.
`context` - A `CopyContext` that controls the depth of the copy.
Throws:
`ArgumentNullException` - Thrown when `existingInstance` or `context` is `null`.
• ### Method Detail

• #### clone

`public Object clone(CopyContext context)`
Create a copy of this integrator.
Specified by:
`clone` in interface `ICloneWithContext`
Specified by:
`clone` in class `NumericalIntegrator`
Parameters:
`context` - The context in which to create the copy.
Returns:
The copy of this integrator.
• #### getAbsoluteTolerance

`public final double getAbsoluteTolerance()`
Gets the tolerance which provides a baseline for the error control. By default, this value is `Constants.Epsilon10`.
• #### setAbsoluteTolerance

`public final void setAbsoluteTolerance(double value)`
Sets the tolerance which provides a baseline for the error control. By default, this value is `Constants.Epsilon10`.
• #### getRelativeTolerance

`public final double getRelativeTolerance()`
Gets the tolerance which provides a relative weight for the numerical error based on the dependent variables. By default, this value is `Constants.Epsilon13`.
• #### setRelativeTolerance

`public final void setRelativeTolerance(double value)`
Sets the tolerance which provides a relative weight for the numerical error based on the dependent variables. By default, this value is `Constants.Epsilon13`.
• #### initialize

```public void initialize(double x,
double[] y)```
Initialize the integrator's initial independent and dependent variables and reset the integration parameters. This should be called by the user prior to performing the first integration step.
Overrides:
`initialize` in class `RungeKuttaAdaptiveStepIntegrator`
Parameters:
`x` - The value of the initial independent variable.
`y` - The values for the initial dependent variables.
`public boolean adaptStep()`
This method updates the `CurrentStepSize` (`get`) to account for error in the state and its derivatives. It returns true if the integrator should reintegrate with the updated step size or false if the integrator should continue to the next integration step (potentially with a different step size).
`adaptStep` in class `AdaptiveNumericalIntegrator`