0% found this document useful (0 votes)
20 views59 pages

Chapter 1 - Printed

The IS5306 Numerical Methods module, taught by M H M R S Dilhani, introduces students to numerical approximation techniques for solving engineering and science problems. The course covers various topics including nonlinear equations, interpolation, and numerical differentiation, with assessments based on continuous evaluation and an end-semester examination. Students will also learn to use Matlab for numerical problem-solving and understand the limitations of numerical methods.
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)
20 views59 pages

Chapter 1 - Printed

The IS5306 Numerical Methods module, taught by M H M R S Dilhani, introduces students to numerical approximation techniques for solving engineering and science problems. The course covers various topics including nonlinear equations, interpolation, and numerical differentiation, with assessments based on continuous evaluation and an end-semester examination. Students will also learn to use Matlab for numerical problem-solving and understand the limitations of numerical methods.
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/ 59

Numerical Methods

Lecturer : M H M R S Dilhani
Module : IS5306 Numerical Methods
Type : Core
No. Credits :3
Prerequisites : None
Objective:
Provide an introduction to the students with numerical
approximation tools for solving engineering and science
problems.
Intended Learning Outcomes:
After following this module, students will be able to do the following.
• Understand of numerical approximation techniques.
• Use numerical techniques to solve different engineering and science
problems.
• Understand why numerical methods work and their limitation.
• Use of Matlab for solving numerical problems.

IS 5306 - M H M R S Dilhani 3
Mode of Assessment:
1. Continuous assessment 40%
• Assignments 20%
• In-Class Assessments 20%

2. End Semester Examination 60%


Necessary condition to pass the module:
• Achieve an overall mark of at least 40% including a mark of at least 47.5% (i.e. 19 marks) in
CA and a mark of at least 35% (i.e. 21 marks) in ESE

IS 5306 - M H M R S Dilhani 4
Introduction
• In Linear Algebra, systems of linear equations can be implemented by
using row reduction as an algorithm.
• However, when these methods are not successful, we use the concept
of numerical methods.
• Numerical methods are used to approximate solutions of equations
when exact solutions can not be determined via algebraic methods.
• They construct successive approximations that converge to the exact
solution of an equation or system of equations.

IS 5306 - M H M R S Dilhani 5
Introduction
• Numerical method provide a way for the engineer to translate the language
of mathematics and physics into information that may be used to make
engineer decisions.
• This translation is implemented so that the calculation may be done by
machines (Computers).
• The types of problems that you encounter as an engineer may involve a
wide variety of mathematical phenomena, and hence it will benefit you to
have an equally wide range of numerical methods with which to approach
some of these problems.
• This course will provide you with an introduction to several of those
numerical methods which you may then find opportunity to practice later in
the curriculum.
IS 5306 - M H M R S Dilhani 6
Write down few examples in which numerical methods
offer a net benefit to the engineer

IS 5306 - M H M R S Dilhani 7
This course consists of six major units
1) Numerical Solution of nonlinear equations

2) Interpolating techniques

3) Numerical solution of systems of linear equations

4) Numerical differentiation and integration

5) Numerical solution of ordinary differential equations

6) Numerical solutions to partial differential equations

IS 5306 - M H M R S Dilhani 8
Numbers and their accuracy
There are two kinds of numbers:
1. Exact numbers, e.g. 1, 2, 3 .. ½, 5/2 etc.
2. Approximation numbers, e.g. 𝜋, 𝐾, … etc.

Significant Digit:
Digits that are used to express a number are called significant
digit/figures. The following statements describe the notion of significant
digits.

IS 5306 - M H M R S Dilhani 9
- All non zero digits
- All zeroes occurring between non-zero digits.
- Trailing zeros following a decimal point, e.g. 3.50, 65.0, 0.230 have
three significant digits.
- Zeros between the decimal point are preceding a non-zero digits are
not significant, e.g. 0.01234, 0.001234, 0.0001234 all have four
significant digits.
- When the decimal point is not written, trailing zeros are not considered
to be significant, e.g. 4500 contain only two significant digits.

