0% found this document useful (0 votes)
33 views48 pages

Numerical Analysis

1) The document discusses solving systems of linear equations using Cramer's Rule and the matrix inverse method. 2) Cramer's Rule involves calculating determinants of matrices where one column is replaced by the constant vector to solve for each unknown. 3) The matrix inverse method involves writing the system of equations in matrix form and solving for the unknown vector by multiplying both sides by the inverse of the coefficient matrix.

Uploaded by

Yordanos Tefera
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)
33 views48 pages

Numerical Analysis

1) The document discusses solving systems of linear equations using Cramer's Rule and the matrix inverse method. 2) Cramer's Rule involves calculating determinants of matrices where one column is replaced by the constant vector to solve for each unknown. 3) The matrix inverse method involves writing the system of equations in matrix form and solving for the unknown vector by multiplying both sides by the inverse of the coefficient matrix.

Uploaded by

Yordanos Tefera
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/ 48

CHAPTER THREE

SOLVING SYSTEMS OF EQUATIONS


●●●
System of Linear Equations
● Consider a system of 𝑛 linear algebraic equation in 𝑛 unknowns.
𝑎11 𝑥1 + 𝑎12 𝑥2 + ⋯ + 𝑎1𝑛 𝑥𝑛 = 𝑏1
𝑎21 𝑥1 + 𝑎22 𝑥2 + ⋯ + 𝑎2𝑛 𝑥𝑛 = 𝑏2

𝑎𝑛1 𝑥1 + 𝑎𝑛2 𝑥2 + ⋯ + 𝑎𝑛𝑛 𝑥𝑛 = 𝑏𝑛
where 𝑎𝑖𝑗 , 𝑖, 𝑗 = 1, 2,3, … , 𝑛 are the known coefficients,
𝑏𝑖 , 𝑖, 𝑗 = 1, 2,3, … , 𝑛 are the known values and
𝑥𝑖 , 𝑖, 𝑗 = 1, 2,3, … , 𝑛 are the unknowns to be determined.

05/01/2024 Prepared by Zerihun Mekoya 1


System of Linear Equations
●●●
● In matrix form the above system can be written as
𝐴𝑋 = 𝐵
𝑎11 𝑎12 ⋯ 𝑎𝑛1 𝑏1
𝑎21 𝑎22 ⋯ 𝑎2𝑛 𝑏2
where 𝐴 = ⋮ ⋮ ⋮ is coefficient matrix, 𝐵 =

𝑎𝑛1 𝑎𝑛2 𝑎𝑛𝑛 𝑏𝑛
𝑥1
𝑥2
which is a column vector and 𝑋 = is the unknown column

𝑥𝑛
vector .

05/01/2024 Prepared by Zerihun Mekoya 2


Method of Solution of the Linear System
●●●
● The method of solution of the linear system is classified in to
two parts.

1. Direct Methods: Direct methods give the exact solution after a


finite number of steps. We assume here that there are no round
off errors.

2. Indirect or Iterative Methods: gives a sequence of


approximate solutions, which converges when the number of
steps tends to infinity.

05/01/2024 Prepared by Zerihun Mekoya 3


Direct Methods
●●●
● Cramer’s Rule
Cramer’s Rule is the analytical method for solving the
given system of equation
𝐴𝑋 = 𝐵
and the solution takes the form
𝐵𝑖
𝑥𝑖 = , 𝑖 = 1,2,3, … , 𝑛.
𝐴
Where 𝐵𝑖 is the matrix obtained by replacing the 𝑖 𝑡𝑕
column of 𝐴 by the vector 𝑏.

05/01/2024 Prepared by Zerihun Mekoya 4


Cramer’s Rule
●●●
● For three equations and three unknowns:
● Consider the system
𝑎11 𝑥1 + 𝑎12 𝑥2 + 𝑎13 𝑥3 = 𝑏1
𝑎21 𝑥1 + 𝑎22 𝑥2 + 𝑎23 𝑥3 = 𝑏2
𝑎31 𝑥1 + 𝑎32 𝑥2 + 𝑎33 𝑥3 = 𝑏3
● In matrix form the above system can be written as
𝐴𝑋 = 𝑏
𝑎11 𝑎12 𝑎13 𝑥1 𝑏1
where 𝐴 = 𝑎21 𝑎22 𝑎23 , 𝑋 = 𝑥2 and 𝑏 = 𝑏2 .
𝑎31 𝑎32 𝑎33 𝑥3 𝑏3

05/01/2024 Prepared by Zerihun Mekoya 5


