You are on page 1of 36

OPEN

METHODS
FIXED
POINT
METHOD
Fixed Point Iteration

If the equation, f (x) = 0 is rearranged in


the form
x = g(x)
then an iterative method may be written as
xn+1 = g(xn)
n = 0; 1; 2; : : : (1)

where n is the number of iterative steps and


x0 is the initial guess.
This method is called the Fixed Point
Iteration or Successive.
DENITION OF FIXED POINT
If c = g(c), the we say c is a xed point for the
function g(x).

THEOREM
Fixed Point Theorem ( FPT )

Let g Є C[a; b] be such that g(x) Є [a; b], for all x


in [a; b].
Suppose, in addition, that g`(x) exists on (a, b). Assume
that a constant K exists with

|g`(x)| K < 1; for all x in (a,


b)

Assume that c in (a, b) is a fixed point for g. Then


if Xo is any point in (a, b), the sequence

xn+1 = g(xn)
n = 0; 1; 2; : : :
3


1 1 2


1


2


3


4
O N
H S
A P
- R O D
O N H
W T E T
N E M
NEWTON-RAPHSON
METHOD
f(x)

f(xi)
[x f( x )] f(xi )
i, i xi +1 = xi -
f ′(xi )

f(xi-1)

θ
xi+2 xi+1 xi X

Figure 1 Geometrical illustration of the Newton-Raphson


9
method. http://numericalmethods.eng.usf.edu
Derivation
f(x)

AB
f(xi) B tan(α ) =
AC

f ( xi )
f ' ( xi ) =
xi − xi +1
C α A X f ( xi )
xi+1 xi xi +1 = xi −
f ′( xi )

Figure 2 Derivation of the Newton-Raphson method.


10
http://numericalmethods.eng.usf.edu
Algorithm for
Newton-
Raphson
Method
11
http://numericalmethods.eng.usf.edu
Step 1

Evalua
 f ′(x)sym b o lica lly.
te

12 http://numericalmethods.eng.usf.edu
Step 2
Use an initial guess of x
the root, to estimate i

the new value of the root,


xi +1
, as
f ( xi )
xi +1 = xi -
f ′ ( xi )
13 http://numericalmethods.eng.usf.edu
Step 3
Fin d th e a b so lu te ∈a
re la tive a p p roxim a te
e rro r a s
xi + 1- xi
∈a = × 1 00
xi + 1
14 http://numericalmethods.eng.usf.edu
Step 4
 Compare the absolute relative approximate
error with the pre-specified relative error∈
s
tolerance .
 Go to Step 2 using
Yes new estimate of the

Is ∈a >∈s root.
 ?

 No Stop the algorithm



 Also, check if the number of iterations has
exceeded the maximum number of iterations
allowed. If so, one needs to terminate the
algorithm and notify the user.
15 http://numericalmethods.eng.usf.edu
Example 1
 You are working for ‘DOWN THE TOILET
COMPANY’ that makes floats for ABC commodes.
The floating ball has a specific gravity of 0.6 and
has a radius of 5.5 cm. You are asked to find the
depth to which the ball is submerged when
floating in water.

Figure 3 Floating ball


16 problem. http://numericalmethods.eng.usf.edu
Example 1 Cont.

The equation that gives the depth x
in meters to which the ball is submerged
under water is given by

f ( x ) = x 3-0.165 x 2+3.993 ×10 - 4

Figure 3 Floating ball


problem.
U se th e N e w to n ’ s m e th o d o f fin d in g ro o ts o f e q u a tio n s to fin d
a) th e d e p th ‘ x ’ to w h ich th e b a llis su b m e rg e d u n d e r w a te r.
C o n d u ct th re e ite ra tio n s to e stim a te th e ro o t o f th e a b o ve
e q u a tio n .
b) T h e a b so lu te re la tive a p p roxim a te e rro r a t th e e n d o f e a ch
ite ra tio n , a n d
c) T h e n u m b e r o f sig n ifica n t d ig its a t le a st co rre ct a t th e e n d o f
e a ch ite ra tio n .
17 http://numericalmethods.eng.usf.edu
Example 1 Cont.

f ( x) = x − 0.0 x + 23.4x1 = 0
3 2 −6
Solution
To a id in th e
u n d e rsta n d in g o f h o w
th is m e th o d w o rks to fin d
th e ro o t o f a n e q u a tio n ,
th e g ra p h o f f( x ) is sh o w n
to th e rig h t, w h e re

f ( x ) = x 3-0.165 x 2+3.993 ×10- 4


Figure 4 Graph of the function
f(x)
http://numericalmethods.eng.usf.edu 18
Example 1 Cont.

Solve for f ' ( x )


f ( x ) = x 3-0.165 x 2+3.993 × 10- 4
f ' ( x ) = 3x 2 -0.33x
Le t u s a ssu m e th e in itia lg u e ss o f th ef ro( xo) t= o0f
x0 = 0.is
05m
x=0 x = 0.11m T
T h is is a re a so n a b le g u e ss ( d iscu ss w h y
and a re n o t g o o d
ch o ice s) a s th e extre m e va lu e s o f th e d e p th x
would be 0 and the diameter (0.11 m) of the ball.
19
Example 1 Cont.

Ite ra tio n 1
T h e e stim a te o f th e ro o t is
f ( x0 )
x1 = x0 −
f ' ( x0 )

= 0.05 −
( 0.05 ) −0.165 ( 0.05 ) +3.993
3 2
×10 −4
3( 0.05 ) −0.33 ( 0.05 )
2

