Class AdamsBashforthMoulton

  • All Implemented Interfaces:
    ODESolver

    public class AdamsBashforthMoulton
    extends Object
    implements ODESolver
    This class uses an Adams-Bashford predictor and an Adams-Moulton corrector of the specified order. This is an order-n multi-step method which uses the last n computed points based on Newton's backward difference interpolating polynomial of degree (n-1) (unlike single-step methods which only use the most recent value to compute the next solution point). Since the predictor and the corrector are not self-starting, a single-step method such as a Runge-Kutta method is used to compute the first n points.
    See Also:
    Wikipedia: Linear multistep method
    • Constructor Detail

      • AdamsBashforthMoulton

        public AdamsBashforthMoulton​(ABMPredictorCorrector predictorCorrector,
                                     double stepSize)
        Create a new instance of the Adams-Bashforth-Moulton method using the given predictor-corrector pair. RungeKutta2 is used for initializing the first n points.
        Parameters:
        predictorCorrector - the Adams-Bashforth and Adams-Moulton formulae that are used
        stepSize - the step size between each approximation
      • AdamsBashforthMoulton

        public AdamsBashforthMoulton​(ABMPredictorCorrector predictorCorrector,
                                     double stepSize,
                                     ODEIntegrator integrator)
        Create a new instance of the Adams-Bashforth-Moulton method using the given predictor-corrector pair and the given ODE integrator.
        Parameters:
        predictorCorrector - the Adams-Bashforth and Adams-Moulton formulae that are used
        stepSize - the step size between each approximation
        integrator - the integrator for initializing the first n points
    • Method Detail

      • solve

        public ODESolution solve​(ODE1stOrder ode)
        Solve an ODE using the Adams-Bashforth-Moulton method.
        Specified by:
        solve in interface ODESolver
        Parameters:
        ode - the ODE problem
        Returns:
        the solution