Cramer’s Rule
●●●
● The matrix 𝐵1 is obtained by replacing the 1𝑠𝑡 column of 𝐴 by
𝑏1 𝑎12 𝑎13
the vector 𝑏. Thus, 𝐵1 = 𝑏2 𝑎22 𝑎23 .
𝑏3 𝑎32 𝑎33
● The matrix 𝐵2 is obtained by replacing the 2𝑛𝑑 column of 𝐴 by
𝑎11 𝑏1 𝑎13
the vector 𝑏. Thus, 𝐵2 = 𝑎21 𝑏2 𝑎23 ,
𝑎31 𝑏3 𝑎33
● The matrix 𝐵3 is obtained by replacing the 3𝑟𝑑 column of 𝐴 by
𝑎11 𝑎12 𝑏1
the vector 𝑏. Thus, 𝐵3 = 𝑎21 𝑎22 𝑏2
𝑎31 𝑎32 𝑏3
05/01/2024 Prepared by Zerihun Mekoya 6
Cramer’s Rule Example
●●●
● Solve the following system using Cramer’s Rule
2𝑥1 − 3𝑥2 + 𝑥3 = 1
𝑥1 + 𝑥2 − 𝑥3 = 0
𝑥1 − 2𝑥2 + 𝑥3 = −1
● Solution: Here
2 −3 1
● 𝐴 = 1 1 −1 ⟹ 𝐴 = 1,
1 −2 1
1 −3 1
● 𝐵1 = 0 1 −1 ⇒ 𝐵1 =-3
−1 −2 1

05/01/2024 Prepared by Zerihun Mekoya 7


Cramer’s Rule Example
●●●
1 1 2
● 𝐵2 = 1 0 −1 ⇒ 𝐵2 = −5
1 −1 1
2 −3 1
● 𝐵3 = 1 1 0 ⇒ 𝐵3 = −8
1 −2 −1

By Cramer’s rule, we get

𝐵1 𝐵2 𝐵3
𝑥1 = = −3, 𝑥2 = = −5, 𝑥3 = = −8
𝐴 𝐴 𝐴

05/01/2024 Prepared by Zerihun Mekoya 8


Cramer’s Rules as Test for Number
of Solutions
●●●
Let 𝐴𝑋 = 𝑏 be a system of 𝑛 linear equations in 𝑛 variables.

● If 𝐴 ≠ 0, then the system 𝐴𝑋 = 𝑏 is consistent and has a unique solution.

● If 𝐴 = 0 and 𝐵𝑖 = 0 for all 𝑖 = 1,2, … , 𝑛 the system is consistent and has


infinitely many solutions (but it cannot be solved by Cramer’s rule).

● If 𝐴 = 0, and at least one of the 𝐵𝑖 is nonzero, then the system has no


solution. Such systems are called inconsistent.

Note: Cramer’s Rule is valid only when the system is square system (i.e., a system in

which the number of equations is equal to the number of variables) and for systems

whose coefficient matrix is non-singular.

05/01/2024 Prepared by Zerihun Mekoya 9


Matrix Inverse Method
●●●
● A given system of simultaneous equation can be written in
matrix form as 𝐴𝑋 = 𝑏. Suppose the coefficient matrix 𝐴 is
invertible. Then, if we multiply both sides by 𝐴−1 , 𝐴𝑋 = 𝑏
⟹ 𝐴−1 𝐴𝑋 = 𝐴−1 b ⟹ 𝑋 = 𝐴−1 𝑏

● Therefore, the matrix equation of the form 𝐴𝑋 = 𝑏 has a unique


solution given by 𝑋 = 𝐴−1 𝑏 whenever 𝐴−1 exits. This method is
known as matrix inverse method.

05/01/2024 Prepared by Zerihun Mekoya 10


Matrix Inverse Method Example
●●●
● Obtain the solution of the following linear simultaneous
equations by the matrix inversion method
2𝑥 + 𝑦 + 𝑧 = 5
3𝑥 + 5𝑦 + 2𝑧 = 15
2𝑥 + 𝑦 + 4𝑧 = 8

05/01/2024 Prepared by Zerihun Mekoya 11


Solution
●●●
● Now converting given equations into matrix form

2 1 1 𝑥 5
3 5 2 𝑦 = 15
2 1 4 𝑧 8

2 1 1 𝑥 5
● Now, 𝐴 = 3 5 2 , 𝑋 = 𝑦 and 𝑏 = 15
2 1 4 𝑧 8

𝐴𝑋 = 𝑏 ∴ 𝑋 = 𝐴−1 𝑏
05/01/2024 Prepared by Zerihun Mekoya 12
Solution
●●●

