Class RootFindingFunctions


  • public class RootFindingFunctions
    extends Object
    Methods to find roots of a function.
    Author:
    Daniele Andreis
    • Constructor Detail

      • RootFindingFunctions

        public RootFindingFunctions()
    • Method Detail

      • bisectionRootFinding

        public static double bisectionRootFinding​(ISingleArgmentFunction function,
                                                  double bottomLimit,
                                                  double upperLimit,
                                                  double accuracy,
                                                  double maxIterationNumber,
                                                  IHMProgressMonitor pm)
        Evaluate the root of a function.

        Use the bisection method. note that to use before to use this method it's necessary to have a special function object which is defined by the interface Function.

        1. Implements the bisection method an return the solution with a particular accuracy.
        2. return an error if the function doesn't converge to the solution in JMAX loop.
        Parameters:
        function - is the function examined.
        bottomLimit - bottom left value of the x.
        upperLimit - upper right value of the x.
        accuracy - accuracy to use in the evaluation.
        maxIterationNumber - maximum number of iteration.
        Returns:
        the solution of the equation.
        Throws:
        ArithmeticException - if the method haven't achieve the solution in jMax steeps.