Module 1 - Solution of Non-Linear Equations_Notes
Module 1 - Solution of Non-Linear Equations_Notes
1
Types of equations Bisection Method Regula-Falsi Method Iteration Method Newton-Raphsons Method Secant Method Systems of equations Convergence
Table of Contents
1. Types of equations
2. Bisection Method
3. Regula-Falsi Method
4. Iteration Method
5. Newton-Raphsons Method
6. Secant Method
7. Systems of equations
8. Convergence of Methods
2
Types of equations Bisection Method Regula-Falsi Method Iteration Method Newton-Raphsons Method Secant Method Systems of equations Convergence
Types of equations
3
Types of equations Bisection Method Regula-Falsi Method Iteration Method Newton-Raphsons Method Secant Method Systems of equations Convergence
Indirect/Iterative Methods
4
Types of equations Bisection Method Regula-Falsi Method Iteration Method Newton-Raphsons Method Secant Method Systems of equations Convergence
Bisection Method
• This method uses the above theorem to find at least one root between a and
b.
• The algorithm:
Given an f(x) = 0
1. find an a and b, such that f(a)f(b) < 0
2. set xr = a+b2
3. 3.1. if f(a)f(xr ) < 0, the root lies in (a, xr ). Set b = xr and repeat step 2.
3.2. if f(a)f(xr ) > 0, the root lies in (xr , b). Set a = xr and repeat step 2.
3.3. if f(a)f(xr ) = 0, then xr is a root of the equation f(x) = 0. The process
can be terminated.
• In most cases, the exact solution will not be found so we need to put a
condition to stop the algorithm.
• Define ε = xr+1xr−xr as the error (can also be expressed as %) and stop the
algorithm when ε < εp where εp is a predetermined tolerance level.
5
Types of equations Bisection Method Regula-Falsi Method Iteration Method Newton-Raphsons Method Secant Method Systems of equations Convergence
Bisection Method
• Graphical representation
• This method always converges and will be able to find one of the roots in
the interval.
• This method is very simplistic and takes a long time to converge.
6
Types of equations Bisection Method Regula-Falsi Method Iteration Method Newton-Raphsons Method Secant Method Systems of equations Convergence
f(a)
xr = a − .(b − a)
f(b) − f(a)
af(b) − bf(a)
=
f(b) − f(a)
7
Types of equations Bisection Method Regula-Falsi Method Iteration Method Newton-Raphsons Method Secant Method Systems of equations Convergence
The algorithm:
Given an f(x) = 0
1. find an a and b, such that f(a)f(b) < 0
af(b)−bf(a)
2. set xr = f(b)−f(a)
3. 3.1. if f(a)f(xr ) < 0, the root lies in (a, xr ). Set b = xr and repeat step 2.
3.2. if f(a)f(xr ) > 0, the root lies in (xr , b). Set a = xr and repeat step 2.
3.3. if f(a)f(xr ) = 0, then xr is a root of the equation f(x) = 0. The process can
be terminated.
4. Repeat the process till desired accuracy εp is reached
8
Types of equations Bisection Method Regula-Falsi Method Iteration Method Newton-Raphsons Method Secant Method Systems of equations Convergence
9
Types of equations Bisection Method Regula-Falsi Method Iteration Method Newton-Raphsons Method Secant Method Systems of equations Convergence
Problems
1. x4 − x − 10 = 0
2. x = exp x1
3. x3 + x2 + x + 7 = 0
10
Types of equations Bisection Method Regula-Falsi Method Iteration Method Newton-Raphsons Method Secant Method Systems of equations Convergence
Iteration Method
• To find the root of f(x) = 0, rewrite it into a form x = ϕ(x)
3
e.g. f(x)
q = x +√ x2 − 2 = 0 can be rewritten as
2
x = 1+x , x = 2 − x3 , x = (2 − x2 )1/3 etc.
x1 = ϕ(x0 )
x2 = ϕ(x1 )
..
.
xn+1 = ϕ(xn )
11
Types of equations Bisection Method Regula-Falsi Method Iteration Method Newton-Raphsons Method Secant Method Systems of equations Convergence
Iteration Method
12
Types of equations Bisection Method Regula-Falsi Method Iteration Method Newton-Raphsons Method Secant Method Systems of equations Convergence
Iteration Method
Proof of convergence
ξ = ϕ(ξ)
x1 = ϕ(x0 )
∴ ξ − x1 = ϕ(ξ) − ϕ(x0 )
ϕ(ξ) − ϕ(x0 )
ϕ ′ (ξ0 ) = , x0 < ξ0 < ξ
(ξ − x0 )
=⇒ ξ − x1 = (ξ − x0 ) ϕ ′ (ξ0 ), x0 < ξ0 < ξ
Similarly,
13
Types of equations Bisection Method Regula-Falsi Method Iteration Method Newton-Raphsons Method Secant Method Systems of equations Convergence
Iteration Method
Assume |ϕ ′ (ξi )| ⩽ k, ∀i
Then,
|ξ − x1 | ⩽ k |ξ − x0 |
..
.
|ξ − xn+1 | ⩽ k |ξ − xn |
or,
|ξ − xn+1 | ⩽ kn+1 |ξ − x0 |
If k < 1, then as n → ∞, RHS → 0, =⇒ xn+1 → ξ
=⇒ ϕ(x) must be such that |ϕ′ (x)| < 1
Conditions on ϕ(x)
• ϕ(x) is continuous
• |ϕ ′ (x)| < 1
14
Types of equations Bisection Method Regula-Falsi Method Iteration Method Newton-Raphsons Method Secant Method Systems of equations Convergence
Iteration Method
15
Types of equations Bisection Method Regula-Falsi Method Iteration Method Newton-Raphsons Method Secant Method Systems of equations Convergence
Iteration Method
Error in the root
|ξ − xn | ⩽ k |ξ − xn−1 |
= k |ξ − xn + xn − xn−1 |
⩽ k (|ξ − xn | + |xn − xn−1 |)
k
or, |ξ − xn | ⩽ |xn − xn−1 |
1−k
k
⩽ .kn−1 |x1 − x0 |
1−k
kn
= |x1 − x0 |
1−k
=⇒ convergence will be faster for smaller k
k is also the maximum value of ϕ ′ (x) in the interval
Let ε be the accuracy defined as |ξ − xn | ⩽ ε
1−k
∴ |xn − xn−1 | ⩽ ε
k
16
Types of equations Bisection Method Regula-Falsi Method Iteration Method Newton-Raphsons Method Secant Method Systems of equations Convergence
Iteration Method
Problems
1. x3 + x2 − 1 = 0 in [0, 1] upto ε = 10−4
2. 2x − 3 = cos x in [ 21 , π2 ]
3. xex = 1 in [0, 1]
17
Types of equations Bisection Method Regula-Falsi Method Iteration Method Newton-Raphsons Method Secant Method Systems of equations Convergence
Newton-Raphson’s Method
Let x0 be an approximate root for the equation f(x) with x1 = x0 + h being
the true root i.e. f(x1 ) = 0.
Expanding f(x0 + h) using Taylor series expansion,
h2 ′′ h3
f(x0 + h) = f(x0 ) + hf ′ (x0 ) + f (x0 ) + f ′′′ (x0 ) + . . . = 0
2! 3!
Neglecting the higher order terms (second and above),
f(x0 )
h=−
f ′ (x0 )
f(x0 )
∴ x0 + h = x1 = x0 −
f ′ (x0 )
Thus,
f(xn )
xn+1 = xn − n = 0, 1, 2 . . .
f ′ (xn )
18
Types of equations Bisection Method Regula-Falsi Method Iteration Method Newton-Raphsons Method Secant Method Systems of equations Convergence
Newton-Raphson’s Method
Proof of Convergence
Comparing NR method to Iteration method
xn+1 = ϕ(xn )
f(x)
ϕ(x) = x −
f ′ (x)
which gives
f(x)f ′′ (x)
ϕ ′ (x) =
|f ′ (x)|2
If we can find a small region around the root ξ where this holds then the
method will converge.
19
Types of equations Bisection Method Regula-Falsi Method Iteration Method Newton-Raphsons Method Secant Method Systems of equations Convergence
Newton-Raphson’s Method
Graphical Representation
The derivative of a function f ′ (x) represents the tangent of the function (f(x))
at any point xi . Thus the tangent at any point is used to get the next step in
the iteration
This method, if it converges, does so faster than any of the previous methods
discussed.
20
Types of equations Bisection Method Regula-Falsi Method Iteration Method Newton-Raphsons Method Secant Method Systems of equations Convergence
Newton-Raphson’s Method
Problems
1. x3 − 2x − 5 = 0
2. 4e−x sin x − 1 = 0
√
3. Find 15 using Newton-Raphson’s Method
4. Find N1/k using NR method
21
Types of equations Bisection Method Regula-Falsi Method Iteration Method Newton-Raphsons Method Secant Method Systems of equations Convergence
Secant Method
The derivative of a function f ′ (x) cannot always be estimated a-priori so an
approximation can be used instead
Let
f(xi ) − f(xi−1 )
f ′ (xi ) =
xi − xi−1
22
Types of equations Bisection Method Regula-Falsi Method Iteration Method Newton-Raphsons Method Secant Method Systems of equations Convergence
Secant Method
Note that this method requires two initial approximations
Graphical Representation
Secant Method
Problems
1. x3 − 2x − 5 = 0
2. 4e−x sin x − 1 = 0
3. xex = 1
24
Types of equations Bisection Method Regula-Falsi Method Iteration Method Newton-Raphsons Method Secant Method Systems of equations Convergence
x1 = x0 + h
y 1 = y0 + k
Problems
• f(x, y) = 3yx2 − 10x + 7
g(x, y) = y2 − 5y + 4
• sin x − y = −0.9793
cos y − x = −0.6703
27
Types of equations Bisection Method Regula-Falsi Method Iteration Method Newton-Raphsons Method Secant Method Systems of equations Convergence
Rate of Convergence
Definition
An iterative method is said to be of order p or has the rate of convergence p, if p is
the largest positive real number for which there exists a finite constant
C ̸= 0, such that
εk+1 ⩽ C|εk |p
The constant C, which is independent of k, is called the asymptotic error
constant and it depends on the derivatives of f(x) at x = ξ
28
Types of equations Bisection Method Regula-Falsi Method Iteration Method Newton-Raphsons Method Secant Method Systems of equations Convergence
Bisection Method
• Starting from the initial guesses of x1 and x2 , in each step the interval
containing the root is reduced by a factor of 2
x2 −x1 ∆x
• When repeated n times the interval reduces to 2n = 2n
2n |
• ∴ Error at the nth step, εn = | ∆x
Similarly, εn+1 = | 2∆x
n+1 | = 2
εn
• That is, error decreases linearly by a factor of 0.5. In other words, bisection
method is linearly convergent.
29
Types of equations Bisection Method Regula-Falsi Method Iteration Method Newton-Raphsons Method Secant Method Systems of equations Convergence
Newton-Raphson’s Method
30
Types of equations Bisection Method Regula-Falsi Method Iteration Method Newton-Raphsons Method Secant Method Systems of equations Convergence
Other methods
31