2 1 1
5 2 3 2 3 5
● det(𝐴) = 3 5 2 =2 −1 +1
1 4 2 4 2 1
2 1 4

= 2 × (5 × 4 − 2 × 1) − 1 × (3 × 4 − 2 × 2) + 1 × (3 × 1
− 5 × 2) = 2 × (20 − 2) − 1 × (12 − 4) + 1 × (3 − 10)
= 2 × 18 − 1 × 8 + 1 × −7 = 36 − 8 − 7 = 21

05/01/2024 Prepared by Zerihun Mekoya 13


Solution
●●●
● The determinant of 𝐴 is not zero, therefore the inverse matrix 𝐴−1 exist. To
calculate the inverse matrix find additional minors and cofactors of matrix 𝐴
● Find the minor 𝑀11 and the cofactor 𝑐11 . In matrix 𝐴 cross out row 1 and
column 1.
5 2
𝑀11 = = 5 · 4 − 1 · 2 = 20 − 2 = 18 ⇒ 𝑐11 = (−1)1+1 𝑀11 = 18
1 4
● Find the minor 𝑀12 and the cofactor 𝑐12 . In matrix 𝐴 cross out row 1 and
column 2.
3 2
𝑀12 = = 3 · 4 − 2 · 2 = 12 − 4 = 8 ⇒ 𝑐12 = (−1)1+2 𝑀12 = −8
2 4
● Find the minor 𝑀13 and the cofactor 𝑐13 . In matrix 𝐴 cross out row 1 and
column 3.
3 5
𝑀13 = = 3 · 1 − 2 · 5 = 3 − 10 = −7 ⇒ 𝑐13 = (−1)1+3 𝑀13 = −7
2 1

05/01/2024 Prepared by Zerihun Mekoya 14


Solution
●●●
● Find the minor 𝑀21 and the cofactor 𝑐21 . In matrix 𝐴 cross out row 2 and
column 1.
1 1
𝑀21 = = 1 · 4 − 1 · 1 = 4 − 1 = 3 ⇒ 𝑐21 = (−1)2+1 𝑀21 = −3
1 4
● Find the minor 𝑀22 and the cofactor 𝑐22 . In matrix 𝐴 cross out row 2 and
column 2.
2 1
𝑀22 = = 2 · 4 − 2 · 1 = 8 − 2 = 6 ⇒ 𝑐22 = (−1)2+2 𝑀22 = 6
2 4
● Find the minor 𝑀23 and the cofactor 𝑐23 . In matrix 𝐴 cross out row 2 and
column 3.
2 1
𝑀23 = = 2 · 1 − 2 · 1 = 2 − 2 = 0 ⇒ 𝑐23 = (−1)2+3 𝑀23 = 0
2 1

05/01/2024 Prepared by Zerihun Mekoya 15


Solution
●●●
● Find the minor 𝑀31 and the cofactor 𝑐31 . In matrix 𝐴 cross out row 3 and
column 1.
1 1
𝑀31 = = 1 · 2 − 5 · 1 = 2 − 5 = −3 ⇒ 𝑐31 = (−1)3+1 𝑀31 = −3
5 2
● Find the minor 𝑀32 and the cofactor 𝑐32 . In matrix 𝐴 cross out row 3 and
column 2.
2 1
𝑀32 = = 2 · 2 − 3 · 1 = 4 − 3 = 1 ⇒ 𝑐32 = (−1)3+2 𝑀32 = −1
3 2
● Find the minor 𝑀33 and the cofactor 𝑐33 . In matrix 𝐴 cross out row 3 and
column 3.
2 1
𝑀33 = = 2 · 5 − 3 · 1 = 10 − 3 = 7 ⇒ 𝑐33 = (−1)3+3 𝑀33 = 7
3 5

05/01/2024 Prepared by Zerihun Mekoya 16


Solution
●●●
● Write the matrix of cofactors:
18 −8 −7
𝐶 = −3 6 0
−3 −1 7
● Transposed matrix of cofactors:
18 −3 −3
𝑡
𝐶 = −8 6 −1 = 𝐴𝑑𝑗(𝐴)
−7 0 7
● Find inverse matrix:
6 1 1
− −
7 7 7
𝐴𝑑𝑗(𝐴) 8 2 1
𝐴−1 = = − −
det(𝐴) 21 7 21
1 1
− 0
3 3

05/01/2024 Prepared by Zerihun Mekoya 17


