0% found this document useful (0 votes)
9 views22 pages

Lecture 3

The document discusses root finding problems in numerical methods, specifically focusing on identifying values where a continuous function equals zero. It outlines various solution methods, including analytical, graphical, and numerical approaches, with a detailed explanation of the Bisection Method for finding roots. The document also highlights the advantages and disadvantages of the Bisection Method and concludes with a homework exercise.

Uploaded by

Sheri Gaming
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views22 pages

Lecture 3

The document discusses root finding problems in numerical methods, specifically focusing on identifying values where a continuous function equals zero. It outlines various solution methods, including analytical, graphical, and numerical approaches, with a detailed explanation of the Bisection Method for finding roots. The document also highlights the advantages and disadvantages of the Bisection Method and concludes with a homework exercise.

Uploaded by

Sheri Gaming
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

Lecture 3

Numerical Methods
[MA-200]
Root Finding Problems
Many problems in Science and Engineering are expressed as:

Given a continuous function f(x),


find the value r such that f(r)=0

These problems are called root finding problems


Root of the equation
A number r that satisfies an equation is called a root of the equation.
Let 𝑓 𝑥 = 𝑥 2 + 4𝑥 + 3
𝑥 2 + 4𝑥 + 3 = 0
𝑥 2 + 3𝑥 + 𝑥 + 3 = 0
𝑥 𝑥+3 +1 𝑥+3 = 0
𝑥 + 3 (𝑥 + 1) = 0
𝑥 = −1, −3
Verify
𝑥 = −1
(−1)2 +4 −1 + 3 = 0
0=0
Same you can verify zeros of f(x) at 𝑥 = −3
Zeros of a Function
Let f(x) be a real-valued function of a real variable. Any number r for
which f(r)=0 is called a zero of the function.
Recall:
𝑓 𝑥 = 𝑥 2 + 4𝑥 + 3
𝑥 2 + 3𝑥 + 𝑥 + 3 = 0
𝑥 𝑥+3 +1 𝑥+3 = 0
𝑥+3 𝑥+1 =0
𝑥 = −1, −3
So, 𝑥 = −1, −3 are zeros of the function f(x)
Solution Methods

Several ways to solve nonlinear equations are possible

1. Analytical Solutions

2. Graphical Solutions

3. Numerical Solutions
1. Analytical Methods

Analytical Solutions are available for special equations only.

Analytical solution for 𝑎𝑥 2 + 𝑏𝑥 + 𝑐 = 0

−𝑏 ± 𝑏 2 − 4𝑎𝑐
𝑅𝑜𝑜𝑡𝑠 =
2𝑎

No analytical solution is available for: x − 𝑒 𝑥 = 0


2. Graphical Methods

Example:
𝑥 − 𝑒 −𝑥 = 0

Root ≈ 0.6
3. Numerical Methods

Many methods are available to solve nonlinear equations

• Bisection Method

• Newton Raphson Method

• Secant Method

• False Position Method


Roots of Equations…
Non-Linear Equation
Solvers

Bracketing Graphical Open Methods

Bisection, False Newton-Raphson,


Position Secant
Bisection Method
• The Bisection method is one of the simplest methods to find a zero of a
nonlinear function.
• It is also called interval halving method.
• To use the Bisection method, one needs an initial interval that is known to
contain a zero of the function.
• The method systematically reduces the interval. It does this by dividing the
interval into two equal parts, performs a simple test and based on the result
of the test, half of the interval is thrown away.
• The procedure is repeated until the desired interval size is obtained.
Working Procedure
i. f(x) is continuous on [a , b]

ii. If 𝑓 𝑎 . 𝑓(𝑏) < 0, then f(x)=0 has solution in interval [a , b]

iii. Calculate 𝑥1 using the arithmetic mean

𝑎+𝑏
𝑥1 =
2
iv. Calculate f(𝑥1 ), then find f(𝑥1 ).f(a) and f(𝑥1 ).f(b)

If f(𝑥1 ).f(a) < 0 then f(x)=0 has solution in [a, 𝑥1 ] and no solution in [𝑥1 ,b]
If f(𝑥1 ).f(b) < 0 then f(x)=0 has solution in [ 𝑥1 , b] and no solution in [a, 𝑥1 ]

