0% found this document useful (0 votes)
7 views34 pages

Lecture 6

The document discusses the False Position Method (Regula Falsi), a numerical technique for finding roots of equations. It outlines the method's procedure, provides an example using the equation f(x) = x^2 - 2, and explains the iterative process to approximate the root. Additionally, it briefly covers linear systems of equations and the Gauss elimination method for solving them.

Uploaded by

Muhammad Hamza
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)
7 views34 pages

Lecture 6

The document discusses the False Position Method (Regula Falsi), a numerical technique for finding roots of equations. It outlines the method's procedure, provides an example using the equation f(x) = x^2 - 2, and explains the iterative process to approximate the root. Additionally, it briefly covers linear systems of equations and the Gauss elimination method for solving them.

Uploaded by

Muhammad Hamza
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/ 34

Lecture 6

Numerical Methods
[MA-200]
The False Position Method (Regula-Falsi)
• Historically this method is known as “Regula Falsi” which is Latin and means: the
wrong rule. It is also known as method of false position

• The false position method is a numerical method to solve equations of the form
𝑓 𝑥 = 0.

• The aim is to find an approximation 𝑥𝑟 of a root r of the function 𝑓.

• Bisection algorithm cuts the interval into two equal segments, while the false
position method will try to generate a new interval in a faster way.
Working procedure
i. f(x) is continuous on [a , b]

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


iii. Calculate
𝑎𝑓 𝑏 − 𝑏𝑓(𝑎)
𝑥1 =
𝑓 𝑏 − 𝑓(𝑎)
Find 𝑓 𝑥1 and observe the sign of the function
If 𝑓 𝑥1 < 0 then replace 𝑎 = 𝑥1
If 𝑓 𝑥1 > 0 then replace 𝑏 = 𝑥1
𝑥𝑖 −𝑥𝐸
iv. Repeat the Step iii until ≤ 𝜖, for given 𝜖.
𝑥𝐸
Example:
Find a root of the equation f(x)= 𝒙𝟐 -2 by using False Position Method in the interval [1, 2].
Solution:
ii.
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].
ii.
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.
1st Iteration

𝑎𝑓 𝑏 − 𝑏𝑓(𝑎)
𝑥1 =
𝑓 𝑏 − 𝑓(𝑎)

(1)(2) − 2(−1)
𝑥1 = = 1.3333
2 − (−1)
𝑓 𝑥1 = 𝑓 1.3333 = 1.33332 − 2 = −0.2222 < 0

As, 𝑓 𝑥1 < 0 then replace 𝑎 = 𝑥1

We Get the modified interval

[1.3333, 2]
Cont.
2nd Iteration

𝑎𝑓 𝑏 − 𝑏𝑓(𝑎)
𝑥2 =
𝑓 𝑏 − 𝑓(𝑎)

(1.3333)(2) − 2(−0.2222)
𝑥2 = = 1.4000
2 − (−0.2222)
𝑓 𝑥2 = 𝑓 1.4000 = 1.4000 2 − 2 = −0.0401 < 0

As, 𝑓 𝑥2 < 0 then replace 𝑎 = 𝑥2

We Get the modified interval

[1.4, 2]
Cont.
3rd Iteration

𝑎𝑓 𝑏 − 𝑏𝑓(𝑎)
𝑥3 =
𝑓 𝑏 − 𝑓(𝑎)

(1.4)(2) − 2(−0.0401)
𝑥3 = = 1.4118
2 − (−0.0401)
𝑓 𝑥3 = 𝑓 1.4118 = 1.4118 2 − 2 = −0.0068 < 0

As, 𝑓 𝑥3 < 0 then replace 𝑎 = 𝑥3

We Get the modified interval

[1.4118, 2]
Cont.
4th Iteration

𝑎𝑓 𝑏 − 𝑏𝑓(𝑎)
𝑥4 =
𝑓 𝑏 − 𝑓(𝑎)

(1.4118)(2) − 2(−0.0068)
𝑥4 = = 1.4138
2 − (−0.0068)
𝑓 𝑥4 = 𝑓 1.4138 = 1.4138 2 − 2 = −0.0012 < 0

As, 𝑓 𝑥4 < 0 then replace 𝑎 = 𝑥4

We Get the modified interval

[1.4138, 2]
Cont.
5th Iteration

𝑎𝑓 𝑏 − 𝑏𝑓(𝑎)
𝑥5 =
𝑓 𝑏 − 𝑓(𝑎)

(1.4138)(2) − 2(−0.0012)
𝑥5 = = 1.4142
2 − (−0.0012)
𝑓 𝑥5 = 𝑓 1.4138 = 1.4138 2 − 2 = −0.0012 < 0

