These methods are embedded explicit Runge-Kutta methods with two sets of coefficients allowing to estimate the error, their Butcher arrays are as follows :
0 |
c2 | a21
c3 | a31 a32
... | ...
cs | as1 as2 ... ass-1
|--------------------------
| b1 b2 ... bs-1 bs
| b'1 b'2 ... b's-1 b's
In fact, we rather use the array defined by ej = bj - b'j to compute directly the error rather than computing two estimates and then comparing them.
Some methods are qualified as fsal (first same as last) methods. This means the last evaluation of the derivatives in one step is the same as the first in the next step. Then, this evaluation can be reused from one step to the next one and the cost of such a method is really s-1 evaluations despite the method still has s stages. This behaviour is true only for successful steps, if the step is rejected after the error estimation phase, no evaluation is saved. For an fsal method, we have cs = 1 and asi = bi for all i.
| Modifier and Type | Field and Description |
|---|---|
| private final T[][] | a
Internal weights from Butcher array (without the first empty row). |
| private final T[] | b
External weights for the high order method from Butcher array. |
| private final T[] | c
Time steps from Butcher array (without the first zero). |
| private final T | exp
Stepsize control exponent. |
| private final int | fsal
Index of the pre-computed derivative for fsal methods. |
| private T | maxGrowth
Maximal growth factor for stepsize control. |
| private T | minReduction
Minimal reduction factor for stepsize control. |
| private T | safety
Safety factor for stepsize control. |
| Access | Constructor and Description |
|---|---|
| protected | EmbeddedRungeKuttaFieldIntegrator(final Field<T>
field to which the time and state vector elements belong field, final String name of the method name, final int index of the pre-computed derivative for fsal methods
or -1 if method is not fsal fsal, final double minimal step (sign is irrelevant, regardless of
integration direction, forward or backward), the last step can
be smaller than this minStep, final double maximal step (sign is irrelevant, regardless of
integration direction, forward or backward), the last step can
be smaller than this maxStep, final double allowed absolute error scalAbsoluteTolerance, final double allowed relative error scalRelativeTolerance)Build a Runge-Kutta integrator with the given Butcher array. |
| protected | EmbeddedRungeKuttaFieldIntegrator(final Field<T>
field to which the time and state vector elements belong field, final String name of the method name, final int index of the pre-computed derivative for fsal methods
or -1 if method is not fsal fsal, final double minimal step (must be positive even for backward
integration), the last step can be smaller than this minStep, final double maximal step (must be positive even for backward
integration) maxStep, final double[] allowed absolute error vecAbsoluteTolerance, final double[] allowed relative error vecRelativeTolerance)Build a Runge-Kutta integrator with the given Butcher array. |
| Modifier and Type | Method and Description |
|---|---|
| protected abstract RungeKuttaFieldStepInterpolator | Returns: external weights for the high order method from Butcher arrayintegration direction indicator forward, T[][] slopes at the intermediate points yDotK, final FieldODEStateAndDerivative<T> start of the global step globalPreviousState, final FieldODEStateAndDerivative<T> end of the global step globalCurrentState, FieldEquationsMapper<T> equations mapper for the all equations mapper)Create an interpolator. |
| protected abstract T | Returns: error ratio, greater than 1 if step should be rejectedderivatives computed during the first stages yDotK, T[] estimate of the step at the start of the step y0, T[] estimate of the step at the end of the step y1, T current step h)Compute the error ratio. |
| protected T | Returns: p/q computed in the instance fieldnumerator p, final int denominator q)Create a fraction. |
| protected T | Returns: p/q computed in the instance fieldnumerator p, final double denominator q)Create a fraction. |
| public T | |
| public T | Returns: minimal reduction factorGet the minimal reduction factor for stepsize control. |
| public abstract int | |
| public T | |
| public FieldODEStateAndDerivative | integrate(final FieldExpandableODE<T>
differential equations to integrate equations, final FieldODEState<T> initial state (time, primary and secondary state vectors) initialState, final T target time for the integration
(can be set to a value smaller than finalTime)t0 for backward integration)Implements org. Integrate the differential equations up to the given time. |
| public void | setMaxGrowth(final T
maximal growth factor maxGrowth)Set the maximal growth factor for stepsize control. |
| public void | setMinReduction(final T
minimal reduction factor minReduction)Set the minimal reduction factor for stepsize control. |
| public void |
| a | back to summary |
|---|---|
| private final T[][] a Internal weights from Butcher array (without the first empty row). | |
| b | back to summary |
|---|---|
| private final T[] b External weights for the high order method from Butcher array. | |
| c | back to summary |
|---|---|
| private final T[] c Time steps from Butcher array (without the first zero). | |
| exp | back to summary |
|---|---|
| private final T exp Stepsize control exponent. | |
| fsal | back to summary |
|---|---|
| private final int fsal Index of the pre-computed derivative for fsal methods. | |
| maxGrowth | back to summary |
|---|---|
| private T maxGrowth Maximal growth factor for stepsize control. | |
| minReduction | back to summary |
|---|---|
| private T minReduction Minimal reduction factor for stepsize control. | |
| safety | back to summary |
|---|---|
| private T safety Safety factor for stepsize control. | |
| EmbeddedRungeKuttaFieldIntegrator | back to summary |
|---|---|
| protected EmbeddedRungeKuttaFieldIntegrator(final Field<T> field, final String name, final int fsal, final double minStep, final double maxStep, final double scalAbsoluteTolerance, final double scalRelativeTolerance) Build a Runge-Kutta integrator with the given Butcher array.
| |
| EmbeddedRungeKuttaFieldIntegrator | back to summary |
|---|---|
| protected EmbeddedRungeKuttaFieldIntegrator(final Field<T> field, final String name, final int fsal, final double minStep, final double maxStep, final double[] vecAbsoluteTolerance, final double[] vecRelativeTolerance) Build a Runge-Kutta integrator with the given Butcher array.
| |
| createInterpolator | back to summary |
|---|---|
| protected abstract RungeKuttaFieldStepInterpolator Create an interpolator.
| |
| estimateError | back to summary |
|---|---|
| protected abstract T estimateError(T[][] yDotK, T[] y0, T[] y1, T h) Compute the error ratio.
| |
| fraction | back to summary |
|---|---|
| protected T fraction(final int p, final int q) Create a fraction.
| |
| fraction | back to summary |
|---|---|
| protected T fraction(final double p, final double q) Create a fraction.
| |
| getMaxGrowth | back to summary |
|---|---|
| public T getMaxGrowth() Get the maximal growth factor for stepsize control.
| |
| getMinReduction | back to summary |
|---|---|
| public T getMinReduction() Get the minimal reduction factor for stepsize control.
| |
| getOrder | back to summary |
|---|---|
| public abstract int getOrder() Get the order of the method.
| |
| getSafety | back to summary |
|---|---|
| public T getSafety() Get the safety factor for stepsize control.
| |
| integrate | back to summary |
|---|---|
| public FieldODEStateAndDerivative Implements org. Doc from org. Integrate the differential equations up to the given time. This method solves an Initial Value Problem (IVP). Since this method stores some internal state variables made
available in its public interface during integration (
| |
| setMaxGrowth | back to summary |
|---|---|
| public void setMaxGrowth(final T maxGrowth) Set the maximal growth factor for stepsize control.
| |
| setMinReduction | back to summary |
|---|---|
| public void setMinReduction(final T minReduction) Set the minimal reduction factor for stepsize control.
| |
| setSafety | back to summary |
|---|---|
| public void setSafety(final T safety) Set the safety factor for stepsize control.
| |