Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

‫قسم الهندسة الميكانيكية‬

Mechanical Engineering Department

College of Engineering-Sabratha

Numerical
‫‪PART TWO‬‬

‫يتناول هذا الفصل المعادالت الجبرية التي يمكن تمثيلها بشكل عام ‪:‬‬
3-GAUSS-JORDAN
The Gauss-Jordan method is a variation of Gauss elimination. The major difference is
that when an unknown is eliminated in the Gauss-Jordan method, it is eliminated
from all other equations rather than just the subsequent ones.

In addition, all rows are normalized by dividing them by their pivot elements.
Example :
Use Gauss jordan to solve:
2 1 0 4
2x + y = 4 *:Solution: −2 0 −1 0 อ
-2x -z = 0 transfer the equation to Augmented matrix 3 −1 1 −1
3x - y + z = -1
Find the pivot element then change the rows
−1 1 −1
3 −1 1 −1 1
Divide first row by 3 3 3 3ተ
−2 0 −1 0 อ −2 0 −1 0
2 1 0 4 −1 1 −1 2 1 0 4
1
𝑎
21 3 3 3
𝑅2𝑛 = 𝑎2𝑛 - 𝑝𝑖𝑣𝑜𝑡 *𝑎1𝑛 −2 −1 −2
0
𝑎31 3 3 3
𝑅3𝑛 = 𝑎3𝑛 - * 𝑎1𝑛 5 −2 14
𝑝𝑖𝑣𝑜𝑡
0
3 3 3
Example :
−1 1 −1
1 −𝟏 𝟏 −𝟏
3 3 3 Find the pivot element between 𝟏
−2 −1 −2 𝑹𝟐 𝒂𝒏𝒅 𝑹𝟑 , then change the rows 𝟑 𝟑 𝟑
0 𝟓 −𝟐 𝟏𝟒
3 3 3 𝟎
𝟑 𝟑 𝟑
5 −2 14
0 −𝟐 −𝟏 −𝟐
3 3 3 𝟎
𝟓 𝟑 𝟑 𝟑
Divide Second row by 𝟑
−𝟏𝟏 −𝟏 𝟏 𝟑
𝟏 𝟏 𝟎
𝟑 𝟑 𝟑 𝑎12 𝟓 𝟓
−𝟐 𝟏𝟒 𝑅1𝑛 = 𝑎1𝑛 - 𝑝𝑖𝑣𝑜𝑡 *𝑎2𝑛
−𝟐 𝟏𝟒
𝟎 𝟏 𝟎 𝟏
𝟓 𝟓 𝟓 𝟓
−𝟐 −𝟏 −𝟐 𝑎32
𝑅3𝑛 = 𝑎3𝑛 - 𝑝𝑖𝑣𝑜𝑡 *𝑎2𝑛 −𝟑 𝟔
𝟎 𝟎 𝟎
𝟑 𝟑 𝟑 𝟓 𝟓
Example :
𝟏 𝟑 𝟏 𝟑
𝟏 𝟎 𝟏 𝟎
𝟓 𝟓 𝟓 𝟓
−𝟐 𝟏𝟒 Divide third row by
−𝟑 −𝟐 𝟏𝟒
𝟎 𝟏 𝟓 𝟎 𝟏
𝟓 𝟓 𝟓 𝟓
−𝟑 𝟔 𝟎 𝟎 𝟏 −𝟐
𝟎 𝟎
𝟓 𝟓 𝑎13
𝑅1𝑛 = 𝑎1𝑛 - *𝑎
𝑝𝑖𝑣𝑜𝑡 3𝑛
𝑎
23
𝑅2𝑛 = 𝑎2𝑛 - 𝑝𝑖𝑣𝑜𝑡 * 𝑎3𝑛
New Augmented matrix Z = -2
𝟏 𝟎 𝟎 𝟏
𝟎 𝟏 𝟎 𝟐อ Y=2
𝟎 𝟎 𝟏 −𝟐
X=1
H.W:
Use Gauss jordan to solve:
3𝑥1 -0.1𝑥2 -0.2 𝑥3 = 7.85 *:Solution: 3 −0.1 −0.2 7.85
0.1𝑥1 +7𝑥2 -0.3𝑥3 = -19.3 transfer the equation to Augmented 0.1 7 −0.3 −19.3 อ
0.3𝑥1 - 0.2𝑥2 + 10𝑥3 = 71.4 matrix 0.3 − 0.2 10 71.4
4- Jacobi and Gauss-Seidel ,Methods
which employs initial guesses and then iterates to obtain refined estimates of the
solution.
main condition:
𝒂𝒊𝒋𝒊=𝒋 ≥ 𝒂𝒊𝒋𝒊≠𝒋

With initial guess :


𝑿 = [𝟎 𝟎 𝟎 𝟎]
4- Jacobi and Gauss-Seidel ,Methods
Example 2 :
With Jacobi and Gauss seidel solve:
𝑥1 + 5 𝑥2- 𝑥3 = 10 4𝑥1 + 2𝑥2 + 𝑥3 = 14
𝑥1 + 𝑥2+ 8𝑥3 = 20 re-change the matrix
𝑥1 + 5 𝑥2 - 𝑥3 = 10
4𝑥1 + 2𝑥2+ 𝑥3 = 14 𝒂𝒊𝒋𝒊=𝒋 ≥ 𝒂𝒊𝒋𝒊≠𝒋 𝑥1 + 𝑥2 + 8𝑥3 = 20

1
𝑥1 = 4 (14 − 2𝑥2 − 𝑥3 )
1 ‫ 𝟏𝒙 موضع قانون‬, 𝒙𝟐 , 𝒙𝟑 ‫نجعل‬
𝑥2 = 5 (10 − 𝑥1 + 𝑥3 )
1
𝑥3 = 8 (20- 𝑥1 -𝑥2 )
Example 2 :
1 1 1
𝑥1 = 4 (14 − 2𝑥2 − 𝑥3 ) , 𝑥2 = 5 (10 − 𝑥1 + 𝑥3 ) , 𝑥3 = (20- 𝑥1 -𝑥2 )
8

With initial guess : 𝑿 = [𝟎 𝟎 𝟎]

Jacobi Gauss-Seidel
n 𝒙𝟏 𝒙𝟐 𝒙𝟑 n 𝒙𝟏 𝒙𝟐 𝒙𝟑
0 0 0 0 0 0 0 0

1 3.5 2 2.5 1 3.5 1.3 1.9

2 1.875 1.8 1.8125 2 2.375 1.905 1.965

3 2.1469 1.9875 2.0406 3

4 4

5 5

You might also like