As, 𝑓 𝑥5 < 0 then replace 𝑎 = 𝑥5

We Get the modified interval

[1.4142, 2]
Cont.
6th Iteration

𝑎𝑓 𝑏 − 𝑏𝑓(𝑎)
𝑥6 =
𝑓 𝑏 − 𝑓(𝑎)

(1.4142)(2) − 2(−0.0002)
𝑥6 = = 1.4143
2 − (−0.0002)
𝑓 𝑥6 = 𝑓 1.4143 = 1.4143 2 − 2 = 0.0001 > 0

As, 𝑓 𝑥6 > 0 then replace 𝑏 = 𝑥6

We Get the modified interval

[1.4142, 1.4143]
Relative Error:
Let 𝑥𝑖 is the approximate solution of the non-linear equation and 𝑥𝐸 is the exact
value of the function 𝑓(𝑥).
𝑥𝑖 − 𝑥𝐸
𝑅. 𝐸 =
𝑥𝐸
Since 𝑥𝐸 = 1.4142
𝑥1 −𝑥𝐸 1.3333−1.4142
i=1, 𝑥𝐸
= 1.4142
= 0.0572
𝑥2 −𝑥𝐸 1.4000−1.4142
i=2, 𝑥𝐸
= 1.4142
= 0.0100
𝑥3 −𝑥𝐸 1.4118−1.4142
i=3, 𝑥𝐸
= 1.4142
= 0.0017
𝑥4 −𝑥𝐸 1.4138−1.4142
i=4, 𝑥𝐸
= 1.4142
= 0.0003
𝑥5 −𝑥𝐸 1.4142−1.4142
i=5, 𝑥𝐸
= 1.4142
= 0 < 0.0001 = 10−4
𝑥6 −𝑥𝐸 1.4143−1.4142
i=6, 𝑥𝐸
= 1.4142
= 0.0001
Homework

Exercise: 2.3
Q3(b, c), Q4(b), Q9, Q10, Q13(a), Q14(b)
Quiz Announcement

Wednesday 31st April 2021


Lecture 1 to 6
Timings 40 to 50 mins
Linear System of Equations
Special Matrices
General system of Linear Equations

System of equations for 𝑛 unknowns 𝑥1 , 𝑥2 , … , 𝑥𝑛 :

𝑎11 𝑥1 + 𝑎12 𝑥2 + … + 𝑎1𝑛 𝑥𝑛 = 𝑏1


𝑎21 𝑥1 + 𝑎22 𝑥2 + … + 𝑎2𝑛 𝑥𝑛 = 𝑏2
⋮ ⋮
𝑎𝑛1 𝑥1 + 𝑎𝑛2 𝑥2 + … + 𝑎𝑛𝑛 𝑥𝑛 = 𝑏𝑛
Equivalent matrix equation
Right-hand-side vector 𝑏
𝑎11 𝑎12 ⋯ 𝑎1𝑛 𝑥1 𝑏1
𝑎21 𝑎22 ⋯ 𝑎2𝑛 𝑥2 𝑏2
⋮ ⋮ ⋮ ⋮ = ⋮
𝑎𝑛1 𝑎𝑛2 ⋯ 𝑎𝑛𝑛 𝑥𝑛 𝑏𝑛

Coefficient matrix 𝐴
Column vector 𝑥
of unknowns

𝐴𝑥 = 𝑏
Example

3𝑥1 + 2𝑥2 = 18 3 2 𝑥1 18
ቊ =
−𝑥1 + 2𝑥2 = 2 −1 2 𝑥2 2
Graphical solution
𝑥2

Solution: 𝑥1 = 4, 𝑥2 = 3

𝑥1
Solution Space

𝑥2 𝑥2 𝑥2

One solution Infinite number


of solutions

No solution

𝑥1 𝑥1 𝑥1
Gauss Elimination Method
• Gauss elimination aims to transform the system of linear equations in an
equivalent system that can be solved in very short time

• This is done by a systematic procedure replacing equations by new ones obtained


by multiplication and subtraction of equations from the original system
Working Procedure
• Consider given a system of linear equations

• Find Augmented Matrix for the given equation

• Transform Augmented Matrix into Upper triangular/ Echelon form

• Find Equations corresponding to Upper Triangular Matrix/ Echelon Matrix

• Using back substitutions, find solutions of given system of equations


