Nonlinear Equations in One Variable PDF

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 29

Numerical Solution of

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

Bolzano’s intermediate value theorem. If f is


continuous in I = [a, b] and f(a) ⋅ f(b) < 0, then f
has at least one root in s ∈ I.
Bisection Method
Bisection Method
(Example)

•  Solve f ( x ) = x 2 − 3x +1
–  Analytical solution: x = 2.618034 and 0.381966

•  Solution
Bisection Method : Pseudo-code

Source: Engeln-Mullges G. and Uhlig F. Numerical Algorithms with C, Springer, © 1996


Fixed-Point Iteration
(Method of Successive Substitution)
Fixed-Point Iteration
(Graphical interpretation)

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"

Fixed-point method: 3.5"

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

Oscillating convergence Monotonic convergence


-1 < g’ < 0 0 < g’ < 1

Sufficient condition for convergence: |dg/dx| < 1


Fixed-Point Iteration
Fixed-Point Iteration
(General Procedure)

1.  Find an interval I that you know to contain


the solution r to the equation.
2.  Transform the equation to the form x =
g(x). Estimate g’(x) over the interval.
3.  If |g’(x)| is less than 1 over the interval,
then use g.
4.  Otherwise, choose a new transformation x
= g(x) and begin again.
Newton’s Method
Newton’s Method
Geometric Interpretation

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

Source: Engeln-Mullges G. and Uhlig F. Numerical Algorithms with C, Springer, © 1996


Newton’s Method
(Example)

•  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)

Given a function f (x) continuous on an


interval [a,b] such that f (a) * f (b) < 0

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)

Find the root of

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.

You might also like