Professional Documents
Culture Documents
CH 06
CH 06
~Roots of Equations ~
Open Methods
2
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Bracketing methods
(a) In the bisection method the
root is constrained within
the interval [ xl, xu ]
Open methods
3
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Simple Fixed-Point Iteration
• Given an equation f(x)=0
• Convert f(x)=0 in to the form x=g(x)
f ( x) 0 x g ( x)
If algebraic manipulation doesn’t work, just add x to both sides
f ( x) 0 x f ( x) x
• Let the initial guess be x0
• Then iterate
xi 1 g ( xi )
until the termination criteria is satisfied
Termination criteria
xi 1 xi
a s OR Max.Iteration is reached
xi 1 4
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Example 6.1:
Use simple fixed point iteration to locate the root of f ( x) e x x
with an initial guess of x0=0. Iterate until the estimated error εa falls
below a level of εs=0.01
Iter. no xi εa
0 0
1 1
2 0.36788 1.71828
3 0.69220 0.46854
4 0.50047 0.38309
5 0.60624 0.17447
6 0.54540 0.11157
7 0.57961 0.05903
8 0.56012 0.03481
9 0.57114 0.01931
10 0.56488 0.01109
11 0.56843 0.00624
5
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Convergence properties
– May not converge
– If it converges it converges linearly (the error is
roughly proportional to the error of the previous step)
– Convergence depends on the function characteristics
and starting point (initial guess).
6
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Fixed point theorem
7
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
8
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Example 6.2:
Iter. no xi εa
0 1
1 1.2599
2 1.3123 0.0399
3 1.3224 0.0076
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Newton-Raphson Method
f ( xi 1 ) f ( xi ) f ( xi )( xi 1 xi ) R1
The root is the value of x i 1 when f(x i 1 ) 0
Rearrangin g,
0 f(xi ) f (xi )( xi 1 xi )
f ( xi )
xi 1 xi Newton-Raphson formula
f ( xi )
10
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Newton-Raphson Method
f ( xi ) 0
f (xi )
( xi xi 1 )
f ( xi )
xi 1 xi
f ( xi )
11
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Newton-Raphson Method
Step 4: Calculate
xi 1 xi
a
xi 1
13
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Example 6.4:
14
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Example 6.5:
x1
Determine the real root of sin( 2 x ) e
correct to 2 significant digits using Newton-Raphson Method
with an initial guess of x0=0.
15
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
• Newton-Raphson is an efficient method if f’(x) (the derivative)
can be evaluated analytically
• Rate of convergence is quadratic, i.e. the error is roughly
proportional to the square of the previous error
Ei+1=O(Ei2)
**Proof will be given in class
But:
• It does not always converge
• There is no convergence criterion. Convergence depends on
the nature of the function and on the accuracy of the initial
guess.
16
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Diverges because f''(x)=0 in
the vicinity of the root.
17
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Secant Method
• Requires two initial
estimates xi and xi-1.
• However, it is not a
“bracketing method”
because f(x) is not required
to change signs between
estimates.
• The Secant Method has the
same properties as
Newton’s method.
• Convergence is not
guaranteed
18
18
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Secant Method
df f ( xi ) f ( xi 1 )
f ( xi ) substitute this into NR equation
dx xi xi 1
xi xi 1
xi 1 xi f ( xi ) i 1,2,3,
f ( xi ) f ( xi 1 )
19
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Secant Method
Step 1: Choose two initial guesses xi and xi-1 for the root
Step 2: Calculate f(xi) and f (xi-1)
Step 3: Estimate the root to be
xi xi 1
xi 1 xi f ( xi )
f ( xi ) f ( xi 1 )
Step 4: Calculate
xi 1 xi
a
xi 1
21
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Example 6.7:
Determine the real root of f ( x) e x x
using Secant Method with initial estimates of x-1=0 and x0=1.
Iterate until the estimated error εa falls below a level of εs=0.01.
Give your answers using 4 decimal digits with rounding.
22
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Secant Method vs. False-Position Method
• False-Position method always brackets the root
• False-Position will always converge
• Secant method may not converge
• Secant method usually converges much faster
23
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Modified Secant Method
•Instead of using two arbitrary values to estimate the derivative,
we define a small δ (perturbation fraction)
f ( xi xi ) f ( xi )
f ( xi )
xi
Substitute this derivative back into the equation:
xi
xi 1 xi f ( xi )
f ( xi xi ) f ( xi )
How to choose δ:
•If δ is too small, then the method will involve too much round-off error.
•If δ is too large, then the method is inefficient and may diverge
24
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Example 6.8:
iteration xi f(xi) εa
0 0.6 0.0026
1 0.5848 0.0008
2 0.5772 0.00025 0.0132
25
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
A computer program for the root-finding methods
26
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Multiple Roots
f ( x ) ( x 3)( x 1)2
27
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
1. Bracketing methods don’t work for the multiple roots.
2. Both f(x) & f´(x) goes to 0 at the root
3. Newton-Raphson and Secant Methods are linearly convergent for multiple
roots ( Ralston and Rabinowitz, 1978)
f ( xi ) f ( xi ) u ( xi )( xi 1 xi )
xi 1 xi xi 1 xi
f ( xi )2 f ( xi ) f ( xi ) u( xi 1 ) u ( xi )
These equations are preferable for multiple roots but less efficient for single root
28
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Example 6.9: Use both the standard and modified Newton-Raphson
methods to evaluate the multiple root of
f ( x ) ( x 3)( x 1)( x 1)
29
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
The results for multiple roots
Modified Newton-Raphson method