Solution
●●●
● Find a solution:
6 1 1
− −
7 7 7 5
8 2 1
𝑋 = 𝐴−1 𝑏 = − 21 7 − 21 15 =
1 1 8
− 0
3 3
6 1 1 30 15 8
. 5 + − . 15 + − . 8 − −
7 7 7 7 7 7 1
8 2 1 40 30 8
− .5 + . 15 + − .8 = − + − = 2
21 7 21 21 7 21
1 1 5 8 1
− . 5 + 0.15 + . 8 − +0+
3 3 3 21
1 𝑥
⇒𝑋= 2 = 𝑦
1 𝑧
● Hence given system of equations has a solution 𝑥 = 1, 𝑦 = 2 and 𝑧 = 1.

05/01/2024 Prepared by Zerihun Mekoya 18


Gaussian Elimination Method
●●●
● Here, the unknowns are eliminated by combining equations such that the 𝑛
equations in 𝑛 unknowns are reduced to an equivalent upper triangular
system which is then solved by back substitution method. The main
advantage of this method is that it is applicable to any system of linear
equations.

● To solve the system 𝐴𝑋 = 𝑏 using Gaussian elimination method:


Step 1: Form the augmented matrix 𝐴 𝑏 of the system.

Step 2: Transform the matrix 𝐴 of 𝐴 𝑏 into an upper triangular matrix by


using elementary row operations (That is 𝐴 𝑏 ⟶ 𝑈 𝑐 .)

Step 3: Form new system using 𝑈𝑋 = 𝑐 and solve by back substitution method.
05/01/2024 Prepared by Zerihun Mekoya 19
Gaussian Elimination Method
Example 1
●●●
● Solve the system of equations by using Gaussian
elimination method
2𝑥 + 3𝑦 + 𝑧 = −1
3𝑥 + 3𝑦 + 𝑧 = 1
2𝑥 + 4𝑦 + 𝑧 = −2
.

05/01/2024 Prepared by Zerihun Mekoya 20


Gaussian Elimination Method
Example 2
●●●
● Solve the system of equations by using Gaussian elimination method
𝑥 − 3𝑦 + 𝑧 = −1
2𝑥 + 𝑦 − 4𝑧 = −1
6𝑥 − 7𝑦 + 8𝑧 = 7
● Solution: The given system of equations can be written as 𝐴𝑋 = 𝑏, where
1 −3 1 −1 𝑥
𝐴 = 2 1 −4 , 𝑏 = −1 and 𝑋 = 𝑦
6 −7 8 7 𝑧
● Now we have the augmented matrix 𝐴 𝑏 as
1 −3 1 −1
2 1 −4 −1
6 −7 8 7
● Apply 𝑅2 → 𝑅2 − 2𝑅1 and 𝑅3 → 𝑅3 − 6𝑅1 . Here elementary row operation
that we applied on 𝐴, is also apply on 𝑏 simultaneously.

05/01/2024 Prepared by Zerihun Mekoya 21


Gaussian Elimination Method
Example 2
●●●
1 −3 1 −1
0 7 −6 −1
0 11 2 13
1
● Apply 𝑅2 → 7 𝑅2
1 −3 1 −1
−6 1
0 1
7 7
0 11 2 13
● Apply 𝑅3 → 𝑅3 − 11𝑅2
1 −3 1 −1
−6 1
0 1
7 7
80 80
0 0
7 7

05/01/2024 Prepared by Zerihun Mekoya 22


Gaussian Elimination Method
Example 2
●●●
7
● Apply 𝑅3 → 𝑅
80 3
1 −3 1 −1
−6 1
0 1
7 7
0 0 1 1
● Finally we can rewrite this augmented matrix as
1 −3 1 𝑥 −1
−6 1
0 1 𝑦 =
7 𝑧 7
0 0 1 1
Thus we have reduced coefficient matrix A to upper triangular matrix. Therefore
𝑥 − 3𝑦 + 𝑧 = −1
6 1
𝑦− 𝑧=
7 7
𝑧=1
● Hence given system of equations has a solution 𝑥 = 1, 𝑦 = 1 and 𝑧 = 1.

05/01/2024 Prepared by Zerihun Mekoya 23