IS 5306 - M H M R S Dilhani 10
Accuracy and precision:
The concept of accuracy and precision are closely related to significant
digits.
- Accuracy refers to the number of significant digits in a value, e.g. the
number 57.345 is accurate to five significant digits.
- Precision refer to the number of decimal position, i.e. the order of
magnitude of last digit in a value, e.g. 57.396 have a precision of
0.001.

IS 5306 - M H M R S Dilhani 11
Rules for rounding off:
To round off a number to n-significant digits, discard all digits to the
right of the nth digit if this discarded number is,
- Less than half a unit in the nth place, leave the nth digit unaltered.
- Greater than half a unit in nth place, increase the nth digit by unity.
- Exactly half a unit in the nth place, increase the nth digit by unit if it is
odd; otherwise leave it unchanged.

Example: Following numbers are rounded off to four significant


figures.
1.6583 (1.658) 30.0567 (30.06) 0.859378 (0.8594)
3.14159 (3.142)

IS 5306 - M H M R S Dilhani 12
Different types of errors
a) Absolute Error: Numerical difference between true value of a quantity
and its approximate value.
Mathematically;
Absolute error 𝐸𝐴 = True Value 𝑋 − Approximate Value 𝑋1
= ∆𝑋

b) Relative Error: Ratio of absolute error to a value of the quantity being


concerned.
Mathematically;
Absolute Error 𝐸𝐴
Relative error 𝐸𝑅 =
True Value (𝑋)

IS 5306 - M H M R S Dilhani 13
c) Percentage Error: The percentage value of relative error.
Mathematically;
Absolute Error 𝐸𝐴
Percentage error 𝐸𝑃 = × 100%
True Value (𝑋)

d) Relative Accuracy: Ratio of change in true value to the modulus of true


value.
Mathematically;
Absolute Error 𝐸𝐴 Absolute Error 𝐸𝐴
Relative Accuaracy 𝑅𝐴 = ~
|True Value 𝑋 | |Approximate Value 𝑋1 |

IS 5306 - M H M R S Dilhani 14
Mathematical Preliminaries
Theorem 1: If 𝑓(𝑥) is continuous in 𝑎 ≤ 𝑥 ≤ 𝑏, and if 𝑓 𝑎 and 𝑓(𝑏)
are of opposite signs, then 𝑓 𝑐 = 0 for at least one number 𝑐, such that
𝑎 < 𝑐 < 𝑏.

Theorem 2 (Rolle’s Theorem): If 𝑓(𝑥) is continuous in 𝑎 ≤ 𝑥 ≤ 𝑏,


𝑓′(𝑥) exists in 𝑎 < 𝑥 < 𝑏 and 𝑓 𝑎 = 𝑓 𝑏 = 0, then there exist at least
one value of 𝑥 say 𝑐, such that 𝑓′ 𝑐 = 0.

IS 5306 - M H M R S Dilhani 15
Theorem 3 (Intermediate Value Theorem): If 𝑓(𝑥) is continuous in
[𝑎, 𝑏] and let 𝐾 be any number between 𝑓 𝑎 and 𝑓 𝑏 , then there exist
a number 𝑐, such that 𝑓 𝑐 = 𝐾.

Theorem 4 (Intermediate Value Theorem for derivatives): If 𝑓(𝑥) is


continuous in [𝑎, 𝑏] and 𝑓′(𝑥) exists in (𝑎, 𝑏), there exist at least one
value of 𝑥, say 𝑐 between 𝑎 and 𝑏 such that
′ 𝑐 𝑓 𝑏 −𝑓 𝑎
𝑓 = ; 𝑎 < 𝑐 < 𝑏.
𝑏−𝑎

