Lecture 1 - Linear Equation

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 32

NUMERICAL METHODS

MATH 134

Engr. CHRISTOPHER S. PALADIO


 DOOLITTLE’S METHOD
 CROUT’S METHOD
 CHOLESKY’S METHOD

Engr. CHRISTOPHER S. PALADIO ASCOT


 EXAMPLE:

Find the roots of the following set of equation using the


Doolittle’s Method 𝑥+𝑦+𝑧 =5

𝑥 + 2𝑦 + 2𝑧 = 6

𝑥 + 2𝑦 + 3𝑧 = 8

Engr. CHRISTOPHER S. PALADIO ASCOT


1 1 1 𝑥 5
𝐴= 1 2 2 𝑋= 𝑦 𝐶= 6
1 2 3 𝑧 8

Let A = LU 1 1 1 1 0 0 𝑑 𝑒 𝑓
1 2 2 = 𝑎 1 0* 0 𝑔 ℎ
1 2 3 𝑏 𝑐 1 0 0 𝑖

1 1 1 𝑑 𝑒 𝑓
1 2 2 = 𝑎𝑑 𝑎𝑒 + 𝑔 𝑎𝑓 + ℎ
1 2 3 𝑏𝑑 𝑏𝑒 + 𝑐𝑔 𝑏𝑓 + 𝑐ℎ + 𝑖

Engr. CHRISTOPHER S. PALADIO ASCOT


𝑑=1 𝑒=1 𝑓=1

𝑎𝑑 = 1 𝑎𝑒 + 𝑔 = 2 𝑎𝑓 + ℎ = 2

𝑎=1 𝑔=1 ℎ=1

𝑏𝑑 = 1 𝑏𝑒 + 𝑐𝑔 = 2 𝑏𝑓 + 𝑐ℎ + 𝑖 = 3

𝑏=1 𝑐=1 𝑖=1

1 0 0 1 1 1
𝐿= 1 1 0 𝑈= 0 1 1
1 1 1 0 0 1

Engr. CHRISTOPHER S. PALADIO ASCOT


Let LY = C Let UX = Y

1 0 0 𝑦1 5 1 1 1 𝑥 5
1 1 0 ∗ 𝑦2 = 6 0 1 1 ∗ 𝑦 = 1
1 1 1 𝑦3 8 0 0 1 𝑧 2
𝑦1 5 𝑥 4
𝑦2 = 1 𝑦 = −1
𝑦3 2 𝑧 2

𝑥=4 𝑦 = −1 𝑧=2

Engr. CHRISTOPHER S. PALADIO ASCOT


 EXAMPLE:

Find the roots of the following set of equation using the Crout’s
Method 5𝑥 + 4𝑦 + 𝑧 = 3.4

10𝑥 + 9𝑦 + 4𝑧 = 8.8

10𝑥 + 13𝑦 + 15𝑧 = 19.2

Engr. CHRISTOPHER S. PALADIO ASCOT


5 4 1 𝑥 3.4
𝐴 = 10 9 4 𝑋= 𝑦 𝐶 = 8.8
10 13 15 𝑧 9.2

Let A = LU 5 4 1 𝑎 0 0 1 𝑔 ℎ
10 9 4 = 𝑏 𝑐 0* 0 1 𝑖
10 13 15 𝑑 𝑒 𝑓 0 0 1

5 4 1 𝑎 𝑎𝑔 𝑎ℎ
10 9 4 = 𝑏 𝑏𝑔 + 𝑐 𝑏ℎ + 𝑐𝑖
10 13 15 𝑑 𝑑𝑔 + 𝑒 𝑑ℎ + 𝑒𝑖 + 𝑓

Engr. CHRISTOPHER S. PALADIO ASCOT


𝑎=5 𝑏 = 10 𝑑 = 10

𝑎𝑔 = 4 𝑏𝑔 + 𝑐 = 9 𝑑𝑔 + 𝑒 = 13

4
𝑔= 𝑐=1 𝑒=5
5
𝑎ℎ = 1 𝑏ℎ + 𝑐𝑖 = 4 𝑑ℎ + 𝑒𝑖 + 𝑓 = 15

1
ℎ= 𝑖=2 𝑓=3
5 4 1
5 0 0 1
𝐿 = 10 1 0 𝑈= 5 5
0 1 2
10 5 3 0 0 1
Engr. CHRISTOPHER S. PALADIO ASCOT
Let LY = C Let UX = Y

5 0 0 𝑦1 3.4 4 1
𝑥
1 0.68
10 1 0 ∗ 𝑦2 = 8.8 5 5

10 5 3 𝑦3 9.2 0 1 2 ∗ 𝑦 = 2
0 0 1 𝑧 0.8
𝑦1 0.68 𝑥 0.2
𝑦2 = 2 𝑦 = 0.4
𝑦3 0.8 𝑧 0.8

𝑥 = 0.2 𝑦 = 0.4 𝑧 = 0.8

Engr. CHRISTOPHER S. PALADIO ASCOT


 EXAMPLE:

Find the roots of the following set of equation using the Cholesky’s
Method
4𝑥 + 10𝑦 + 8𝑧 = 44

10𝑥 + 26𝑦 + 26𝑧 = 128

8𝑥 + 26𝑦 + 61𝑧 = 214

Engr. CHRISTOPHER S. PALADIO ASCOT


4 10 8 𝑥 44
𝐴 = 10 26 26 𝑋= 𝑦 𝐶 = 128
8 26 61 𝑧 214

Let A = LU
4 10 8 𝑎 0 0 𝑎 𝑏 𝑑
10 26 26 = 𝑏 𝑐 0* 0 𝑐 𝑒
8 26 61 𝑑 𝑒 𝑓 0 0 𝑓

4 10 8 𝑎2 𝑎𝑏 𝑎𝑑
10 26 26 = 𝑎𝑏 𝑏2 + 𝑐 2 𝑏𝑑 + 𝑐𝑒
8 26 61 𝑎𝑑 𝑏𝑑 + 𝑐𝑒 𝑑2 + 𝑒 2 + 𝑓 2
Engr. CHRISTOPHER S. PALADIO ASCOT
𝑎2 = 4 𝑎𝑏 = 10 𝑎𝑑 = 8
𝑎=2 𝑏=5 𝑑=4

𝑏 2 + 𝑐 2 = 26 𝑏𝑑 + 𝑐𝑒 = 26

𝑐=1 𝑒=6

𝑑2 + 𝑒 2 + 𝑓 2 = 61
2 0 0 2 5 4
𝑓=3 𝐿= 5 1 0 𝑈= 0 1 6
4 6 3 0 0 3

Engr. CHRISTOPHER S. PALADIO ASCOT


Let LY = C Let UX = Y

2 0 0 𝑦1 44 2 5 4 𝑥 22
5 1 0 ∗ 𝑦2 = 128 0 1 6 ∗ 𝑦 = 18
4 6 3 𝑦3 214 0 0 3 𝑧 6
𝑦1 22 𝑥 −8
𝑦2 = 18 𝑦 = 6
𝑦3 6 𝑧 2

𝑥 = −8 𝑦=6 𝑧=2

Engr. CHRISTOPHER S. PALADIO ASCOT


 PROBLEM:
Find the roots of the following set of equation using the three (3)
methods

a) 9𝑥 + 6𝑦 + 12𝑧 = 174 b) −2𝑥 + 3𝑦 + 8𝑧 = 17 c) 𝑥 + 𝑦 + 𝑧 + 𝑤 = 1

6𝑥 + 13𝑦 + 11𝑧 = 236 3𝑥 + 4𝑧 = 18 𝑥 + 2𝑦 − 2𝑧 + 3𝑤 = 8

12𝑥 + 11𝑦 + 26𝑧 = 308 𝑥 − 3𝑦 − 𝑧 = 2 2𝑥 + 𝑦 + 𝑧 + 2𝑤 = 2


in terms of w

Engr. CHRISTOPHER S. PALADIO ASCOT


 GAUSS – JACOBI’S METHOD

 GAUSS – SEIDEL’S METHOD

 SUCCESSIVE OVER RELAXATION (SOR)

Engr. CHRISTOPHER S. PALADIO ASCOT


 EXAMPLE:

Solve the following system of linear equations by Gauss – Jacobi’s


Method.
𝑥 + 5𝑦 − 𝑧 = 10
4𝑥 + 2𝑦 + 𝑧 = 14
𝑥 + 𝑦 + 8𝑧 = 20

Engr. CHRISTOPHER S. PALADIO ASCOT


Rearrange the system so that it is diagonally dominant

1
 4𝑥 + 2𝑦 + 𝑧 = 14 𝑥 = (14 − 2𝑦 − 𝑧)
4

 𝑥 + 5𝑦 − 𝑧 = 10 1
𝑦 = (10 − 𝑥 + 𝑧)
5
 𝑥 + 𝑦 + 8𝑧 = 20 1
𝑧 = (20 − 𝑥 − 𝑦)
8

Engr. CHRISTOPHER S. PALADIO ASCOT


1 1 1
𝑥= (14 − 2𝑦 − 𝑧) 𝑦 = (10 − 𝑥 + 𝑧) 𝑧 = (20 − 𝑥 − 𝑦)
4 5 8

Try (0, 0, 0)
1 1 1
𝑥= (14 − 2(0) −0) 𝑦 = (10 − 0 + 0) 𝑧 = (20 − 0 − 0)
4 5 8

7 5
𝑥= 𝑦=2 𝑧=
2 2

7 5
New trial value ( , 2, )
2 2

Engr. CHRISTOPHER S. PALADIO ASCOT


1 1 1
𝑥= (14 − 2𝑦 − 𝑧) 𝑦 = (10 − 𝑥 + 𝑧) 𝑧 = (20 − 𝑥 − 𝑦)
4 5 8

1 5 1 7 5 1 7
𝑥= (14 − 2(2) − ) 𝑦 = (10 − + ) 𝑧 = (20 − − 2)
4 2 5 2 2 8 2

15 9
29
𝑥= 𝑦 = 𝑧=
8 5 16

15 9 29
New trial value ( , , )
8 5 16

Engr. CHRISTOPHER S. PALADIO ASCOT


The value for the variables x, y and z have
reached after 17 iterations

𝑥=2 𝑦 =2 𝑧=2

4𝑥 + 2𝑦 + 𝑧 = 14 𝑥 + 5𝑦 − 𝑧 = 10
4(2) + 2(2) + 2 = 14 2 + 5(2) − 2 = 10
14 = 14 √ 10 = 10 √

𝑥 + 𝑦 + 8𝑧 = 20
2 + 2 + 8(2) = 20
20 = 20 √
Engr. CHRISTOPHER S. PALADIO ASCOT
 EXAMPLE:

Solve the following system of linear equations by Gauss – Seidel’s


Method.
𝑥 + 5𝑦 − 𝑧 = 10
4𝑥 + 2𝑦 + 𝑧 = 14
𝑥 + 𝑦 + 8𝑧 = 20

Engr. CHRISTOPHER S. PALADIO ASCOT


Rearrange the system so that it is diagonally dominant

1
 4𝑥 + 2𝑦 + 𝑧 = 14 𝑥 = (14 − 2𝑦 − 𝑧)
4

 𝑥 + 5𝑦 − 𝑧 = 10 1
𝑦 = (10 − 𝑥 + 𝑧)
5
 𝑥 + 𝑦 + 8𝑧 = 20 1
𝑧 = (20 − 𝑥 − 𝑦)
8

Engr. CHRISTOPHER S. PALADIO ASCOT


1 1 1
𝑥= (14 − 2𝑦 − 𝑧) 𝑦 = (10 − 𝑥 + 𝑧) 𝑧 = (20 − 𝑥 − 𝑦)
4 5 8

Try (0, 0, 0)
1 1 7 1 7 13
𝑥= (14 − 2(0) −0) 𝑦 = (10 − + 0) 𝑧 = (20 − − )
4 5 2 8 2 10

7 13 19
𝑥= 𝑦= 𝑧=
2 10 10
7 13 19
New trial value ( , , )
2 10 10

Engr. CHRISTOPHER S. PALADIO ASCOT


1 1 1
𝑥= (14 − 2𝑦 − 𝑧) 𝑦 = (10 − 𝑥 + 𝑧) 𝑧= (20 − 𝑥 − 𝑦)
4 5 8

1 13 19 1 19 19 1 19 381
𝑥= (14 −2 − ) 𝑦 = (10 − + ) 𝑧 = (20 − − )
4 10 10 5 8 10 8 8 200

19 381
393
𝑥= 𝑦 = 𝑧=
8 200 200

19 381 393
New trial value ( , , )
8 200 200

Engr. CHRISTOPHER S. PALADIO ASCOT


The value for the variables x, y and z
have reached after 11 iterations

𝑥=2 𝑦 =2 𝑧=2

4𝑥 + 2𝑦 + 𝑧 = 14 𝑥 + 5𝑦 − 𝑧 = 10
4(2) + 2(2) + 2 = 14 2 + 5(2) − 2 = 10
14 = 14 √ 10 = 10 √

𝑥 + 𝑦 + 8𝑧 = 20
2 + 2 + 8(2) = 20
20 = 20 √
Engr. CHRISTOPHER S. PALADIO ASCOT
 EXAMPLE:

Solve the following system of linear equations by SOR Method.


𝑥 + 5𝑦 − 𝑧 = 10
4𝑥 + 2𝑦 + 𝑧 = 14
𝑥 + 𝑦 + 8𝑧 = 20

Engr. CHRISTOPHER S. PALADIO ASCOT


Rearrange the system so that it is diagonally dominant

1 (14 − 2𝑦 − 𝑧)
 4𝑥 + 2𝑦 + 𝑧 = 14 𝑥= (14 − 2𝑦 − 𝑧) 𝑥=𝜔 + 1−𝜔 𝑥
4 4

 𝑥 + 5𝑦 − 𝑧 = 10 1 (10 − 𝑥 + 𝑧)
𝑦 = (10 − 𝑥 + 𝑧) 𝑦=𝜔 + 1−𝜔 𝑦
5 5
 𝑥 + 𝑦 + 8𝑧 = 20 1 (20 − 𝑥 − 𝑦)
𝑧 = (20 − 𝑥 − 𝑦) 𝑧=𝜔 + 1−𝜔 𝑧
8 8

Try 𝜔 = 1.1

Engr. CHRISTOPHER S. PALADIO ASCOT


(14 − 2𝑦 − 𝑧) (10 − 𝑥 + 𝑧) (20 − 𝑥 − 𝑦)
𝑥=𝜔 + 1−𝜔 𝑥 𝑦=𝜔 + 1−𝜔 𝑦 𝑧=𝜔 + 1−𝜔 𝑧
4 5 8

Try (0, 0, 0) Try 𝜔 = 1.1


77
(14 − 2(0) − 0) (10 − + 0)
𝑦 = 1.1 20 − 0.1(0)
𝑥 = 1.1 − 0.1(0) 5
4
77 1353 77 1353
𝑥= 𝑦= (20 − − )
20 1000 𝑧 = 1.1 20 1000 − 0.1(0)
77 1353
8
New trial value ( , , 2.03459) 𝑧 = 2.03459
20 1000

Engr. CHRISTOPHER S. PALADIO ASCOT


(14 − 2𝑦 − 𝑧) (10 − 𝑥 + 𝑧) (20 − 𝑥 − 𝑦)
𝑥=𝜔 + 1−𝜔 𝑥 𝑦=𝜔 + 1−𝜔 𝑦 𝑧=𝜔 + 1−𝜔 𝑧
4 5 8
1353
(14 − 2( ) − 2.03459) 77
𝑥 = 1.1 1000 − 0.1( )
4 20
𝑥 = 2.16134 (10 − 2.16134 + 2.03459) 1353
𝑦 = 1.1 − 0.1( )
5 1000
𝑦 = 2.03682 (20 − 2.16134 − 2.03682)
𝑧 = 1.1 − 0.1(2.03459)
8
𝑧 = 1.96929

New trial value (2.16134, 2.03682, 1.96929)


Engr. CHRISTOPHER S. PALADIO ASCOT
The value for the variables x, y and z have
reached after 8 iterations
𝑥=2 𝑦 =2 𝑧=2

4𝑥 + 2𝑦 + 𝑧 = 14 𝑥 + 5𝑦 − 𝑧 = 10
4(2) + 2(2) + 2 = 14 2 + 5(2) − 2 = 10
14 = 14 √ 10 = 10 √

𝑥 + 𝑦 + 8𝑧 = 20
2 + 2 + 8(2) = 20
Engr. CHRISTOPHER S. PALADIO
20 = 20 √ ASCOT
 PROBLEMS:

Solve the following system of linear equations by three (3) methods.


4𝑥 − 3𝑦 + 𝑣 − 𝑤 + 𝑧 + 3𝑢 = 8
2𝑥 + 5𝑦 − 3𝑧 + 4𝑢 = −1
−4𝑦 + 6𝑣 − 2𝑤 + 3𝑧 − 𝑢 = 13
𝑥 + 2𝑦 − 3𝑣 + 4𝑤 + 𝑢 = 21
𝑦 − 3𝑣 + 2𝑤 + 4𝑧 = 34
2𝑥 + 𝑦 − 𝑣 + 2𝑤 − 3𝑧 + 5𝑢 = 1

Engr. CHRISTOPHER S. PALADIO ASCOT

You might also like