Gauss-Jordan's Method
●●●
● Gauss-Jordan method is an extension of the Gauss elimination method. The
set of equations 𝐴𝑥 = 𝑏 is reduced to a diagonal set 𝐼𝑥 = 𝑏′, where 𝐼 is a
unit matrix. This is equivalent to 𝑥 = 𝑏′. The solution vector is therefore
obtained directly from 𝑏′ .
● Gauss-Jordan method also provides the inverse of the coefficient matrix. The
Gauss-Jordan method requires more computational effort than Gauss
elimination process.
● Hence, the Gauss-Jordan method gives
𝐴: 𝑏 → 𝐼: 𝑑
● To find the inverse of a matrix 𝐴 using Gauss-Jordan method, we start with
the augmented matrix 𝐴 with the identity matrix 𝐼 of the same order. When
the Gauss-Jordan method procedure is completed we obtain
𝐴: 𝐼 → 𝐼: 𝐴−1

05/01/2024 Prepared by Zerihun Mekoya 24


Gauss-Jordan's Method Example
●●●
1. Solve the following system of equations
𝑥1 + 𝑥2 + 𝑥3 = 1
4𝑥1 + 3𝑥2 − 𝑥3 = 6
3𝑥1 + 5𝑥2 + 3𝑥3 = 4
2. Using the Gauss-Jordan method, find the inverse of
2 2 3
𝐴= 2 1 1
1 3 5

05/01/2024 Prepared by Zerihun Mekoya 25


LU Decomposition Method
●●●
● In this method, the coefficient matrix 𝐴 of the system of equation is
decomposed or factored in to the product of a lower triangular matrix 𝐿 and
upper triangular matrix 𝑈. We write the matrix 𝐴 as
𝐴 = 𝐿𝑈

𝑙11 0 0 … … 0 𝑢11 𝑢12 𝑢13 ⋯ ⋯ 𝑢1𝑛


𝑙21 𝑙22 0 … … 0 0 𝑢22 𝑢23 ⋯ ⋯ 𝑢2𝑛
𝐿 = 𝑙31 𝑙32 𝑙33 0 … 0 and U = 0 0 𝑢33 ⋯ ⋯ 𝑢3𝑛
⋮ ⋱ ⋮ ⋮ ⋱
𝑙𝑛1 𝑙𝑛2 𝑙𝑛3 ⋯ ⋯ 𝑙𝑛𝑛 0 0 ⋯ ⋯ 0 𝑢𝑛𝑛
● To produce a unique solution it is convenient to choose either 𝑙𝑖𝑖 = 1 or
𝑢𝑖𝑖 = 1 when we choose 𝑙𝑖𝑖 = 1 the method is Doolittle’s method and 𝑢𝑖𝑖 = 1
the method is called Crout’s mehtod.

05/01/2024 Prepared by Zerihun Mekoya 26


LU Decomposition Method
●●●
Solve the following set of equations by using the Doolittle’s method:

2𝑥1 + 𝑥2 + 𝑥3 = 5
3𝑥1 + 5𝑥2 + 2𝑥3 = 15
2𝑥1 + 𝑥2 + 4𝑥3 = 8

05/01/2024 Prepared by Zerihun Mekoya 27


Cholesky Method
●●●
Reading Assignment

05/01/2024 Prepared by Zerihun Mekoya 28


Indirect (Iterative) Methods of Solving System of Linear
Equations

●●●
Iterative methods (Self-correcting methods) are which begin with

an approximate solution and obtain an improved solution with each

step of iteration.
Let us consider the system of equations
𝑎11 𝑥1 + 𝑎12 𝑥2 + 𝑎13 𝑥3 = 𝑏1 (1)
𝑎21 𝑥1 + 𝑎22 𝑥2 + 𝑎23 𝑥3 = 𝑏2 (2)
𝑎31 𝑥1 + 𝑎32 𝑥2 + 𝑎33 𝑥3 = 𝑏3 (3)
Let the coefficient matrix be diagonally dominant and solve for 𝑥1 ,
𝑥2 and 𝑥3 from Equations (1), (2) and (3) respectively, we get

05/01/2024 Prepared by Zerihun Mekoya 29


Indirect (Iterative) Methods of Solving System of Linear
Equations

●●●

1
𝑥1 = (𝑏1 − 𝑎12 𝑥2 − 𝑎13 𝑥3 )
𝑎11
1
𝑥2 = (𝑏2 − 𝑎21 𝑥1 − 𝑎23 𝑥3 ) (4)
𝑎22
1
𝑥3 = (𝑏3 − 𝑎31 𝑥1 − 𝑎32 𝑥2 )
𝑎33

05/01/2024 Prepared by Zerihun Mekoya 30