IS 5306 - M H M R S Dilhani 16
Theorem 5 (Taylor’s Series for a function of one variable): If 𝑓(𝑥) is
continuous and passes continuous derivatives of order in an interval and
includes 𝑥 = 𝑎, then:
𝑓 𝑥
𝑥 − 𝑎 2 𝑥 − 𝑎 𝑛−1
= 𝑓 𝑎 + 𝑥 − 𝑎 𝑓′ 𝑎 + 𝑓 ′′ 𝑎 + ⋯ + 𝑓 𝑛−1 𝑎
2! 𝑛−1 !
+ 𝑅𝑛 (𝑥)
𝑥−𝑎 𝑛 𝑛
Where; 𝑅𝑛 𝑥 : Remainder term = 𝑓 𝑐 ; 𝑎<𝑐<𝑏
𝑛!

Theorem 6 (McLaren’s Expansion):


2 𝑛
𝑥 𝑥
𝑓 𝑥 = 𝑓 0 + 𝑥𝑓 ′ 0 + 𝑓 ′′ 0 + ⋯ + 𝑓 𝑛 (0)
2! 𝑛!

IS 5306 - M H M R S Dilhani 17
1. Numerical solution of nonlinear equations
• The goal of this topic is to examine three different numerical methods
that are used to solve systems of nonlinear equations in several
variables.
Consider equation of the form 𝑓 𝑥 = 0, 𝑓 𝑥 is a nonlinear function.
Example:
𝑓 𝑥 = 𝑎𝑥 2 + 𝑏𝑥 + 𝑐 = 0
𝑓 𝑥 = 𝑥 4 + cos 𝑥𝑒 𝑥 − 10 = 0
In general we can write
𝑓 𝑥 = 𝑎0 𝑥 𝑛 + 𝑎1 𝑥 𝑛−1 + ⋯ + 𝑎𝑛 = 0
This is called as polynomial function.
IS 5306 - M H M R S Dilhani 18
𝑎𝑥 2 + 𝑏𝑥 + 𝑐 = 0 Quadratic equation

−𝑏 ± 𝑏 2 − 4𝑎𝑐
𝑥= There is
2𝑎
a
𝑎𝑥 3 + 𝑏𝑥 2 + 𝑐𝑥 + 𝑑 = 0 Cubic equation formula

𝑎𝑥 4 + 𝑏𝑥 3 + 𝑐𝑥 2 + 𝑑𝑥 + 𝑒 = 0 Biquadratic equation

𝑎𝑥 5 + 𝑏𝑥 4 + 𝑐𝑥 3 + 𝑑𝑥 2 + 𝑒𝑥 + 𝑓 = 0 There is no formula

IS 5306 - M H M R S Dilhani 19
Methods of Solving Non-Linear Equations
There are different methods to deal with non linear equations:
i. Direct analytical method
ii. Graphical method
iii. Trial and error method
iv. Iterative method

We only deal with iterative method.

IS 5306 - M H M R S Dilhani 20
Iterative method
Iterative method begin with one or more guesses at the solution being
sought. It generates a sequence of estimate of the solution which is
expected to converge at the solution. Based on the number of guess, we
have two different methods.
A. Bracketing Method:
It starts with two guesses that brackets the root and then,
systematically reduced the width of bracket until the solution is
reached.

Example: Bisection Method, False Position method, etc.

IS 5306 - M H M R S Dilhani 21
B. Open End Method
It uses single starting values or two values that do not necessarily
bracket the root.

Example: Newton Raphson Method with one initial guess, Secant


Method with two starting guess, Fixed Point Iteration Method, etc.

IS 5306 - M H M R S Dilhani 22
Bisection Method
• This is one of the bracketing methods and is also known as Bolzano
Method, Binary Chopping or Half Interval method.

• The bisection method in a mathematics is a root-finding method which


repeatedly bisects an interval and then selects a subinterval in which a root
must lie for further processing.

• It is a very simple and robust method, but the main disadvantage is that
convergence is slow.

• In order to use the bisection method, we have to have the condition,


