Professional Documents
Culture Documents
Matrix algebra
Matrix algebra
Matrix Algebra
A matrix is an m x n array of numbers arranged in m rows and n columns. m = n A square matrix. m = 1 A row matrix. n = 1 A column matrix. aij Element of matrix a row i, column j
Matrix algebra
Matrix Operations
Multiplication of a matrix by a scalar.
[a] = k [c] aij = kcij
Addition of matrices.
Matrices must be of same order (m x n) Add them term by term [c] = [a] +[b] cij = aij + bij
Matrix algebra
Matrix Operation
Multiplication of two matrices
If [a] is m x n then [b] must have n rows [c] = [a] [b]
cij = a iebej
e =1
Matrix algebra
Matrix Operations
Transpose of a matrix:
Interchange of rows and columns
aij = aji
Matrix algebra
Matrix Operations
The identity matrix (or unit matrix) is denoted by the symbol [I]:
[a][I] = [I][a] = [a]
1 0 [I ] = 0
0 1 0
0 0 1
Matrix algebra
Matrix Operations
The inverse of a matrix is such that:
[a ][a ]
The Finite Element Method Computational Mechanics, AAU, Esbjerg
= [I ]
Matrix algebra
Matrix Operations
Differentiating a matrix:
daij d [a] = dx dx
The Finite Element Method Computational Mechanics, AAU, Esbjerg Matrix algebra
Matrix Operations
Differentiating a matrix:
a11 a12 x 1 U = [x y] 2 a21 a22 y U x a11 a12 x = U a21 a22 y y
The Finite Element Method Computational Mechanics, AAU, Esbjerg Matrix algebra
Matrix Operations
Integrating a matrix:
[a]dx = a ij dx
Matrix algebra
a = determinant of matrix
Need to find the co-factors of [a]
[a]
Matrix algebra
Cofactors
Cofactors of [aij] are given by:
C ij = ( 1) i + j d where matrix d is the first minor of a ij and is matrix [ a ] with row i and column j deleted.
Then :
[a ij ]
[C ] =
a
Matrix algebra
Cramers Rule
[a ] { x }
or in in d e x = {c} n o ta tio n :
j
L et
j= 1
a ij x
= ci m a tr ix [a ] by {c}.
m a tr ix [d (i) ] b e
w ith c o lu m n
i repaced T h en : d (i) a
xi =
The Finite Element Method Computational Mechanics, AAU, Esbjerg
Matrix algebra
Example:
Consider the following equations: x1 + 3x 2 2x 3 = 2 2x1 4x 2 + 2x 3 = 1 4x 2 + x 3 = 3
Matrix algebra
Example:
In matrix form : 1 3 2 x 1 2 2 4 2 x 2 = 1 4 1 x 3 3 0
The Finite Element Method Computational Mechanics, AAU, Esbjerg Matrix algebra
Solving:
2 3 2 2 41 = = 4.1 2 10 1 2 1 1 4 x1 = d( 1 ) a = 3 1 2 0
The Finite Element Method Computational Mechanics, AAU, Esbjerg
4 3 4 4
Matrix algebra
Solving:
1 2 2 2 0 = x2 = 1 a 2 0
The Finite Element Method Computational Mechanics, AAU, Esbjerg
1 3 3 4 4
2 1 = 1.1 2 2 1
d( 2)
Matrix algebra
Solving:
1 2 0 = x3 = 1 a 2 0
The Finite Element Method Computational Mechanics, AAU, Esbjerg
4 1 4 3 = 1.4 3 2 4 4 2 1
( 3)
Matrix algebra
Inversion
Example
1 3 2 x 1 2 2 4 2 x 2 = 1 4 1 x 3 3 0
Matrix algebra
Example
1.1 0.2 2 4.1 x 1 1.2 0.1 0.2 1 = 1.1 x 2 = 0. 2 x 3 0.8 0.4 0.2 3 1.4
Matrix algebra
Solving:
1 2 x3 = d( 3 ) a = 0 1 2 0
The Finite Element Method Computational Mechanics, AAU, Esbjerg
4 1 4 3 4 4 3 2 2 1 = 1.4
Matrix algebra
Gaussian Elimination
General System of n equations with n unknowns:
a 11 a 21 M a n1
a 12 a 22 M an2
K a1n x 1 c1 K a2n x 2 c 2 = M M M K a nn x n c n
Matrix algebra
Matrix algebra
Matrix algebra
Matrix algebra
Matrix algebra
Example
2 2 1 x 1 9 2 1 0 x = 4 2 x 6 1 1 1 3
The Finite Element Method Computational Mechanics, AAU, Esbjerg Matrix algebra
Solving:
Eliminate the coefficient of x1 in every equation except the first one. Select a11 =2 as the pivot element.
Add the multiple -a21/ a11 = -2/2 = -1 of the first row to the second row. Add the multiple -a31/ a11 = -1/2=-0.5 of the first row to the third row.
Matrix algebra
Step 1
1 x1 9 2 2 0 1 1 x = 5 2 x 1.5 0 0 0 .5 3
The Finite Element Method Computational Mechanics, AAU, Esbjerg Matrix algebra
Matrix algebra
Step 2
1 x1 9 2 2 0 1 1 x = 5 2 x 1.5 0 0 0 .5 3
The Finite Element Method Computational Mechanics, AAU, Esbjerg Matrix algebra
(3 2 ) = 3 = (1 2 )
x2
( 5 + 3) = 2 =
1
x2
(9 2( 2) 3) = 1 =
2
Matrix algebra
Gauss-Seidel Iteration
Write equations in form : 1 (c1 a12 x 2 a13 x 3 L a1n xn ) x1 = a11 1 (c 2 a 21x1 a 23 x 3 L a 2n xn ) x2 = a 22 M 1 (cn an1x1 an 2 x 2 L an .n 1xn 1 ) xn = a nn
The Finite Element Method Computational Mechanics, AAU, Esbjerg Matrix algebra
Gauss-Seidel Iteration
Assume a set of initial values for unknowns. Substitute into RHS of first equation. Solve for new value of x1 Use new value of x1and assumed values of other xs to solve for x2 in second equation. Continue till new values of all variables are obtained. Iterate until convergence.
Matrix algebra
Example
4x1 x 2 x1 + 4x 2 x 3 x 2 + 4x 3 x 4 =2 =5 =6
x 3 + 2x 4 = 6 x1 = 1 x2 = 1 x3 = 1 x 4 = 1
Matrix algebra
Example
x1 = 1 x2 = 1 x3 = 1 x4 = 1
(2 + x 2 ) = 1 4 (2 + 1) = 3 4 4
Example
x1 = 1 x2 = 1 x3 = 1 x4 = 1
(2 + x 2 ) = 1 4 (2 + 1.68) = 0.922 4
Matrix algebra
Iteration x1
0 1 2 3 4 Exact
4
Matrix algebra