-
Notifications
You must be signed in to change notification settings - Fork 90
5. Root Finding with Bracketing Methods
Bisection method based on the Intermediate Value Theorem, which states that if the function is continuous on an interval
- The definition of the function:
$f(x)$ - The lower bound of the interval:
$a$ - The upper bound of the interval:
$b$ - The allowed tolerance for the method:
$\varepsilon$ - The maximum number of iterations:
max_iter
- The function changes sign over the interval. This condition can be checked by ensuring the following inequality:
- Find the midpoint of the interval
- Calculate the following values:
-
Check if the tolerance is satisfied:
$$f(c) \le \varepsilon$$ -
Check if the convergence is satisfied:
$$|b-a| \le \varepsilon$$ -
Check if the number of iterations has reached to
max_iter. -
If at least one the checks above is not satisfied, specify the new values of the bounds for the next iteration by using the checks below:
$$f(a) \cdot f(c) < 0 \rightarrow a^{\prime} = a ~~~~ b^{\prime} = c$$ $$f(b) \cdot f(c) < 0 \rightarrow a^{\prime} = c ~~~~ b^{\prime} = b$$ -
Repeat the steps given above until tolerance, convergence, or number of iterations is satisfied.
One can estimate the number of iterations, which is required to reach the desired tolerance