General idea
𝑎11 𝑎12 𝑎13 ⋯ 𝑎1𝑛 𝑥1 𝑏1
𝑎11 𝑎12 ⋯ 𝑎1𝑛 𝑥1 𝑏1 ′ ′
Forward 0 𝑎22 𝑎23 ⋯ 𝑎′ 2𝑛 𝑥2 𝑏 ′
𝑎21 𝑎22 ⋯ 𝑎2𝑛 𝑥2 𝑏2 ′ ′
2
⋮ = elimination 0 0 𝑎33 ⋯ 𝑎3𝑛 𝑥3 = 𝑏3′
⋮ ⋮ ⋮ ⋮
𝑥𝑛 ⋮ ⋮ ⋮ ⋮ ⋮ ⋮
𝑎𝑛1 𝑎𝑛2 ⋯ 𝑎𝑛𝑛 𝑏𝑛 𝑥𝑛
0 0 0 ⋯ 𝑎′ 𝑛𝑛 𝑏𝑛′

𝑏1 − σ𝑛𝑖=2 𝑎1𝑖

∙ 𝑥𝑖
𝑎11 𝑎12 𝑎13 ⋯ 𝑎1𝑛 𝑥1 𝑏1 𝑎11
′ ′
0 𝑎22 𝑎23 ⋯ 𝑎′ 2𝑛 𝑥2 𝑏 ′
2 Back
𝑥1 ⋮
0 0 ′
𝑎33 ⋯ ′
𝑎3𝑛 𝑥3 = 𝑏3′ substitution ⋮ 𝑏 ′
− 𝑎 ′
∙ 𝑥𝑛
= 𝑛−1 𝑛−1,𝑛
⋮ ⋮ ⋮ ⋮ ⋮ ⋮ 𝑥𝑛−1 ′
𝑥𝑛 𝑎𝑛−1,𝑛−1
′ 𝑥𝑛
0 0 0 ⋯ 𝑎𝑛𝑛 𝑏𝑛′ 𝑏𝑛′

𝑎𝑛𝑛
Example with two equations
• Consider
𝑥1 + 𝑥2 = 3

3𝑥1 − 4𝑥2 = 2

• Subtracting three times the first equation from the second yields

𝑥1 + 𝑥2 = 3

−7𝑥2 = −7
Example of a two equations
• Solve
𝑥1 + 𝑥2 = 3

−7𝑥2 = −7

• We first solve the last equation:

𝑥2 = 1
• And then the first one:

𝑥1 + 1 = 3 ⇒ 𝑥1 = 2
Remark
• There are various ways to form an upper triangular system

𝑟2 ← 𝑅2 − 3𝑅1
𝑥1 + 𝑥2 = 3 𝑥1 + 𝑥2 = 3
ቊ ቊ
3𝑥1 − 4𝑥2 = 2 −7𝑥2 = −7
Used in Gauss elimination

𝑥1 + 𝑥2 = 3 𝑟2 ← 3𝑅1 − 𝑅2 𝑥1 + 𝑥2 = 3
ቊ ቊ
3𝑥1 − 4𝑥2 = 2 7𝑥2 = 7
Augmented matrix notation
• A common notation is:

1 1 | 3 𝑟2 ← 𝑅2 − 3𝑅1 1 1 | 3
Pivot element 3 −4 | 2 0 −7 | −7

We want to get a 0 here


• Solving leads to
2
𝑥=
1
Example with three equations
• Consider
−3𝑥1 + 2𝑥2 − 𝑥3 = −1
ቐ 6𝑥1 − 6𝑥2 + 7𝑥3 = −7
3𝑥1 − 4𝑥2 + 4𝑥3 = −6
• Augmented matrix notation

−3 2 −1 | −1
6 −6 7 | −7
3 −4 4 | −6
Example with three equations
• Solving:
−3 2 −1 | −1 𝑟2 ← 𝑅2 − −2 𝑅1 −3 2 −1 | −1
6 −6 7 | −7 𝑟3 ← 𝑅3 − −1 𝑅1 0 −2 5 | −9
3 −4 4 | −6 0 −2 3 | −7

−3 2 −1 | −1 −3 2 −1 | −1
𝑟3 ← 𝑅3 − 𝑅2
0 −2 5 | −9 0 −2 5 | −9
0 −2 3 | −7 0 0 −2 | 2
Example with three equations
• Back substitution

−3 2 −1 | −1 2
Back substitution
0 −2 5 | −9 𝑥= 2
0 0 −2 | 2 −1
Gauss Jordan Elimination
Working Procedure

• Find Augmented Matrix for the given equation.

• Transform augmented Matrix into Normal form/ Reduced Echelon form.

• Find Equations corresponding to Normal form.

• Find solutions of given system of equations.


Example
Use Gauss-Jordan elimination to solve the system

The augmented matrix of the system is


Cont.
End of Section

You might also like