Professional Documents
Culture Documents
Roots: Open Methods: Berlin Chen
Roots: Open Methods: Berlin Chen
Berlin Chen
Department of Computer Science & Information Engineering
National Taiwan Normal University
Reference:
1. Applied Numerical Methods with MATLAB for Engineers, Chapter 6 & Teaching material
Chapter Objectives (1/2)
• Recognizing the difference between bracketing and open
methods for root location
• Understanding the fixed-point iteration method and how
you can evaluate its convergence characteristics
• Knowing how to solve a roots problem with the Newton-
Raphson method and appreciating the concept of
quadratic convergence
b b 2 4ac
ax bx c 0
2
x
2a
ax 5 bx 4 cx 3 dx 2 ex f 0 x ?
sin x x 0 x ?
NM – Berlin Chen 2
Chapter Objectives (2/2)
NM – Berlin Chen 3
Recall: Taxonomy of Root-finding Methods
Nonlinear Equation
Solvers
Chapter 5
Chapter 5 Chapter 6
– We can also employ a hybrid approach (Bracketing + Open Methods)
NM – Berlin Chen 4
Open Methods
NM – Berlin Chen 5
Graphical Comparison of Root-finding Methods
NM – Berlin Chen 6
Simple Fixed-Point Iteration
xi 1 xi
a 100%
xi 1
NM – Berlin Chen 7
Simple Fixed-Point Iteration: An Example (1/2)
• Solve f(x)=e-x-x
• Re-write as x=g(x) by isolating x
(example: x=e-x)
• Start with an initial guess (here, 0)
i xi |a| % |t| % |t|i/|t|i-1
0 0.0000 100.000
1 1.0000 100.000 76.322 0.763
2 0.3679 171.828 35.135 0.460
3 0.6922 46.854 22.050 0.628
4 0.5005 38.309 11.755 0.533
The true percent relative error is roughly proportional (a factor of about
0.5 to 0.6) to the error from the previous iteration.
x0 x2 x3 x1
NM – Berlin Chen 9
Convergence
• Convergence of the simple fixed-
point iteration method requires
that the derivative of g(x) near the
root has a magnitude less than 1
1) Convergent, 0≤g’<1
2) Convergent, -1<g’≤0
3) Divergent, g’>1
4) Divergent, g’<-1
Chapra and Canale (2010) have shown that
the error for any iteration is linearly
proportional to the error from the
previous iteration multiplied by the
absolute value of the slope (derivative)
of g(x):
Ei 1 g Ei NM – Berlin Chen 10
Newton-Raphson Method
f ( xi ) 0
f ( xi )
xi xi 1
f ( xi )
xi 1 xi
f ( xi )
NM – Berlin Chen 11
Newton-Raphson Method: Pros and Cons
Chapra and Canale (2010) have shown that
the error is roughly proportional to the
square of the previous error:
f xi 2
Et ,i 1 Et ,i
2 f xi
NM – Berlin Chen 12
Secant Methods (1/2)
f (x i1 ) f (x i )
f (x i )
'
x i1 x i
NM – Berlin Chen 13
Secant Methods (2/3)
f (x i )x i1 x i
x i1 x i
f (x i1) f (x i )
NM – Berlin Chen 14
Secant Methods (3/3)
f ( xi xi ) f ( xi xi )
f ( xi )
xi
xi f ( xi )
xi 1 xi
f ( xi xi ) f ( xi xi )
NM – Berlin Chen 15
Brent’s Root-location Method
• A hybrid approach that combines the reliability of
bracketing with the speed of open methods
– Try to apply a speedy open method whenever possible, but
revert to a reliable bracketing method if necessary
• That is, in the event that the open method generate an
unacceptable result (i.e., an estimate falling outside the
bracket), the algorithm reverts to the more conservative
bisection method
– Developed by Richard Brent (1973)
This form is also called a Lagrange polynomial.
NM – Berlin Chen 17
Inverse Quadratic Interpolation (2/4)
NM – Berlin Chen 18
Inverse Quadratic Interpolation (3/4)
The inverse quadratic
interpolation x=f(y)
always intersect the x axis.
NM – Berlin Chen 19
Inverse Quadratic Interpolation (4/4)
yi 1 yi yi 2 yi yi 2 yi 1
xi 1 xi 2 xi 1 xi
( yi 2 yi 1 )( yi 2 yi ) ( yi 1 yi 2 )( yi 1 yi ) ( yi yi 2 )( yi yi 1 )
NM – Berlin Chen 20
An Example Function for the Brent’s Method
NM – Berlin Chen 21
MATLAB’s fzero Function
NM – Berlin Chen 23
fzero Example
NM – Berlin Chen 24
Polynomials (1/2)