Gauss Jacobi Method
●●●
● Let 𝑥1 (0) , 𝑥2 (0) and 𝑥3 (0) be the initial approximations of the
unknowns 𝑥1 , 𝑥2 and 𝑥3 . Then the first approximations are
given by
(1)
1
𝑥1 = 𝑏1 − 𝑎12 𝑥2 0 − 𝑎13 𝑥3 0
𝑎11
(1)
1
𝑥2 = 𝑏2 − 𝑎21 𝑥1 0 − 𝑎23 𝑥3 0
𝑎22
(1)
1
𝑥3 = 𝑏3 − 𝑎31 𝑥1 0 − 𝑎32 𝑥2 0
𝑎33
Similarly, the second approximations are given by

05/01/2024 Prepared by Zerihun Mekoya 31


Gauss Jacobi Method
●●●
(2)
1
𝑥1 = 𝑏1 − 𝑎12 𝑥2 1 − 𝑎13 𝑥3 1
𝑎11
1
𝑥2 (2) = 𝑏2 − 𝑎21 𝑥1 1 − 𝑎23 𝑥3 1
𝑎22
1
𝑥3 (2) = 𝑏3 − 𝑎31 𝑥1 1 − 𝑎32 𝑥2 1
𝑎33
Proceeding in the same way, if 𝑥1 (𝑘) , 𝑥2 (𝑘) and 𝑥3 (𝑘) are the nth
approximations, then the next approximation given by the formula

05/01/2024 Prepared by Zerihun Mekoya 32


Gauss Jacobi Method
●●●
(𝑘+1)
1
𝑥1 = 𝑏1 − 𝑎12 𝑥2 𝑘 − 𝑎13 𝑥3 𝑘
𝑎11
1
𝑥2 (𝑘+1) = 𝑏2 − 𝑎21 𝑥1 𝑘 − 𝑎23 𝑥3 𝑘
𝑎22
1
𝑥3 (𝑘+1) = 𝑏3 − 𝑎31 𝑥1 𝑘 − 𝑎32 𝑥2 𝑘
𝑎33
● The process is continued till convergence is secured. This
method is called the method of simultaneous displacements.

05/01/2024 Prepared by Zerihun Mekoya 33


Gauss Seidel Method
●●●
● Let 𝑥1 (0) , 𝑥2 (0) and 𝑥3 (0) be the initial approximations of the
unknowns 𝑥1 , 𝑥2 and 𝑥3 . Then the first approximations are
given by
(1)
1
𝑥1 = 𝑏1 − 𝑎12 𝑥2 0 − 𝑎13 𝑥3 0
𝑎11
(1)
1
𝑥2 = 𝑏2 − 𝑎21 𝑥1 1 − 𝑎23 𝑥3 0
𝑎22
(1)
1
𝑥3 = 𝑏3 − 𝑎31 𝑥1 1 − 𝑎32 𝑥2 1
𝑎33
● Similarly, the second approximations are given by
05/01/2024 Prepared by Zerihun Mekoya 34
Gauss Seidel Method
●●●
(2)
1
𝑥1 = 𝑏1 − 𝑎12 𝑥2 1 − 𝑎13 𝑥3 1
𝑎11
1
𝑥2 (2) = 𝑏2 − 𝑎21 𝑥1 2 − 𝑎23 𝑥3 1
𝑎22
1
𝑥3 (2) = 𝑏3 − 𝑎31 𝑥1 2 − 𝑎32 𝑥2 2
𝑎33
● Proceeding in the same way, if 𝑥1 (𝑘) , 𝑥2 (𝑘) and 𝑥3 (𝑘) are the nth
approximations, then the next approximation of the method is
given by the formula

05/01/2024 Prepared by Zerihun Mekoya 35


Gauss Seidel Method
●●●
(𝑘+1)
1
𝑥1 = 𝑏1 − 𝑎12 𝑥2 𝑘 − 𝑎13 𝑥3 𝑘
𝑎11
(𝑘+1)
1
𝑥2 = 𝑏2 − 𝑎21 𝑥1 𝑘+1 − 𝑎23 𝑥3 𝑘
𝑎22
(𝑘+1)
1
𝑥3 = 𝑏3 − 𝑎31 𝑥1 𝑘+1 − 𝑎32 𝑥2 𝑘+1
𝑎33
The most recent approximations of the unknowns are used while
proceeding to the next step and process is continued till
convergence is secured. This method is called the method of
successive displacements.
05/01/2024 Prepared by Zerihun Mekoya 36
Example
●●●
Solve the equations
10𝑥1 + 2𝑥2 − 𝑥3 = 7
𝑥1 + 8𝑥2 + 3𝑥3 = −4
−2𝑥1 − 𝑥2 + 10𝑥3 = 9

By (a) Gauss Jacobi Method (b) Gauss Seidel Method

Correct to two decimal places and start with the solution (0, 0, 0).

