integrators
Class AdamsIntegrator
java.lang.Object
integrators.Integrator
integrators.AdamsIntegrator
- public class AdamsIntegrator
- extends Integrator
Fourth-order Adams-Bashforth-Moulton predictor-corrector method, using coefficients
given in Melvin Maron, Numerical Analysis: A Practical Approach c. 1982, p. 354-7. This
Integrator uses fourth-order Runge-Kutta steps to start off the integration, or to restart
it internally if the error compensation gets overwhelmed, and then computes a prediction
of y(t+1) based on an Adams-Bashforth formula involving the derivatives at the present
time and at three equally-spaced previous time points. It then uses the prediction to
compute an estimate of the derivative at y(t+1), and computes another estimate of y(t+1)
based on the Adams-Moulton formula involving the estimated derivatives at y(t-2), y(t-1),
y(t), and y(t+1). The difference between the predicted y(t+1) and the corrected y(t+1)
is used to compute an error estimate. Then the corrected y(t+1) is substituted into the
system for another application of the Adams-Moulton formula, and the error estimate
becomes the difference between the first corrected y(t+1) and the second. If the error
is increasing, or if it is greater than the error tolerance, then the method assumes it
took too big a step and tries to cut it in half using an interpolation between the
stored derivative values. If this does not improve matters, Runge-Kutta steps are used
re-stock the derivative array. Otherwise, if the error is tolerable, the timestep may
be doubled. The method uses counters to make sure that the method doesn't increase the
timestep too frequently or try to cut it by interpolation more than once before resorting
to Runge-Kutta steps.
Method Summary |
void |
init(Model model)
Any object planning to use an Integrator of any kind MUST call its
init(Model) method, which (among other things) is generally used to allocate
storage arrays for the intermediates in an integration method. |
float |
IntegrateOneStep()
Integrates across a single time step. |
void |
reset()
Should be called after the Integrator has crossed an entire interval. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AdamsIntegrator
public AdamsIntegrator()
init
public void init(Model model)
- Description copied from class:
Integrator
- Any object planning to use an Integrator of any kind MUST call its
init(Model) method, which (among other things) is generally used to allocate
storage arrays for the intermediates in an integration method. This method
does NOT do any numerics so does not depend on the state of the model, but
it DOES need to be called after the model has been properly populated with
Cells and Nodes, and needs to be called again if these change.
- Overrides:
init
in class Integrator
reset
public void reset()
- Description copied from class:
Integrator
- Should be called after the Integrator has crossed an entire interval.
The base class does nothing; typical subclasses will override Integrator.reset()
to reset the time step size to the default value. This method is NOT used to
reallocate storage; that requires a call to init().
- Overrides:
reset
in class Integrator
IntegrateOneStep
public float IntegrateOneStep()
- Description copied from class:
Integrator
- Integrates across a single time step. Return value is the size of the
timestep, which may differ from that specified by the calling method if the
Integrator subclass adapts the step size to match error requirements.
- Overrides:
IntegrateOneStep
in class Integrator