Professional Documents
Culture Documents
Nonlinear Equations in One Variable PDF
Nonlinear Equations in One Variable PDF
Nonlinear Equations
in One Variable
Introduction
Iterative Methods
• Bisection Method
• Fixed-point iteration
• Newton’s method
• Secant method
• Regula-falsi method
Iterative Methods
• No numerical procedure works for all equations
• The root depends on the guess
• Measurement of accuracy of estimate depends
on:
Ø Absolute Error: en = xn+1 − xn ≤ ε
xn+1 − xn
Ø Relative Error: dn = ≤ε
xn+1
Ø Error Ratio:
xn+1
rn ≅ →1.0
xn
• Mitigation of non-convergence
Inclusion Methods
• Bisection method
• Regula falsi
• Secant method
• Solve f ( x ) = x 2 − 3x +1
– Analytical solution: x = 2.618034 and 0.381966
• Solution
Bisection Method : Pseudo-code
y
y = f (x)
x
The x-coordinate of the
intersection of y = x and
y=x
y y = f(x) is the value of
y = g (x) the root
x
Fixed-Point Iteration
(Example)
• Solve
f ( x ) = x 2 − 3x +1
• Solution:
Analytical: x = 2.618034 and 0.381966
4"
3"
g1 ( x ) = ( x 2 +1) 3 2.5"
2"
g2 ( x ) = 3−1 x 1.5"
1"
g3 ( x ) = 3x −1 0.5"
0"
0" 0.5" 1" 1.5" 2" 2.5" 3" 3.5" 4"
Fixed-Point Iteration
(Solution to Example)
g1 ( x ) = ( x 2 +1) 3 g2 ( x ) = 3−1 x g3 ( x ) = 3x −1
Fixed-Point Iteration
(Condition of Convergence)
Let r be the root of the equation
x = g (x)
By Taylor’s theorem
g(x) = g(r) + (x - r) g’(r) + …
But g(r) = r, so we have
g(x) – r ≈ (x - r) g’(r)
But we’re iterating g: that is, evaluating it repeatedly. It follows that if our
nth estimate is xn, then
xn+1 = g(xn)
So from the above, we have that
(xn+1 - r) ≈ g’(r)(xn – r)
In other words, the distance between our estimate and the root gets
multiplied by g’(r) (approximately) with each iteration. So the iteration
converges if
| g’(r) | < 1
Fixed-Point Iteration
Function
Tangent
Newton’s Method
Notes on Convergence
• Poor initial estimate
• Termination at a stationary point
• Difficulty in calculating the
derivative of a function
– Use secant method
Newton’s Method : Pseudo-code
• Solve
2
f ( x ) = x − 3x +1
• Analytical solution: x = 2.618034 and 0.381966
• Solution
Secant Method
Secant Method
Regula-Falsi for Simple Root
(False Position Method)
Regula-Falsi for Simple Root
(False Position Method)
Do
c = a*f(b) - b*f(a)
f(b) - f(a)
if f (a) * f (c) < 0 then
b=c
else a = c
while (convergence criterion is not satisfied)
Regula-Falsi Method
(Example)
3x + sin(x) – exp(x) = 0
Solution:
Summary
• Bisection Method
• Fixed-point iteration
• Newton’s method
• Secant method
• Regula-falsi method
Exercises
References
• Engeln-Mullges G. and Uhlig F. Numerical Algorithms with C,
Springer, © 1996
• Carnahan B., et.al., Applied Numerical Methods, John Wiley & Sons,
Inc., © 1969.