05/01/2024 Prepared by Zerihun Mekoya 37


Exercises
●●●
1. State the condition of convergence of Gauss Seidel Iteration
Method.

2. Apply Gauss Jacobi and Gauss Seidel Iteration Methods, upto


six iterations, to solve the system defined by
28𝑥1 + 4𝑥2 − 𝑥3 = 32
2𝑥1 + 17𝑥2 + 4𝑥3 = 35
𝑥1 + 3𝑥2 + 10𝑥3 = 24

05/01/2024 Prepared by Zerihun Mekoya 38


Solving System of Non-Linear
Equations
●●●
● In this section, we consider a generalization of the Newton
Raphson method to systems of nonlinear equation, a technique
known as Modified Newton Raphson method (Multivariate
Newton Raphson method).

● We now extend the methods derived for the single equation


𝑓(𝑥) = 0 to a system of nonlinear equations.

05/01/2024 Prepared by Zerihun Mekoya 39


Solving system of Non-Linear
Equations
●●●
● We first consider a system of two nonlinear equations in two unknowns and
thereafter the derivation of the method for any finite number of equation can
be done in a similar way. Thus, consider the solution of the following systems
of equations.

𝑓 𝑥, 𝑦 = 0
(1)
𝑔 𝑥, 𝑦 = 0

● Let 𝑥0 , 𝑦0 be an initial approximation to the root of Equation (1). If


𝑥0 + 𝑕, 𝑦0 + 𝑘 is the root of the system, then we must have

05/01/2024 Prepared by Zerihun Mekoya 40


Solving system of Non-Linear
Equations
●●●
𝑓 𝑥0 + 𝑕, 𝑦0 + 𝑘 = 0
(2)
𝑔 𝑥0 + 𝑕, 𝑦0 + 𝑘 = 0
● Assuming that 𝑓 and 𝑔 are sufficiently differentiable, we expand both the
functions in Equation (2) by Taylor’s series to obtain
𝜕𝑓 𝜕𝑓
𝑓0 + 𝑕 +𝑘 +⋯=0
𝜕𝑥0 𝜕𝑦0
(3)
𝜕𝑔 𝜕𝑔
𝑔0 + 𝑕 +𝑘 + ⋯ = 0,
𝜕𝑥0 𝜕𝑦0
where
𝜕𝑓 𝜕𝑓
= , 𝑓0 = 𝑓 𝑥0 , 𝑦0 , 𝑒𝑡𝑐
𝜕𝑥0 𝜕𝑥 𝑥 , 𝑦
0 0
● Neglecting the second and higher-order derivative terms, we obtain the
following system of linear equations:

05/01/2024 Prepared by Zerihun Mekoya 41


Solving system of Non-Linear
Equations
●●●
𝜕𝑓 𝜕𝑓
𝑕 +𝑘 = −𝑓0
𝜕𝑥0 𝜕𝑦0
(4)
𝜕𝑔 𝜕𝑔
𝑕 +𝑘 = −𝑔0
𝜕𝑥0 𝜕𝑦0
Equation (4) possesses a unique solution if
𝜕𝑓 𝜕𝑓
𝜕𝑥0 𝜕𝑦0
𝐷= ≠ 0.
𝜕𝑔 𝜕𝑔
𝜕𝑥0 𝜕𝑦0
In the matrix notation, the system (4) can be written as 𝐴𝑥 = 𝑏, where
𝜕𝑓 𝜕𝑓
𝜕𝑥0 𝜕𝑦0 𝑕 −𝑓0
𝐴= ,𝑥= ,𝑏 = ,
𝜕𝑔 𝜕𝑔 𝑘 −𝑔0
𝜕𝑥0 𝜕𝑦0

05/01/2024 Prepared by Zerihun Mekoya 42


Solving system of Non-Linear
Equations
●●●
By Cramer’s rule, the solution of Equation (9) is given by

𝜕𝑓 𝜕𝑓
−𝑓0 −𝑓0
1 𝜕𝑦0 1 𝜕𝑥0
𝑕= 𝜕𝑔
and 𝑘 = (5)
𝐷 𝐷 𝜕𝑔
−𝑔0 −𝑔0
𝜕𝑦0 𝜕𝑥0

The new approximations are, therefore,

● 𝒙𝟏 = 𝒙𝟎 + 𝒉 and 𝒚𝟏 = 𝒚𝟎 + 𝒌
The process is to be repeated till we obtain the roots to the desired accuracy. This
is the same as saying

05/01/2024 Prepared by Zerihun Mekoya 43