1.118 ×10 −4
= 0.05 −
−9 ×10 −3
= 0.05 −( −0.01242 )
= 0.06242
20
Example 1 Cont.

Figure 5 Estimate of the root for the first


iteration. 21
Example 1 Cont.

∈a e rro r
T h e a b so lu te re la tive a p p roxim a te at
th e e n d o f Ite ra tio n 1 is
x1 − x0
∈a = ×100
x1
0.06242 − 0.05
= ×100
0.06242
=19 .90 %

T h e n u m b e r o f sig n ifica n t d ig its a t le a st co rre ct


is 0 , a s yo u n e e d a n a b so lu te re la tive
a p p roxim a te e rro r o f 5 % o r le ss fo r a t le a st o n e
sig n ifica n t d ig its to b e co rre ct in yo u r re su lt.
22
Example 1 Cont.
Ite ra tio n 2
T h e e stim a te o f th e ro o t is

f ( x1 )
x2 = x1 −
f ' ( x1 )

= 0.06242 −
( 0.06242 ) − 0.165 ( 0.06242 ) +3.993 ×10 −4
3 2

3( 0.06242 ) −0.33 ( 0.06242 )


2

−3.97781 ×10 −7
= 0.06242 −
−8.90973 ×10 −3
(
= 0.06242 − 4.4646 ×10 −5 )
= 0.06238

23
Example 1 Cont.

Figure 6 Estimate of the root for the


Iteration 2. http://numericalmethods.eng.usf.edu 24
Example 1 Cont.

T h e a b so lu te re la tive a p p roxim a te∈ae rro r at


th e e n d o f Ite ra tio n 2 is
x2 −x1
∈a = ×100
x2
0.06238 −0.06242
= ×100
0.06238
=0.0716 %
T h e m a xim u m va lu e o f m for∈awhich
≤ 0.5 ×10 2 −m
is 2.844. Hence, the number of
significant digits at least correct in the
answer is 2.
25
Example 1 Cont.
Ite ra tio n 3
T h e e stim a te o f th e ro o t is

f ( x2 )
x3 = x2 −
f ' ( x2 )

= 0.06238 −
( 0.06238 ) − 0.165 ( 0.06238 ) + 3.993 ×10 −4
3 2

3( 0.06238 ) − 0.33 ( 0.06238 )


2

4.44 ×10 −11


= 0.06238 −
−8.91171 ×10 −3
(
= 0.06238 − − 4.9822 ×10 −9 )
= 0.06238
26
Example 1 Cont.

Figure 7 Estimate of the root for the


Iteration 3. http://numericalmethods.eng.usf.edu 27
Example 1 Cont.

∈ae rro r
T h e a b so lu te re la tive a p p roxim a te at
th e e n d o f Ite ra tio n 3 is
x2 − x1
∈a = ×100
x2
0.06238 − 0.06238
= ×100
0.06238
= 0%

T h e n u m b e r o f sig n ifica n t d ig its a t le a st


co rre ct is 4 , a s o n ly 4 sig n ifica n t d ig its a re
ca rrie d th ro u g h a llth e ca lcu la tio n s.

http://numericalmethods.eng.usf.edu 28
Secant Method
• The secant method is nota
bracketing method. It starts from
two initial points and draws a
straight line between these points.
Secant method
10

previous
f(x)

0
0 0.5 1 1.5 2 2.5 3 3.5 4
-5
oldest
-10
29
x
Secant Method
• A new x value is chosen by finding
where this straight line crosses the
k −1
x-axis:x k +1 = x k − f ( x k
)( x k
− x )
k −1
• f ( x k
) − f ( x )
Secant method
10

previous
f(x)

0
0 0.5 1 1.5 2 2.5 3 3.5 4
-5
oldest
-10
30
x
Secant Method
• This new value replaces the oldest x
value being used in the calculation.

Secant method
10

previous
f(x)

0
0 0.5 1 1.5 2 2.5 3 3.5 4
-5
oldest
-10
31
x
Secant Method: Example
Secant method

10

5
f(x)

0
0 0.5 1 1.5 2 2.5 3 3.5 4
-5

-10
x

xo x1 f(xo) f(x1) x2 f(x2)


0 4 -7 1 3.5 -0.875
4 3.5 1 -0.875 3.733333 -0.263407
3.5 3.733333 -0.875 -0.263407 3.833828 0.136445
3.733333 3.833828 -0.263407 0.136445 3.799535 -0.009913
3.833828 3.799535 0.136445 -0.009913 3.801858 -0.000329
Secant Method:
Convergence
• Because the secant method is not a
bracketing method it may not
converge. But when the method
converges it can be shown to have
an order of convergence which is:
• 1+ 5
≈ 1.618
• 2
 (Golden ratio, Plato, 400BC)

33
Secant Method:
Convergence
• Sometimes it is good to start finding
a root using the bisection method
then once you know you are close
to the root you can switch to the
secant method to achieve faster
convergence.

34
Secant Method: Failure
• If the function is very “flat” the
secant method can fail, for
example:Secant method 1
f ( x) =
• 1 ( x + 1) − 2
2

oldest first iteration


0.5
f(x)

0
0 0.5 1 1.5 2 2.5 3 3.5 4
previous
-0.5 new
second iteration
-1
x
35
Secant Method: Failure
• The numerical values associated with
the “failure” example are:

xo x1 f(xo) f(x1) x2 f(x2)
0 4 0.5 -0.46 2.083333 -0.394814
4 2.083333 -0.46 -0.394814 -9.525344 -1639.735
2.083333 -9.525344 -0.394814 -0.486241 52.21333 123986

36

You might also like