v. Continue the process until 𝑥𝑛+1 − 𝑥𝑛 ≤ 𝜖, for given 𝜖


Example:
Find a root of the equation f(x)= 𝒙𝟐 -2 by using bisection method.
Solution:
1st way to find interval:
Let, 𝑓 𝑥 = 0
𝑥2 − 2 = 0
𝑥2 = 2

𝑥= 2
𝑥 = 1.4142

1.4142 is between 1 and 2. So, take interval [1 , 2]


Cont.
2nd way to find interval:

Let, 𝑓 𝑥 = 𝑥2 − 2
𝑓 0 = 02 − 2 = −2
𝑓 1 = 12 − 2 = −1
𝑓 2 = 22 − 2 = 2
𝑓 3 = 32 − 2 = 7

𝑓 1 . 𝑓 2 = −1 . 2 = −2 < 0

Hence, The solution exist in the interval [1, 2]


Cont.
Step:1
To check f(x)= 𝑥 2 -2 is continuous on [1 , 2]
Since, f(x)= 𝑥 2 -2
𝑓 1 = 12 − 2 = −1
𝑓 2 = 22 − 2 = 2
So, f(x) is continuous on [1,2].
Step:2
We have 𝑓(1) = −1 and 𝑓(2) = 2
𝑓 1 . 𝑓 2 = −1 2 = −2 ≤ 0
So, solution f(x)= 𝑥 2 -2=0 exist in interval [1 , 2]
Cont.
Step: 3
Calculate 𝑥1 using the arithmetic mean

𝑎+𝑏
𝑥1 =
2
1+2 3
𝑥1 = = = 1.5
2 2
Step:4

Calculate f(𝑥1 ), then find f(𝑥1 ).f(a) and f(𝑥1 ).f(b)


Cont.
Calculate f(𝑥1 ), then find f(𝑥1 ).f(a) and f(𝑥1 ).f(b)
1st Iteration: 𝑓 𝑥1 = 𝑓(1.5) = 1.52 − 2 = 0.25
𝑓 𝑥1 . 𝑓 𝑎 = 𝑓 1.5 . 𝑓 1 = 0.25 . −1 = −0.25
𝑓 𝑥1 . 𝑓 𝑏 = 𝑓 1.5 . 𝑓 2 = 0.25 . 2 = 0.5

As, 𝑓 1.5 . 𝑓 1 < 0. So, root lies in [1.0, 1.5] and no solution in [1.5, 2].

𝑥1 + 𝑎 1.5 + 1
𝑥2 = = = 1.25
2 2
2nd Iteration: 𝑓 𝑥2 = 𝑓(1.25) = 1.252 − 2 = −0.4375
𝑓 𝑥2 . 𝑓 𝑥1 = 𝑓 1.25 . 𝑓 1.5 = −0.4375 . 0.25 = −0.10941
𝑓 𝑥2 . 𝑓 𝑎 = 𝑓 1.25 . 𝑓 1 = −0.4375 . −1 = 0.4375

As, 𝑓 1.25 . 𝑓 1.5 < 0. So, root lies in [1.25, 1.5] and no solution in [1, 1.25].
Cont.
𝑥1 + 𝑥2 1.5 + 1.25
𝑥3 = = = 1.375
2 2

3rd Iteration: 𝑓 𝑥3 = 𝑓(1.375) = 1.3752 − 2 = −0.1094


𝑓 𝑥3 . 𝑓 𝑥1 = 𝑓 1.375 . 𝑓 1.5 = −0.1094 . 0.25 = −0.0274
𝑓 𝑥3 . 𝑓 𝑥2 = 𝑓 1.375 . 𝑓 1.25 = −0.1094 . −0.4375 = 0.0479

As, 𝑓 1.375 . 𝑓 1.5 < 0. So, root lies in [1.375, 1.5] and no solution in [1.25, 1.375].

𝑥1 + 𝑥3 1.5 + 1.375
𝑥4 = = = 1.4375
2 2

