Sie sind auf Seite 1von 24

CHAPTER 6 : ROOTS OF EQUATIONS:

Open Methods
LESSON OUTCOMES

To calculate roots of equation using

roots

Open Methods:

1. Newton-Raphson Method
2. Secant Method

- when a function is zero

3. Fixed-point Iteration

- when a function crosses x-axis

Chap6/1

OPEN METHODS : INTRODUCTION


Open methods are based on
formulas that require only one
single or two starting value(s)
of x that do not need to
bracket the root.
Not always work as
sometimes it can diverge,
depending on the initial guess
When it converges, it
reaches solution much more Bisection method Open method
faster
than
Bracketing
Chap6/2
method.

NEWTON-RAPHSON METHOD
Also called as Newtons method, it is a powerful and
widely used method.
Based on Taylor series expansion; truncate the series after
1st order derivative term:
f ( xi 1 ) f ( xi ) f ( xi )x ... Rn
The root is the value of xi 1 when f ( xi 1 ) 0
Re arranging,
Solve for xi+1
i )( xi 1 xi )
0 f(xi ) f (x
xi 1 xi

f ( xi )
Newton-Raphson formula
f ( xi )

Chap6/3

NEWTON-RAPHSON METHOD
Convenient method for functions
whose derivatives can be evaluated
analytically.
Not suitable for functions whose
derivatives cannot be evaluated
analytically
It converges very fast as it is
quadratically convergent (see
book in Box 6.2, p141)
Pitfalls: cant find multiple roots, may not
converge if guess is near zero slope !

Fig. 6.5

f ( xi )
xi 1 xi
f ( xi )

Chap6/4

NEWTON-RAPHSON METHOD

Tangent :
f ( xi ) 0
f ( xi )
xi xi 1
xi 1 xi

Root is estimated by
extending a tangent at x1
down to x-axis

f ( xi )
f ( xi )

Chap6/5

NEWTON-RAPHSON METHOD
ALGORITHM
STEP 1 : Assume initial value for xi x0
STEP 2 : Calculate the value of xi+1 using equation
xi 1 xi

f xi
f xi

i = 0,1,2,3,

STEP 3 : Calculate the approx. error |a|


a

xi 1 xi
100
xi 1

STEP 4 : Repeat STEP 2 until a < s pre-specified value,


then root = xi+1
Chap6/6

Newton-Raphson method
Poor Convergence
Inflection point, f '' = 0 in
the vicinity of a root

Oscillation of slopes
Guess is near zero slope

Zero slope is encountered


Chap6/7

CLASS ACTIVITY
Determine the highest real root of f(x) = x3 6x2 + 11x 6.1
using Newton-Raphson Method. Consider three iterations
with guess xo=3.5. Also calculate the estimated error, a after
each iteration.

xi 1 xi

f xi
f xi

xi 1 xi
100
xi 1
Chap6/8

SOLUTION:

f xi
xi 1 xi
f xi

x(i+1)

xi

f(xi)

f'(xi)

epsilon(a) %

3.1913

3.5000

1.7750

5.7500

3.0687

3.1913

0.3994

3.2576

4.00

3.0473

3.0687

0.0519

2.4264

0.70

Chap6/9

SECANT METHOD
For functions whose derivatives are difficult to evaluate,

the derivatives f '(x) can be approximated by Backward


Finite-Divided Differencing scheme :

f ( xi ) f ( xi 1 )
f ( xi )
xi xi 1

f xi
Newton Raphson : xi 1 xi
f xi
f ( xi )( xi xi 1 )
Secant method : xi 1 xi
f ( xi ) f ( xi 1 )

Chap6/10

SECANT METHOD

Requires 2 initial guesses: xi &


xi-1 that do not necessarily
bracket the root. Hence, NOT a
bracketing method !

Definition: Secant is a
straight line that intercepts a
curve at 2 or more points
Fig. 6.7

f ( xi )( xi 1 xi )
xi 1 xi
f ( xi 1 ) f ( xi )
Similarity to false-position

method:

f xu xL xu
xr xu
f xL f xu

2 initial guesses of xi and xi-1

Chap6/11

SECANT METHOD

Chord / Secant

Secant method requires


TWO guesses: x1 and x2

Chap6/12

SECANT METHOD
ALGORITHM
STEP 1 : Assume 2 initial guesses for xi and xi-1 at i=0
STEP 2 : Calculate the value of xi+1 using
f ( xi )( xi 1 xi )
xi 1 xi
f ( xi 1 ) f ( xi )

STEP 3 : Calculate the error |a|

i = 0,1,2,3,

xi 1 xi
100
xi 1

STEP 4 : Repeat STEP 2 until a < pre-specified value, then


set root = xi+1
NOTE: Convergence is not guaranteed for all xo

Chap6/13

CLASS ACTIVITY
Use three iterations to determine the root of f(x) = ex x by
using Secant Method with initial estimate of x-1=0 and
x0=1.0. Also calculate the estimated error, a after each
iteration.
f ( xi )( xi 1 xi )
xi 1 xi
f ( xi 1 ) f ( xi )
a

xi 1 xi
100
xi 1
Chap6/14

f(x) = ex x
x-1=0 and x0=1.0

xi 1 xi

f ( xi )( xi 1 xi )
f ( xi 1 ) f ( xi )

iter

x(i+1)

x(i-1)

xi

x(i-1)-xi

f(xi)

f(i-1)

eps(a) %

0.6127

0.0000

1.0000

-1.0000

-0.6321

1.0000

0.5638

1.0000

0.6127

0.3873

-0.0708

-0.6321

8.67

0.5672

0.6127

0.5638

0.0489

0.0052

-0.0708

0.59

Chap6/15

BRACKETING VS OPEN METHOD


BRACKETING Method

OPEN Method

Bracketing

Open method might


diverge or move away
from the true root
depending on the initial
guess (see pitfalls)

methods
can always converge to
a root.

Bracketing method is

slow to converge

When it converges, it
reaches results faster
than the bracketing
methods.
Chap6/16

FIXED-POINT ITERATION
Rearrange the function so that x is on the left side of the

equation: x = g(x)
For example: x2 x 2 = 0 can be manipulated to yield
x = x2 2
or
x = (x + 2)1/2
To obtain x = g(x)
or
x = (x + 2)/x
From an initial estimate of xi, the next estimate, xi+1 can be

ITERATIVELY computed by the function of xi+1 = g(xi)


The approximate percent error:

xi 1 xi
a
100%
xi 1

Chap6/17

EXAMPLE

Chap6/18

CLASS ACTIVITY
Use fixed-point iteration to find the root of x2 - 3x+2=0

Chap6/19

SOLUTION

Xi

eps(a)

0.0000

0.6667

100.00

0.8148

18.18

0.8880

8.24

0.9295

4.47

0.9547

2.64

0.9705

1.63

0.9806

1.03

0.9872

0.67

Chap6/20

FIXED-POINT ITERATION
CONVERGENCE
x =g(x) can be expressed as a

pair of equations:
f1(x) = x and
f2(x) = g(x)
Plot

these two equations


separately the intersection
of the two curves will be the
root !

The method is slower to

converge because
linearly convergent

it

is
Chap6/21

Figure 6.2

FIXED-POINT ITERATION
CONVERGENCE
Fixed-point methods may sometime diverge, depending

on the starting point (initial guess) and how the function


behaves (see Sec 6.1.1).
It will converge if the absolute slope

g ( x) 1 the absolute slope of y = g(x) is less


than the slope of y = x, see Fig 6.3 (p137)
When the method converges, the error is roughly

proportional to the error of the previous step, therefore it


is called linearly convergent.
Chap6/22

FIXED-POINT ITERATION
CONVERGENCE
|g(x)|<1
converge

|g(x)|<1
converge

|g(x)|>1

|g(x)|>1

diverge

diverge

Chap6/23

THANK YOU