You are on page 1of 30

Numerical Methods

SMJM 3053

Nurhazimah Nazmi, PhD


5.33.01
nurhazimah@utm.my
Root of equations?
Roots of Equation

Bracketing methods Open methods

• Based on assuming • Based on formulas that


an interval of the require only a single starting
function which value of x or two starting
brackets the root. values that do not
• Always converge to necessarily bracket the root.
true value of the root. • Sometimes diverge from to
true value of the root but
when converge, it more
quickly than bracketing.
BRACKECTING VS OPEN
Bracketing Open
methods methods

1. Simple fixed-
1. Bisection
point

2. False-position 2. Newton-raphson

3. Secant
Bisection
Steps of Calculation:
Step 1: f(xl).f(xu) < 0

Step 2: Estimate the root: xr = (xl + xu) / 2


Step 3: Make the following evaluations to determine in which
subinterval the root lies:
a. If f(xl).f(xr) < 0, root lies in the lower subinterval. Therefore,
set xu = xr and return to step 2.
b. If f(xl).f(xr) > 0, 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.
The approximate relative error εa can be calculated as

The true relative error εt can be calculated as

When |εa| become less than prespecified stopping criterion


εs the computation is terminated
Example
Given that f (x ) =
667.38
x
( )
1 - e -0.146843 x - 40 . Find the root of f (x) if

xl = 12 and xu = 16 . Continue your iteration until the


approximate error falls below a stopping criterion of e s (%) = 0.5%

(The true value is 14.78020859).


Solution
f(xl) f(xr)
Iteration xl xu xr f(xr)
>0 / <0
1 12 16 14 1.5687 >0 5.297
2 14 16 15 -0.4248 <0 6.667 1.478
3 14 15 14.5 3.448 1.896
4 14.5 15 14.75 1.695 0.204
5 14.75 15 14.875 0.840 0.641
6 14.75 14.875 14.8125 0.442 0.219

After 6 iterations, e a = 0.442 < 0.5 = e s

hence the computation are terminated.


False position
Same as bisection but

f (xu )(xl - xu )
x r = xu -
f ( xl ) - f ( xu )
Example
Given that f (x ) =
667.38
x
( )
1 - e -0.146843 x - 40 . Find the root of f (x) if

xl = 12 and xu = 16 . Continue your iteration until the


approximate error falls below a stopping criterion of e s (%) = 0.5%

(The true value is 14.78020859).


Solution
f (xl ) = 6.0699 - 2.2688(12 - 16 )
First iteration, xl = 12 xr = 16 - = 14.9113
6.6099 - (- 2.2688)
xu = 16 f (xu ) = -2.2688

which has a true relative error of 0.89%.


Second iteration, f (x ) f (x ) = -1.5426
l r

Therefore, the root lies in the first subinterval, and x r


becomes the new upper limit for the next iteration
xl = 12 f (xl ) = 6.0699
- 2.2543(12 - 14.9113)
xr = 14.9113 - = 14.7942
xu = 14.9113 6.6099 - (- 0.2543)
f (xu ) = -0.2543

which has true and approximate relative errors of 0.09% and


0.79%.
Simple fixed-point
The true percent
relative error for
Compute iteration: each iteration is
roughly proportional
(by a factor of about
0.5 to 0.6) to the
error from the
previous iteration.

This property,
called linear
convergence, is
characteristic of
fixed-point
iteration.
Newton-Raphson
Newton-Raphson
Secant
A potential problem in implementing the Newton-Raphson
method is the evaluation of the derivative. Although this is
not inconvenient for polynomials and many other functions,
there are certain functions whose derivatives may be
extremely difficult or inconvenient to evaluate. For these
cases, the derivative can be approximated by a backward
finite divided difference,

You might also like