Class RiddersSolver

  • All Implemented Interfaces:
    UnivariateRealSolver, ConvergingAlgorithm

    public class RiddersSolver
    extends UnivariateRealSolverImpl
    Implements the Ridders' Method for root finding of real univariate functions. For reference, see C. Ridders, A new algorithm for computing a single root of a real continuous function , IEEE Transactions on Circuits and Systems, 26 (1979), 979 - 980.

    The function should be continuous but not necessarily smooth.

    Since:
    1.2
    Version:
    $Revision: 1070725 $ $Date: 2011-02-15 02:31:12 +0100 (mar. 15 févr. 2011) $
    • Method Detail

      • solve

        @Deprecated
        public double solve​(double min,
                            double max)
                     throws ConvergenceException,
                            FunctionEvaluationException
        Deprecated.
        Solve for a zero root in the given interval.

        A solver may require that the interval brackets a single zero root. Solvers that do require bracketing should be able to handle the case where one of the endpoints is itself a root.

        Parameters:
        min - the lower bound for the interval.
        max - the upper bound for the interval.
        Returns:
        a value where the function is zero
        Throws:
        ConvergenceException - if the maximum iteration count is exceeded or the solver detects convergence problems otherwise.
        FunctionEvaluationException - if an error occurs evaluating the function
      • solve

        @Deprecated
        public double solve​(double min,
                            double max,
                            double initial)
                     throws ConvergenceException,
                            FunctionEvaluationException
        Deprecated.
        Solve for a zero in the given interval, start at startValue.

        A solver may require that the interval brackets a single zero root. Solvers that do require bracketing should be able to handle the case where one of the endpoints is itself a root.

        Parameters:
        min - the lower bound for the interval.
        max - the upper bound for the interval.
        initial - the start value to use
        Returns:
        a value where the function is zero
        Throws:
        ConvergenceException - if the maximum iteration count is exceeded or the solver detects convergence problems otherwise.
        FunctionEvaluationException - if an error occurs evaluating the function
      • solve

        @Deprecated
        public double solve​(UnivariateRealFunction f,
                            double min,
                            double max,
                            double initial)
                     throws MaxIterationsExceededException,
                            FunctionEvaluationException
        Deprecated.
        in 2.2 (to be removed in 3.0).
        Find a root in the given interval with initial value.

        Requires bracketing condition.

        Parameters:
        f - the function to solve
        min - the lower bound for the interval
        max - the upper bound for the interval
        initial - the start value to use
        Returns:
        the point at which the function value is zero
        Throws:
        MaxIterationsExceededException - if the maximum iteration count is exceeded
        FunctionEvaluationException - if an error occurs evaluating the function
        java.lang.IllegalArgumentException - if any parameters are invalid