4th Iteration: 𝑓 𝑥4 = 𝑓(1.4375) = 1.43752 −2 = 0.0664


𝑓 𝑥4 . 𝑓 𝑥1 = 𝑓 1.4375 . 𝑓 1.5 = 0.0664 . 0.25 = 0.0166
𝑓 𝑥4 . 𝑓 𝑥3 = 𝑓 1.4375 . 𝑓 1.375 = 0.0664 . −0.1094 = −0.0073

As, 𝑓 1.4375 . 𝑓 1.375 < 0. So, root lies in [1.4375,1.375] and no solution in [1.4375, 1.5].
Cont.
𝑥3 + 𝑥4 1.375 + 1.4375
𝑥5 = = = 1.4063
2 2
5th Iteration: 𝑓 𝑥5 = 𝑓(1.4063) = 1.40632 − 2 = −0.0223
𝑓 𝑥5 . 𝑓 𝑥3 = 𝑓 1.4063 . 𝑓 1.375 = −0.0223 . −0.1094 = 0.0024
𝑓 𝑥5 . 𝑓 𝑥4 = 𝑓 1.4063 . 𝑓 1.4375 = −0.0223 . 0.0664 = −0.0015
As,𝑓 1.4063 . 𝑓 1.4375 < 0. So, root lies in [1.4063,1.4375] and no
solution in [1.375, 1.4063].
𝑥4 + 𝑥5 1.4375 + 1.4063
𝑥6 = = = 1.4219
2 2
6th Iteration:
𝑓 𝑥6 = 𝑓(1.4219) = 1.42192 − 2 = 0.0218
𝑓 𝑥6 . 𝑓 𝑥4 = 𝑓 1.4219 . 𝑓 1.4375 = 0.0218 . 0.0664 = 0.0014
𝑓 𝑥6 . 𝑓 𝑥5 = 𝑓 1.4219 . 𝑓 1.4063 = 0.0218 . −0.0223 = −0.0005
As,𝑓 1.4219 . 𝑓 1.4063 < 0. So, root lies in [1.4063,1.4219] and no
solution in [1.4219, 1.4375].
Cont.
𝑥5 + 𝑥6 1.4063 + 1.4219
𝑥7 = = = 1.4141
2 2
Step: 5
𝑥𝑛+1 − 𝑥𝑛 ≤ 𝜖
n=1, 𝑥1+1 − 𝑥1 = 𝑥2 − 𝑥1 = 1.25 − 1.5 = 0.25
n=2, 𝑥2+1 − 𝑥2 = 𝑥3 − 𝑥2 = 1.375 − 1.25 = 0.125
n=3, 𝑥3+1 − 𝑥3 = 𝑥4 − 𝑥3 = 1.4375 − 1.375 = 0.0625
n=4, 𝑥4+1 − 𝑥4 = 𝑥5 − 𝑥4 = 1.4063 − 1.4375 = 0.0312
n=5, 𝑥5+1 − 𝑥5 = 𝑥6 − 𝑥5 = 1.4219 − 1.4063 = 0.0156
n=6, 𝑥6+1 − 𝑥6 = 𝑥7 − 𝑥6 = 1.4141 − 1.4219 = 0.0078 ≤ 10−2
Advantages
• Simple and easy to implement

• One function evaluation per iteration

• The size of the interval containing the zero is reduced by 50% after
each iteration

• The number of iterations can be determined a prior

• No knowledge of the derivative is needed

• The function does not have to be differentiable


Disadvantages
• Slow Rate of Convergence: Although convergence of Bisection
method is guaranteed, it is generally slow.
• Choosing one guess close to root has no advantage: Choosing one
guess close to the root may result in requiring many iterations to
converge.
• Can not find root of some equations. For example: f(x) = x2 as there
are no bracketing values.
• It has linear rate of convergence.
• It fails to determine complex roots.
• It can not be applied if there are discontinuities in the guess interval.
• It can not be applied over an interval where the function takes values
of the same sign.
Homework

Exercise: 2.1

Q1 to Q6, Q9(b), Q10(b), Q11 to Q14

You might also like