Solving system of Non-Linear
Equations
●●●
𝑥𝑖+1 = 𝑥𝑖 + 𝑕 and 𝑦𝑖+1 = 𝑦𝑖 + 𝑘, 𝑖 = 0, 1, 2, …

where

𝜕𝑓 𝜕𝑓 𝜕𝑓 𝜕𝑓
−𝑓𝑖 −𝑓𝑖
1 𝜕𝑦𝑖 1 𝜕𝑥𝑖 𝜕𝑥𝑖 𝜕𝑦𝑖
𝑕= ,𝑘 = ,𝐷 =
𝐷 𝜕𝑔 𝐷 𝜕𝑔 𝜕𝑔 𝜕𝑔
−𝑔𝑖 −𝑔𝑖
𝜕𝑦𝑖 𝜕𝑥𝑖 𝜕𝑥𝑖 𝜕𝑦𝑖
● This method of solving systems of nonlinear equations can also be
generalized (extended) for solving a system of 𝑛 equations into 𝑛 unknowns.

05/01/2024 Prepared by Zerihun Mekoya 44


Example
●●●
● Solve the following system of nonlinear equations
3𝑦𝑥 2 − 10𝑥 + 7 = 0
𝑦 2 − 5𝑦 + 4 = 0,
with 𝑥0 = 𝑦0 = 0.5 using the Multivariate Newton Raphson Method. Carry out
two iterations.
● Solution: We have
𝑓 𝑥, 𝑦 = 3𝑦𝑥 2 − 10𝑥 + 7
𝑔 𝑥, 𝑦 = 𝑦 2 − 5𝑦 + 4
Then,
𝜕𝑓 𝜕𝑓
= 6𝑦𝑥 − 10, = 3𝑥 2 ,
𝜕𝑥 𝜕𝑦
𝜕𝑔 𝜕𝑔
= 0, = 3𝑦 − 5
𝜕𝑥 𝜕𝑦

05/01/2024 Prepared by Zerihun Mekoya 45


Example
●●●
𝜕𝑓 𝜕𝑓
● 𝜕𝑥0
= −8.5,
𝜕𝑦0
= 0.75, 𝑓0 = 2.375,
𝜕𝑔 𝜕𝑔
● 𝜕𝑥0
= 0,
𝜕𝑦0
= −4, 𝑔0 = 1.75
−8.5 0.75
● Hence, 𝐷= = 34.
0 −4
Therefore,

● 𝑕 = 34 −2.375 0.75
1 1 −8.5 −2.375
= 0.3180, and 𝑘 = = 0.4375.
−1.75 −4 34 0 −1.75
It follows that
𝑥1 = 0.5 + 0.3180 = 0.8180
and
𝑦1 = 0.5 + 0.4375 = 0.9375

05/01/2024 Prepared by Zerihun Mekoya 46


Example
●●●
For the second approximation, we have
𝑓1 = 0.7019, 𝑔1 = 0.1914,
𝜕𝑓 𝜕𝑓 𝜕𝑔 𝜕𝑔
= −5.3988, = 2.0074, = 0, = −3.125.
𝜕𝑥1 𝜕𝑦1 𝜕𝑥1 𝜕𝑦1
Therefore,
−5.3988 2.0074
𝐷= = 16.8712.
0 −3.125
● Hence, 𝑕 = 16.8712 −0.7019 2.0074 = 0.1528, and
1
−0.1914 −3.125

1 −5.3988 −0.7019
𝑘= = 0.0612.
16.8712 0 −0.1914
It follows that 𝑥2 = 0.8180 + 0.1528 = 0.9708 and
𝑦2 = 0.9375 + 0.0612 = 0.9987

05/01/2024 Prepared by Zerihun Mekoya 47


Exercises
●●●
1. Use NRM to solve the equations 𝑥 = 𝑥 2 + 𝑦 2 , 𝑦 = 𝑥 2 − 𝑦 2 correct to two
decimals, starting with the approximation 0.8, 0.4 .

2. Solve the non-linear equations 𝑥 2 − 𝑦 2 = 4, 𝑥 2 + 𝑦 2 = 16 numerically with


𝑥0 = 𝑦0 = 2.828 using NRM. Carry out two iterations.

3. Solve the equations 2𝑥 2 + 3𝑥𝑦 + 𝑦 2 = 3; 4𝑥 2 + 2𝑥𝑦 + 𝑦 2 = 30. Correct to


three decimal places, using NRM, given that 𝑥0 = −3 and 𝑦0 = 2.

05/01/2024 Prepared by Zerihun Mekoya 48

You might also like