𝑓 𝑎0 𝑓 𝑏0 < 0 for some 𝑎𝑜 and 𝑏0 .

IS 5306 - M H M R S Dilhani 23
Theorem: Bisection Method
Let 𝒇(𝒙) be the function defined in the interval 𝒂𝟎 , 𝒃𝟎 , where
𝒇(𝒂𝟎 ) and 𝒇(𝒃𝟎 ) are of opposite sign i.e. 𝒇(𝒂𝟎 ) 𝒇(𝒃𝟎 ) < 𝟎 then the
root of the function lies in between 𝒂𝟎 𝐚𝐧𝐝 𝒃𝟎 .

𝑓(𝑥) 𝑓(𝑏0 )

𝑎0
𝑥
𝑚 𝑏0
𝑓(𝑎0 )

IS 5306 - M H M R S Dilhani 24
Algorithm
1. Read 𝑎0 and 𝑏0 , define stopping criteria: error(𝜀)
2. Calculate, 𝑚 = (𝑎0 + 𝑏0 )/2
3. If 𝑏0 − 𝑎0 < 𝜀, go to step 6 (Optional)
4. Check for 𝑓(𝑚)
a) If 𝑓 𝑚 = 0, go to step 6
b) 𝑓 𝑚 < 0, 𝑎0 = 𝑚
c) 𝑓 𝑚 > 0, 𝑏0 = 𝑚
5. Repeat steps 2, 3, and 4 until 𝜀 is achieved
6. Print 𝑚
7. Stop
IS 5306 - M H M R S Dilhani 25
Example:
Find the root of 𝑓 𝑥 = 𝑥 2 − 5 by using the bisection method. Let the
starting interval is [2,3] and error is 𝜀𝑛 = 0.01.

𝑓 𝑥 = 𝑥2 − 5
∴ 𝑓 2 = −1, 𝑓 3 =4
∴ f 2 f 3 < 0, has opposite signs.

So, we can use bisection method to find the root, as 𝑓 𝑥 has at least
one root in between 2 and 3.

IS 5306 - M H M R S Dilhani 26
𝑎0 +𝑏0 2+3
Then, 𝑚1 = = = 2.5
2 2

𝑓 𝑚1 = 2.52 − 5 =6.25-5=1.25

Update 𝑏0 with 𝑚1 . So the new interval = [2,2.5]

Error at this stage = 𝑏 − 𝑎 = 2.5 − 2 = 0.5

IS 5306 - M H M R S Dilhani 27
In a tabular format
𝒂 𝒃 𝒇(𝒂) 𝒇(𝒃) 𝒎 𝒇(𝒎) Update New 𝒃 − 𝒂
a+b
=
2
2 3 -1 4 2.5 1.25 𝒃1 = m1 0.5
= 2.5

IS 5306 - M H M R S Dilhani 28
Thus, with the seventh iteration, we note that the final interval, [2.2344,
2.25] has a width less than 0.01 and 𝑓 2.2344 < 0.01, and therefore,
we choose 𝑎 = 2.2422 to be our approximation of the root.

Example 2:
Suppose you have to solve the function, 𝑥 2 − 𝑥 = 0, in the interval
−0.1,0.01 using the bisection method. The stopping criteria of this
function is 0.0001.

Example 3: Find the root of the equation 𝑥 3 − 2𝑥 − 5, using bisection


method. The stopping criteria of this function is 0.005.

IS 5306 - M H M R S Dilhani 29
Advantages of Bisection method:
a) The bisection method is always convergent since the method
brackets the root, the method is guaranteed to converge
b) As iterations are conducted, the interval gets halved. So one can
guarantee the error in the solution of the equation.

Drawbacks of Bisection method:


a) The convergence of the bisection method is slow as it is simply
based on halving the interval.
b) If one of the initial guesses is closer to the root, it will take larger
number of iterations to reach the root.

