Professional Documents
Culture Documents
+ +
+
+ +
,..
=
=
..
+
The numbers
+ +
or
= 1 to
(1)
Matrix representation:
Or
.
= .
. .
(2)
Here
A = coefficient matrix of system of linear equations
B = column vector of constants
X = column vector of unknowns
A solution of system (1) is a set of numbers
,..
Geometrical interpretation:
Dr. B.R. Gupta
The intersection point ( , ) = ( , ) lies on both lines i.e. satisfies both equations so
= is a solution.
&
Skew-symmetric if
=
Orthogonal if
Diagonal if
= 0 when
Upper triangular if
= 0 when >
Lower triangular if
= 0 when >
0
0
.(1)
+ 5 + 3 = 10
.(2)
+3 +2 =5
.(3)
In this method, the unknowns are eliminated such that the elimination process leads to an upper
triangular system and the unknowns are obtained by back substitution.
Step1. Eliminate x from eq (2) and (3):
Multiply eq (2) & (3) by -2 and adding with eq (1).
2 + 4 6 = 4
.(4)
0 6 12 = 24
.(5)
0 2 10 = 14
.(6)
.(7)
0 6 12 = 24
.(8)
0 0 + 18 = 18
.(9)
[A|B] = .
.
2 + 4 6 = 4
.(1)
+ 5 + 3 = 10
.(2)
+3 +2 =5
.(3)
4 6
5
3
3
2
4
= 10
5
.
4 6 4
5
3 10
3
2
5
We shall convert the matrix A in upper triangular matrix by applying elementary row operations.
2
+
2 4 6 4
0 6 12 24
0 2 10 14
3
2 4 6 4
0 6 12 24
0 0
18 18
Thus the equivalent system of equations are
2 + 4 6 = 4
6 12 = 24
18 = 18
.(4)
.(5)
.(6)
By back substitution
=1
=2
= 3
Ex: Solve the following system of equations by Gauss elimination method:
Dr. B.R. Gupta
=2
+4
= 11
+2
=0
+2
.(1)
.(2)
.(3)
=2
.(4)
2
11
=
0
2
=
[A|B] =
1 1 1 1
4 4
1 1
11 1 2
2 1
22
2
11
0
2
We shall convert the matrix A in upper triangular matrix by applying elementary row operations.
=0
= 1
=2
=1
Gauss Jordan Method:
In this method, the system of equations
= are converted in a diagonal set
= by
applying elementary row operations on both A & B such that A reduced to the identity matrix I.
Then solution is obtained without necessity of back substitution.
Ex: Solve the following system of equations by Gauss-Jordan method:
2 = 4
5 + = 9
4 3 = 10
.(1)
.(2)
.(3)
1 2
0
0 5
1
4
0 3
4
= 9
10
.
into .
=
= .
1 2
0
0 5
1
0
8 3
1 2
0
0
0
1
1
5
8 3
+2
2
5
1
1
5
7
0
5
0
0
0
4
9
6
1
5
4
9
10
4
9
5
6
5
9
5
42
5
5
7
2
5
1
1
5
0
1
5
9
5
6
1
0
0
0
1
0
0
0
1
2
3
6
+0=3
0+0+ =6
= 2,
= 3,
=6
+ =9
.(1)
2 3 + 4 = 13
.(2)
3 + 4 + 5 = 40
.(3)
Sol:
.
1
0
0
0
1
0
0
0
1
1
3
5
+0=3
0+0+ =5
= 1,
= 3,
=5
LU Decomposition method:
In this method, the matrix A is decomposed or factorized as the product of a lower triangular
matrix L and upper triangular matrix U . i. e. = .
Where
0
0 0
0 0
=
. 0
.
.
0
.
0
0
.
=
0
0
0.
Note that the LU decomposition is not unique. Any matrix A with all non-zero diagonal
elements can be factored in infinite number of ways.
Unique decomposition can be obtained if
(i)
= 1,
(ii)
= 1,
(iii)
=
i.e.
Method)
= .
as
. .
Let
.(2)
Then
....(3)
(1)
First, we find Z from eq. (3) then we can evaluate X from eq. (2)
=
4
= 1
3
4
= 4
6
0 1
0 . 0
0
Sol:
Decomposing matrix A into L & U.
4
= 1
3
1
1
4 2 =
2 4
1
0
1
Dr. B.R. Gupta
+
+
4
= 1
3
+
+
1
1
4 2
2 4
=1
=1
=4
=2
=3
=1
+
= 2
= 4
= 4
Thus
4 0
0
15
1
0
=
4
3 4 4
And
1
=
0
0
Now the system of equations
.(2)
Then
....(3)
1
0
4
3
5
1
can be written as
. .
Let
1
4
(1)
4 0
0
15
1
0
4
3 4 4
4
= 4
6
=1
4
=
5
1
=
2
1
4
4
3
5
1
1
0
1
4
= 5
1
2
By back substitution
2
= 1
1
1
2
1
=
2
=1
4
= 10
5
Sol:
Decomposing matrix A into L & U.
1
= .
0
1
0
0 . 0
0
1
+
+
2
= 1
1
0
+
+
4 6
5
3
3
2
1
1
= 2
1
2
2
= 0
0
0
1
3
4
3
0
6
6
3
=1
=2
= 3
5
= 6
10
Sol:
Decomposing matrix A into L & LT.
0
=
0
0 . 0
0
+
+
1
= 2
3
2
3
8 22
22 82
=1
=1
= 2
=2
=3
=3
=8
+
=2
= 22
=8
= 82
=3
Thus
Dr. B.R. Gupta
1 0
= 2 2
3 8
can be written as
.
Let
.(2)
Then
....(3)
0
0
3
(1)
0
0
3
5
6
10
=5
= 2
= 3
=
1 2
0 2
0 0
3
8
3
5
= 2
3
By back substitution
4
= 1
0
= 1
=3
=2
1
= 0
0
Sol:
Decomposing matrix A into L & LT.
..
Iteration method:
. of an unknown
solution of problem.
Gauss-Jacobi method:
. . (1)
4 +
+ 3 = 17
. . (2)
+ 8 = 12
. . (3)
Sol:
Rearrange the equations in such a way that all the diagonal terms are dominant.
4 +
+ 3 = 17
+ 5 + = 14
2
+ 8 = 12
1
= (17
4
3 )
1
= (14
5
1
(12 2 + )
8
1
4
3
4
17
4
1
5
1
5
14
(5)
5
1
4
1
8
+
,
3
2
(4)
(6)
&
, we get
7 9 17 97
+
=
10 8 4
40
3 17 14 33
+
=
10 20 5
20
17 7 3 63
+
+ =
16 20 2 80
33 189 17
+
= 3.25
80 320 4
97
63 14
+
= 2.16
200 400 5
Initial
II
III
IV
..
exact
solution
value
0
0
0
4.25
2.8
1.5
2.42
1.6
0.78
3.25
2.16
1.1
2.88
1.93
0.96
..
..
..
3
2
1
Where
Then A can be written as the sum of a diagonal component D, and the remainder R:
A = D+R
(D+R)X = B
DX = B RX
X = D-1(B RX)
. . (1)
2 + 10 + = 51 . . (2)
15 + 3 2 = 85 . . (3)
Sol: .
Initial
II
III
IV
..
exact
solution
value
0
0
0
5.667
5.1
0.625
4.73
3.904
1.192
5.045
4.035
1.010
4.994
3.99
1.003
..
..
..
5
4
1
Note: Choice of initial value will not affect the solution (we get same solution) but will affect the
number of iterations for convergence.
Ex: For the system of equations
4
1
= 1
5
2 1
(i)
(ii)
where
3
1 ,
8
17
= 14 .
12
Sol: The given system of eqs are diagonally dominant hence sequence of approximate solutions
will converge.
Let
A=D+R
Dr. B.R. Gupta
Where
4
= 0
0
0
5
0
0
0 ,
8
0
1
= 1
0
2 1
3
1
0
( )
(1)
14 0
0
= 0
15
0
0
0 18
14 0
0
= 0
15
0
0
0 18
( )
17
0
1
0
14 1
12
2 1
+3
17
+
14
2
12
3
1
0
(2)
0
= 0 in eq (2), we get first approximation (iteration)
0
( )
174
= 145
32
145 + 92
17
14 174 + 32
12
172 145
14 0
0 9.7
= 0
15
0 5.75
0
0 18 5.7
2.42
= 1.15 =
0.71
Computing third iteration using X(2) .
( )
17
14
12
3.25
= 2.16 =
1.10
Ex: For the system of equations
2 +8 =5
. . (1)
2 + 10 + = 51 . . (2)
15 + 3 2 = 85 . . (3)
(i)
(ii)
Sol:
Making the system of equations diagonally dominant .
15 + 3 2 = 85
2 + 10 + = 51
2 +8 =5
Writing in matrix form
AX=B
15 3 2
2
10
1
1 2
8
Let
85
= 51 .
5
A=D+R
Where
15 0
= 0
10
0
0
0
0 ,
8
0
3 2
= 2
0
1
1 2
0
( )
(4)
115 0
0
= 0
110
0
0
0 18
85
0
3 2
0
1
51 2
1 2
0
5
115 0
0
= 0
110
0
0
0 18
( )
3 2
85
51 2 +
2
5
(5)
0
= 0 in eq (5), we get first approximation (iteration)
0
( )
8515
= 5110
58
3 2
85
51 2 +
2
5
..
4.73
= 3.904 =
1.192
Computing third iteration using X(2) .
( )
==
..
85
51 . .
..
5
5.045
= 4.035 =
1.010
Ex: Perform four iterations of the Gauss-Jacobi method for solving the system of equations
3 +2 +6 =7
+3 +
=4
. . (1)
. . (2)
4 + 2 + = 4 . . (3)
Sol:
Rearrange the equations in such a way that all the diagonal terms are dominant.
..
Gauss Seidel Method:
Dr. B.R. Gupta
The iterations (approximations) from Gauss Seidel method converges at least two times faster
than Jacobi method.
Ex: Perform three iterations of the Gauss-Seidel method for solving the system of equations
8 +2 2 =8
8 + 3 = 4
2 +
+ 9 = 12
Sol:
The system of equations are diagonally dominant.
Keeping diagonal terms in LHS and shifting remaining terms in RHS.
= (0 2 + 2 + 8)
=(
+ 0 + 3 + 4)
= (2
1
(1)
8
1
8
+ 0 + 12)
(2)
1
9
. . (3)
1
=1
8
1 5
= ( 1 + 0 + 0 + 4) =
8 8
= 2
5
1 75
+ 0 + 12 =
8
9 72
x1 , y1 , z1 are obtained from eqs (1), (2), (3) by substituting on the RHS the most recent
approximation for each unknown.
Thus the Gauss Seidel iteration equations can be written as
+2
+ 8)
1
(4)
8
+0+3
+ 4)
1
8
= (0 2
= (
(5)
Dr. B.R. Gupta
= (2
+ 0 + 12)
1
(6)
9
5 25
0 +
+8
4 12
53
25
1 395
+0+
+4 =
= 1.029
48
8
8 384
1 53
=
= 1.104
8 48
53 395
1 3365
+ 0 + 12 =
= 0.974
24 384
9 3456
1
= 0.989
8
1
= (2 0.986 0.989 + 0 + 12) = 1.004
9
Writing iterations in a table
Iterations
Initial value
0
0
0
I
1
0.625
1.042
II
1.104
1.029
0.974
III
0.986
0.989
1.004
IV
1.004
1.002
0.999
..
..
..
..
exact Solution
1
1
1
. . (1)
+ 4 2 = 1 . . (2)
4
= 12 . . (3)
Sol: ..
Writing iterations in a table
Iterations
Initial
value
0
II
III
2.937
2.978
IV
..
..
exact
solution
3
0
0
0.5
0.75
0.859
0.945
0.967
0.989
..
..
1
1
Then A can be written as the sum of a diagonal component D, Lower triangular matrix L and
upper triangular matrix U:
A =L+ D+U
0 0 0
0
0
0 0
=
, =
0 0
0
0 0 0
0
0
0
0
0
0
0
,
0
0
0
0 0
=
0 0
0 0
0
0
DX = LX UX + B
X = D-1( LX UX + B)
(1)
(2)
Dr. B.R. Gupta
..(3)
Or
=0
Expanding, we get
+ (1)
= 0 . (4)
Ex: Find the Eigen values and corresponding Eigen vectors of the diagonal matrix
4
= 0
0
0
1
0
0
0 .
5
4
0
0 1
0
0
0
0
5
=0
Or
(4 )(1 )(5 ) = 0
Spectral radius
( )=
= 4, 1, 5
{4, 1, 5}
=5
= 4 can be obtained by solving homogeneous eq.
0 0 0
0 3 0
0 0 1
=0
0
= 0
0
By back substitution
1.
=0
3.
0.
=0
=0
=0
+ 0.0 + 0.0 = 0 0.
= 0 (1)
=0
1
0
0
= 4.
= 1 can be obtained by solving homogeneous eq.
[
3
0
0
0
0
0
]
0
0
4
=0
0
= 0
0
0.0 + 0.
3.
=0
=0
4.
=0
=0
+ 0.0 = 0 0.
= 0 (2)
=0
=
0
0
1
0
= 1.
Similarly
0
= 0 =
is an Eigen vector corresponding to
0
0
1
= 5.
Observations:
(i) Eigen values of diagonal matrix A are diagonal elements of A.
(ii). X1 X2 X3. If , , are distinct then there corresponding Eigen vectors X1 , X2 , X3
will be independent (distinct).
(iii).
AX=X
A(cX) = (cX)
i.e. If X is an Eigen vector corresponding to then cX will also be eigen vector of corresponding
to .
Ex: Find the Eigen values and corresponding Eigen vectors of the triangular matrix
3
= 0
0
1
2
0
4
6 .
5
= 2,
=5
are
Dr. B.R. Gupta
1
0
0
= 0 =
0
1
1
0
3
2
1
0
3
= 2
Eigen value problem:
(1)
,
.
=
=
Let
,,
is | |
Ex: Find the absolutely largest Eigen value and corresponding Eigen vector of the matrix
2
0 1
= 1 1
1
2
2
0
Find the error in the Eigen value at 9th iteration.
Sol:
1
= 1 , then
1
2
0 1 1
3
= 1 1
1 1 = 1
2
2
0 1
4
2
0 1 3
2
=
1 1
1
1
0
2
2
0
4
4
2
0 1
2
0
=
1 1
1
0
2
2
2
0 4
4
124
126 ,
4
=
,
=
252
= 254
4
,
124
126 = 31268
4
= [124 126 4]
252
= [124 126 4] 254 = 63268
4
= [252 254
252
]
4 254 = 128036
4
| |
63268
= 2.0234
31268
252
= 254 .
4
is
128036
(2.0234)
31268
= 0.0241
Ex: Find the absolutely largest Eigen value and corresponding Eigen vector of the matrix
2
= 1
1
2
3
2
1
1
2
Sol:
1
= 1
1
15625
= 15625 ,
15625
78125
= 78125
78125
=5
| |=0
Determination of Smallest Eigen Value:
=
Thus if is an eigen value of A then the reciprocal 1/ is the eigen value of A-1.
Procedure:
Step1: Determine A-1.
Step2: Calculate largest eigen value * of A-1.
Step3:
1 3
2
4
1
2
4
2
1
2
3
.
Dr. B.R. Gupta
1
= 1 , then
1
1 3
2
4
1
1 1 3
2
2 4
1
2
4
2
1 1
1 3
2 1 = 4
2
3 1
3
2
4
2
1 3
1 5
=
2 4
7
2
3 3
5
..
=
1 198
280 ,
16
198
1 169
239
8
169
198 1
1
1
= [198 280 198] 280
=
(39202)
16 16
64
198
169 1 1
1
= [198 280 198] 239
=
(66922)
8 16
64
169
Thus
=
66922
= 1.7071
39202
1
= 0.5858
1.7071
Similar matrix
A matrix A is said to be similar to B if there exists a non-singular matrix P such that
Proof: (1)
=
| | |= |
|=|
|
(
=|
|| || |
) |
|=| |=
Thus A and B have the same characteristic polynomial and therefore have the same Eigen values.
Proof (2):
Let X be an Eigen vector of A Then AX=X.
Consider
B=
Post multiplying by
)(
)=
=(
)
=(
Post multiply by X
B(
)=
= (
)
=
= (
)
Thus
is an eigen vector of B corresponding to the eigen value .
Orthogonal matrix:
A matrix is said to be orthogonal if the dot product of any two column vector is zero (i.e. column
vectors are perpendicular and unit vector).
If A is orthogonal then
.
Or
=
=
1
0
=
0
0
0
0
1
0
0
0
0
0
1
0
0
0
Where
2
1
tan
= 2
if
if
Ex: Using Jacobis method find all the Eigen values and the eigen vectors of the matrix
1 2 2
= 2 3 2
2 2 1
Sol:
We shall perform Jacobi transformation. First we eliminate largest non-diagonal element of A
which is
=
= 2.
Since
= 1, we have
0
1
0
= . Thus
1
2
= 0
1
2
1
0
2
0
1
2
Let
2
= 0
1
2
2 1 2 2 2
0 2 3 2 0
1 2 2 1 1
2
2
0
1
0
3
= 2
0
0
1
0
2
0
1
2
2 0
3 0
0 1
2
=1
2
0
Let
1
2
1
2
0
Then
1
2
= 1
2
0
1
2
1
2
0
0
3
2
0 0
2 0 2
3 0 1
0 1 2
0
1
2
1
2
0
5
= 0
0
0 0
1 0
0 1
Thus
=
Where
= 1,
2
1
=
2
1
2
1
2
1
2
1
1
2
That is
= ,
= ,
= 1 respectively.
= 5,
= 1,
Then
(1)
(2)
Ex: Using Jacobis method, find all the eigen values and the eigen vectors of the matrix
1 2 4
= 2
5 2
4 2 1
Dr. B.R. Gupta
Sol:.
5 22 0
= 22 5
0
0
0 3
= 5 22,
1 1
2 ,
2
1
5 22
0
0
5 + 22
0
0
= 5 + 22,
1 1
2 ,
2
1
0
0
3
1 2
0
2
2
Tridiagonal Matix:
A=
A matrix having all its nonzero entries on the main diagonal and in the positions immediately
adjacent to the main diagonal are called Tridiagonal Matix.
Let
be column vector
0
=
Calculate
(1)
(2)
Formation of H:
The Householder matrix
Where
Elements of vector
0
=
0
0
= ,
..
0
0
..
0
,
are given by
=0
Where
All elements
Thus
|
1
1+
2
sign(
2
+ ..+
|
)
, = 3, 4, 5
= 2
Ex: Reduce the following matrix to tridiagonal matrix using householder method:
1
= 4
3
4 3
1 2 .
2 1
0
Here
=
1
0
=
0
0
12
2
1
0
=
Now
0
2
12
0
0
4
3
5
5
3
4
5
5
=
1 5
73
5
=
25
14
0 25
0
14
25
23
25
( )
=
= 2
Then we construct
Elements of vector
Where
All elements
+
( )
0
0
=
( )
=0
( )
are given by
+ ..+
1+
(
( )
, = 4, 5, 6
( )
Ex: Use the Householders method to reduce the given matrix A into the tridiagonal form
= 1
1
2
2
1
1
4
1
2
4
1
Ex: Use the Householders method to reduce the given matrix A into the tridiagonal form
4
1
=
2
2
1
4
1
2
2
1
4
1
2
2
1
4
Sol: