Beruflich Dokumente
Kultur Dokumente
(
(
(
=
(
(
Write a programming code and validateyour analytical
result with it.
Matrix and Linear Equations Matrix and Linear Equations
Gauss Elimination Method
Gauss J ordan Elimination Method
3/5/2013 12 Numerical Methods
Consider asystem of equations
11 1 12 2 1 1, 1
21 1 22 2 2 2, 1
1 1 2 2 1 , 1
.........
.........
...........................................
...........................................
.........
n n n
n n n
n n nn n n
a x a x a x a
a x a x a x a
a x a x a x a
+
+
+
+ + + =
+ + + =
+ + + =
Systems of Linear Equations
Systems of Linear Equations
Coefficient Matrix
3/5/2013 13 Numerical Methods
Right hand side vector
11 12 1
21 22 2
1 2
.......
.......
..... ...... ....... ....
.......
n
n
n n nn
a a a
a a a
a a a
(
(
(
(
(
1, 1
2, 1
, 1
........
n
n
n n
a
a
a
+
+
+
(
(
(
(
(
Systems of Linear Equations
Bringing down the coefficient matrix to DIAGONAL MATRIX
Bringing down the coefficient matrix to LOWER TRI-DIAGONAL
MATRIX
Bringing down the coefficient matrix to UPPER TRI-DIAGONAL
MATRIX
3/5/2013 14 Numerical Methods
Gauss J ordan Elimination Method
Gauss Elimination Method
GaussSeidal Iteration Method
Solution Techniques
Systems of Linear Equations: Solution Techniques
Bringing down the coefficient matrix to DIAGONAL MATRIX
3/5/2013 15 Numerical Methods
Consider asystem equations
Gauss J ordan Elimination Method
1 2 3
1 2 3
1 2 3
4 3 6
1
3 5 3 4
x x x
x x x
x x x
+ =
+ + =
+ + =
Make some row operationsso that the matrix reduces to
DIAGONAL MATRIX
1
0.5
1 0 0
0 1 0
0 0 1 0.5
(
(
(
(
Systems of Linear Equations: Solution Techniques
Bringing down the coefficient matrix to UPPER TRI-DIAGONAL
MATRIX
3/5/2013 16 Numerical Methods
Consider asystem equations
Gauss Elimination Method
1 2 3
1 2 3
1 2 3
4 3 6
1
3 5 3 4
x x x
x x x
x x x
+ =
+ + =
+ + =
Make some row operationsso that the matrix reduces to
UPPER TRIDIAGONAL MATRIX
Gauss Elimination Method Gauss Elimination Method
ALGORITHM
Read n
For i =1 to n
For j =1 to n+1
Read a
ij
Next j
Next i
For k =1 to n1
For i =k+1 to n
Ratio =
For j =1 to n+1
a
ij
=a
ij
ratio * a
kj
Next j
Next i
Next k
3/5/2013 17 Numerical Methods
( )
ik kk
a a
ALGORITHM (Contd.,)
For k =n1 to 1, 1
x
k
=a
k,n+1
For j =k+1 to n
x
k
=x
k
a
kj
x
j
Next j
x
k
=x
k
/ a
kk
Next k
Stop
Gauss Elimination Method Gauss Elimination Method
Exercise
Solve the following system of equsby Gauss Elimination Method,
3/5/2013 18 Numerical Methods
1
2
3
4
1.2 2.1 1.1 4 6
1.1 2 3.1 3.9 3.9
2.1 2.2 3.7 16 12.2
1 2.3 4.7 12 4
x
x
x
x
( ( (
( ( (
( ( (
=
( ( (
( ( (
Write a programming code and validateyour analytical
result with it.
Systems of Linear Equations: Solution Techniques
3/5/2013 19 Numerical Methods
Consider asystem equations
Gauss Seidel Iteration Method
1 1, 1 1
2
11
2 2, 1 2
1
22
, 1
1
1
1
, 2
....................................................
1
,
n
n j j
j
n
n j j
n
n n n nj j
nn
x a a x
a
x a a x j
a
x a a x j n
a
+
=
+
+
| |
=
|
\ .
| |
= =
|
\ .
| |
= =
|
\ .