IS 5306 - M H M R S Dilhani 30
c) If a function 𝑓(𝑥) is such that it just touches the x-axis, such as
𝑓 𝑥 = 𝑥 2 = 0 it will be unable to find the lower guess, 𝑎0 , and
upper guess, 𝑏0 , such that 𝑓 𝑎0 𝑓 𝑏0 < 0.

𝑓(𝑥)

The equation 𝑓 𝑥 = 𝑥 2 = 0 has a single root at 𝑥 = 0 that can not be


bracketed.
IS 5306 - M H M R S Dilhani 31
d) For functions 𝑓(𝑥) where there is a singularity (a point where the
function becomes infinite) and it reverses sign at the singularity, the
bisection method may converge on the singularity.
𝑓(𝑥)

1
The equation 𝑓 𝑥 = = 0 has no root, but changes sign.
𝑥

IS 5306 - M H M R S Dilhani 32
1
An example includes, 𝑓 𝑥 = , where 𝑎0 = −2, 𝑏0 = 3 are valid
𝑥

initial guesses which satisfy 𝑓 𝑎0 𝑓 𝑏0 < 0. However, the function is


not continuous and the theorem that a root exists is also not applicable.

IS 5306 - M H M R S Dilhani 33
Convergence of Bisection
In bisection method, we choose a mid point m in the interval between
𝑎0 and 𝑏0 . Depending upon the sign of 𝑓 𝑚 , 𝑏0 or 𝑎0 is set equal to m
such that the root lies in the interval. In other case the interval
containing the root is reduced by a function of 2. The same process is
repeated for the new interval. If the procedure is repeated ‘n’ times, then
the interval containing the root is reduced to the size,

𝑏0 − 𝑎0 ∆𝑥
𝑛
= 𝑛
2 2

∆𝑥
After iteration the root must lies within ± of our estimate.
2

IS 5306 - M H M R S Dilhani 34
this mean the error bound at nth iteration is,
∆𝑥
𝜀𝑛 = 𝑛 .
2
Similarly,
∆𝑥 𝜀𝑛
𝜀𝑛+1 = 𝑛+1 =
2 2
Thus the error decrease linearly with each step by a factor of 0.5. This
method is therefore linearly convergent.

IS 5306 - M H M R S Dilhani 35
Stopping Criteria
The number of iterations can be calculated as follows; where 𝜀𝑛 is the
error at the nth iteration.
∆𝑥
𝜀𝑛 = 𝑛
2

𝑛
∆𝑥
2 =
𝜀𝑛

∆𝑥
log
𝜀𝑛
𝑛≥
log 2

IS 5306 - M H M R S Dilhani 36
1.2 Newton-Raphson method
Consider a graph 𝑓 𝑥 as shown in the below figure. Let us assume that
𝑥1 is an approximation root of 𝑓 𝑥 = 0. Draw a tangent curve 𝑓 𝑥 at
𝑥 = 𝑥1 as shown in the figure.
𝑓(𝑥)

T𝐚𝐧𝐠𝐞𝐧𝐭

(𝑥1 , 𝑓 𝑥1 )

(𝑥2 , 𝑓 𝑥2 )
𝑥𝑟𝑜𝑜𝑡 𝑥
𝑥3 𝑥2 𝑥1

IS 5306 - M H M R S Dilhani 37
The point of intersection of this tangent with the x-axis gives the second
approximation to the root. Let, the point of intersection be 𝑥2 . The slope
of the tangent is given by:
𝑓 𝑥1
tan 𝛼 = = 𝑓 ′ (𝑥1 )
𝑥1 − 𝑥2
Where; 𝑓′ 𝑥1 is the slope of 𝑓 𝑥 at 𝑥 = 𝑥1 .
Solving for 𝑥2 , we get:
𝑓 𝑥1
𝑥2 = 𝑥1 − ′
𝑓 (𝑥1 )
This is called Newton Raphson formula for first iteration.

IS 5306 - M H M R S Dilhani 38
Then the next approximation will be:
𝑓 𝑥2
𝑥3 = 𝑥2 − ′
𝑓 (𝑥2 )

In general
𝑓 𝑥𝑛
𝑥𝑛+1 = 𝑥𝑛 − ′
𝑓 (𝑥𝑛 )

IS 5306 - M H M R S Dilhani 39
Algorithm

1. Assign an initial value to x, say 𝑥0 and read the stopping criteria (𝜀).
2. Evaluate 𝑓 𝑥0 and 𝑓 ′ 𝑥0 . If 𝑓 𝑥0 = 0; then the root will be 𝑥0 .
3. Find the improved estimate of 𝑥0 a:
𝑓 𝑥0
𝑥1 = 𝑥0 − ′
𝑓 (𝑥0 )
𝑥1 −𝑥0
4. Check for accuracy of estimate: if < 𝜀; then stop and go to
𝑥1
step 6 otherwise continue.
5. Replace 𝑥0 by 𝑥1 and repeat steps 3 and 4.
6. Print 𝑥1 .
7. Stop.

IS 5306 - M H M R S Dilhani 40
Another way of obtaining Newton-Rapson method
Taylor’s Series
𝑥−𝑎 ′ 𝑥−𝑎 2 𝑥−𝑎 𝑛
𝑓 𝑥 =𝑓 𝑎 + 𝑓 𝑎 + 𝑓"(𝑎) + ⋯ + 𝑓 𝑛 (𝑎)
1! 2! 𝑛!

If 𝛼 is the root of 𝑓 𝑥 = 0, then expanding 𝑓 𝑥 about a point 𝑥0 which is


near 𝛼, using Taylor’s series,
𝛼 − 𝑥0 ′ 𝛼 − 𝑥0 2 𝛼 − 𝑥0 𝑛
𝑓 𝛼 = 𝑓 𝑥0 + 𝑓 𝑥0 + 𝑓"(𝑥0 ) + ⋯ + 𝑓 𝑛 (𝑥0 )
1! 2! 𝑛!

𝑓 𝛼 =0, so we have
2 𝑛
𝛼 − 𝑥0 ′ 𝛼 − 𝑥0 𝛼 − 𝑥0
0 = 𝑓 𝑥0 + 𝑓 𝑥0 + 𝑓"(𝑥0 ) + ⋯ + 𝑓 𝑛 (𝑥0 )
1! 2! 𝑛!

IS 5306 - M H M R S Dilhani 41
(𝛼 − 𝑥0 ) is the error initial stage.
Define 𝜀0 = 𝛼 − 𝑥0
So,
2 𝑛

𝜀 0 𝜀0 𝑛
0 = 𝑓 𝑥0 + 𝜀0 𝑓 𝑥0 + 𝑓"(𝑥0 ) + ⋯ + 𝑓 (𝑥0 )
2! 𝑛!
Since 𝜀0 is small, we can neglect 𝜀02 , 𝜀03 , 𝜀04 , …
∴ 0 ≈ 𝑓 𝑥0 + 𝜀0 𝑓 ′ 𝑥0
𝑓 𝑥0
𝜀0 ≈ −
𝑓′(𝑥0 )
𝑓 𝑥0
∴ 𝛼 ≈ 𝑥0 − ′ = 𝑥1
𝑓 𝑥0

IS 5306 - M H M R S Dilhani 42
As 𝑥1 is a better approximation to 𝛼 than 𝑥0 , we can obtain a closer
value to 𝛼 using 𝑥1 .
𝑓 𝑥1
𝑥2 = 𝑥1 − and we continue.
𝑓′ 𝑥1

So we get,
𝑓 𝑥𝑛
𝑥𝑛+1 = 𝑥𝑛 − ′ = 𝑔(𝑥𝑛 )
𝑓 𝑥𝑛

IS 5306 - M H M R S Dilhani 43
Example 1:
Solve the nonlinear equation, 𝑥 6 − 2.8𝑥 + 0.7 using the Newton-
Raphson method with a good initial value (starting value) 𝑥0 .

Put 𝑥0 = 0, 𝑓 0 = 0.7 > 0 &


𝑥1 = 1, 𝑓 1 = −1.1 < 0
0+1
So, we shall take 𝑥0 = 𝑚1 = = 0.5
2

Now, 𝑓 𝑥 = 𝑥 6 − 2.8𝑥 + 0.7


𝑓′ 𝑥 = 6𝑥 5 − 2.8

IS 5306 - M H M R S Dilhani 44
𝑓 𝑥𝑛 𝑥𝑛6 − 2.8𝑥𝑛 + 0.7
𝑥𝑛+1 = 𝑥𝑛 − ′ = 𝑥𝑛 −
𝑓 𝑥𝑛 6𝑥𝑛5 − 2.8

n 𝒙𝒏 𝒇(𝒙𝒏 ) 𝒇′(𝒙𝒏 ) 𝒙𝒏+𝟏


0 0.5 -0.684375 -2.6125 0.238038
1
2
3

IS 5306 - M H M R S Dilhani 45
Example 2:
Solve 𝑥 2 + 2𝑥 + 1 = 0 using N-R method with the initial value 𝑥0 =
0.9.
𝑓 𝑥 = 𝑥 2 + 2𝑥 + 1, 𝑓 ′ 𝑥 = 2𝑥 + 2

𝑓 𝑥𝑛 (𝑥𝑛2 + 2𝑥𝑛 + 1)
𝑥𝑛+1 = 𝑥𝑛 − ′ = 𝑥𝑛 −
𝑓 𝑥𝑛 (2𝑥𝑛 + 2)

IS 5306 - M H M R S Dilhani 46
Note:

𝑥 2 + 2𝑥 + 1 = 0 has a multiple root at 𝑥 = −1. Any equation 𝑓 𝑥 = 0


which has a multiple roots at 𝑥 = 𝛼 could be written as;

𝒇 𝒙 = 𝒙−𝜶 𝒎𝒈 𝒙 =𝟎
where 𝑔 𝑥 is a function such that 𝑔 𝛼 ≠ 0. m is the order of the
multiple root or the multiplicity. So, if we know the multiplicity of the
root, then we can modify N-R method as :
𝑚𝑓 𝑥𝑛
𝑥𝑛+1 = 𝑥𝑛 −
𝑓′(𝑥𝑛 )

IS 5306 - M H M R S Dilhani 47
Suppose you have function, 𝑓 𝑥 = 0 and 𝛼 is a root of this function.

If, 𝑓 ′ (𝛼) ≠ 0 → 𝛼 is a simple root.

𝑓′ 𝛼 = 0
If ൠ → 𝛼 is a double root.
𝑓"(𝛼) ≠ 0

IS 5306 - M H M R S Dilhani 48
Example 3:
𝑓 𝑥 = 𝑥2 + 𝑥7 = 0
We can re-write the function as,
𝑓 𝑥 = 𝑥 2 1 + 𝑥 5 = 𝑥 2 𝑔(𝑥)
Check whether the given equation has double root or not.

IS 5306 - M H M R S Dilhani 49
Advantages of N-R method
1) Convergence is faster (quadratic convergence)
2) Required only one guess

Disadvantages of N-R method


1) Division by zero

Example: 𝑓 𝑥 = 𝑥 3 − 0.03𝑥 2 + 2.4 ∗ 10−6 = 0


𝑥𝑛3 − 0.03𝑥𝑛2 + 2.4 ∗ 10−6
𝑥𝑛+1 = 𝑥𝑛 −
3𝑥𝑛2 − 0.06𝑥𝑛
If 𝑥 = 0 or 𝑥 = 0.02 the denominator will equal to zero.

IS 5306 - M H M R S Dilhani 50
2) Oscillations near local maximum and minimum

Consider a function 𝑓 𝑥 = 𝑥 2 + 2 = 0 which has no real roots. So we


can see the tangents are oscillating near local minimum or maximum
points.
𝑓(𝑥)

0 𝑥
−1.75 −1 0.5 3.142
−0.3040

51
IS 5306 - M H M R S Dilhani
4) Root jumping
In some cases where the function 𝑓(𝑥) is oscillating and has a number
of roots, one may choose an initial guess close to a root. However, the
guess may jump and converge to some other root.
𝑓(𝑥)

𝒇 𝒙 = 𝐒𝐢𝐧 𝒙 = 𝟎
4.46
𝑥
0 0.55 7.54

IS 5306 - M H M R S Dilhani 52
1.3 Fixed Point Iteration Method
It is also known as direct substitution method or method of successive
approximation. It is applicable if the equation 𝑓 𝑥 = 0 can be
expressed in terms of 𝑥 = 𝑔 𝑥 . If 𝑥0 is the initial approximation to the
root, then the next approximation will be: 𝑥1 = 𝑔 𝑥0 and the next
again will be: 𝑥2 = 𝑔 𝑥1 and so on.
In general iterative method can be written as,

𝑥𝑛+1 = 𝑔 𝑥𝑛 , 𝑛 = 0,1,2, …

where 𝑛 is the number of iterative steps and 𝑋0 is the initial guess.

IS 5306 - M H M R S Dilhani 53
Definition: Fixed Point Iteration Method
If 𝜶 = 𝒈 𝜶 , then we say 𝜶 is a fixed point for the function 𝒈 𝒙 .

Condition for convergence


If 𝑔(𝑥) and 𝑔′(𝑥) are continuous on an interval [𝑎, 𝑏] about their root 𝛼
of the equation 𝑥 = 𝑔(𝑥), and if 𝑔′ 𝑥 < 1 for all 𝑥 in the interval
𝑎, 𝑏 , then the fixed point iterative process, 𝑥𝑛+1 = 𝑔 𝑥𝑛 , 𝑛 =
0, 1, 2, … will converge to the root x = 𝛼 for any initial approximation
x0 within the interval 𝑎, 𝑏 .

IS 5306 - M H M R S Dilhani 54
Algorithm:

1. Read an initial guess: 𝑥0 and 𝜀.


2. Evaluate 𝑥1 = 𝑔 𝑥0 .
𝑥1 −𝑥0
3. Check for error: if < 𝜀, 𝑥1 is root, else continue.
𝑥1
4. Assign the value of 𝑥1 to 𝑥0 , i.e. 𝑥0 = 𝑥1 and repeat steps 2 and 3.
5. Print 𝑥1 .
6. Stop.

IS 5306 - M H M R S Dilhani 55
Example 1:
Use the fixed point iterative method to determine a solution accurate
within 10−2 for 𝑥 5 − 3𝑥 3 − 3 = 0, on 1,2 .

𝑓 𝑥 = 𝑥 5 − 3𝑥 3 − 3 = 0
We can rewrite the function 𝑓 𝑥 as ;
𝑥 5 − 3𝑥 3 − 3 = 0
𝑥 5 = 3𝑥 3 + 3
𝑥 = 3𝑥 3 + 3 1/5 ∈ [1,2]

𝑔 𝑥

IS 5306 - M H M R S Dilhani 56
Example 2:
Find a root of 𝑥 4 − 2𝑥 − 5 = 0 by using fixed point iteration method.

Lets consider
5
𝑔 𝑥 = 3 and 𝑥0 = 2.0
(𝑥 − 2)

IS 5306 - M H M R S Dilhani 57
Graphical interpretation of Fixed point iteration procedure

Monotone Convergence (when 0 < 𝑔′ 𝑥 < 1)


Oscillating Convergence (when −1 < 𝑔′ 𝑥 < 0)
Monotone Divergence (when 𝑔′ 𝑥 > 1)
Oscillating Divergence (when 𝑔′ 𝑥 > −1)

IS 5306 - M H M R S Dilhani 58
IS 5306 - M H M R S Dilhani 59

You might also like