Professional Documents
Culture Documents
of Solving a
Nonlinear Equation
• Bracketing methods
• Open Methods
Bracketing methods
Theorem
An equation f (x) = 0 , where f (x) is a real continuous function,
has at least one root between xl and xu if
f(xl ) f(xu) < 0
At least one root
exists between
the points if the
function is real,
continuous and
changes signs.
Algorithm
Step 1: Choose lower xl and upper xu guesses for the root such that the
function changes sign over the interval. This can be checked by
ensuring that f(xl)f(xu) < 0.
Step 2: An estimate of the root xr is determined by
Step 3: Make the following evaluations to determine in which subinterval
the root lies:
(a) If f(xl)f(xr) < 0, the root lies in the lower subinterval. Therefore,
set xu = xr and return to step 2.
(b) If f(xl)f(xr) > 0, the root lies in the upper subinterval. Therefore,
set xl = xr and return to step 2.
(c) If f(xl)f(xr) = 0, the root equals xr; terminate the computation.
Step 4: Find the absolute relative approximate error. Since
and
http://numericalmethods.eng.usf.edu
Step 5:
Compare the absolute relative approximate error a with the pre-
specified error tolerance s.
Note one should also check whether the number of iterations is more than the maximum number of
iterations allowed. If so, one needs to terminate the algorithm and notify the user about it.
http://numericalmethods.eng.usf.edu
Example
Solve for x using bisection method e –x – x = 0
Advantages
• Always convergent
• The root bracket gets halved with each iteration -
guaranteed.
http://numericalmethods.eng.usf.edu
Drawbacks
Slow convergence
If one of the initial guesses is close to the root, the
convergence is slower
http://numericalmethods.eng.usf.edu
Exercise#1