Lec2 - CEA - Matrix

You might also like

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

Finite Element Method

Scope of CAE course

 Finite element method – Statics & Solid


Mechanics problem
 Computational Fluid Dynamics – Fluid
Mechanics and Heat Transfer problems

Jan-20 Ir Dr Mokhtar Awang


Finite Element Method
 is a numerical method for solving
problems of engineering
 require the solution to boundary value
problems for partial differential equations
 system of algebraic equations.
 yields approximate values of the
unknowns at discrete number of points
over the domain

Jan-20 Ir Dr Mokhtar Awang


Jan-20 Ir Dr Mokhtar Awang
Steps in FEM
1. Divide / discretize the structure or continuum into finite elements.
2. Assume a solution that approximate the behavior of an element
3. Develop a relationship between the element and the continuum
4. Assemble elements to obtain FEA model
5. Specify the load and boundary conditions.
6. Solve simultaneous linear algebraic equations to obtain the
solutions.

Jan-20 Ir Dr Mokhtar Awang


Computer Aided Engineering

Matrix Algebra
Motivation

 Linear algebra can be formulated in the


form of MATRIX
 With the aid of today’s computer
technology, complex algebraic system can
be solved

Jan-20 Ir Dr Mokhtar Awang


Lesson Outcomes

 Able to find inverse of a matrix


 Able to solve simple linear algebra system
 Able to use Mircosoft Excel to compute
inverse of a matrix

Jan-20 Ir Dr Mokhtar Awang


Matrix Definition
 A rectangular array of numbers
 The elements of a matrix are defined by their row
and their column position:

Example
 k11 k12 
[k]   
 21
k k 22 

Note,
The 1st subscript is the row position and the 2nd
subscript is the column position.
Therefore, k ij is the element in the ith row and the jth column.

Jan-20 Ir Dr Mokhtar Awang


Elements Definition

Example
If the matrix elements are defined as:
B1,1=1, B1,2=3, B2,1=4, B2,2=5

The matrix B is:


1 3
[ B]   
4 5

Jan-20 Ir Dr Mokhtar Awang


Vectors & Matrix

Examples

3 x 1: vector 4 x 4: matrix

1 1 0 9 6
6 8 4 0
{u}   2 [K]   
  2 1 6 3
3.2  
6 8 4 0

Jan-20 Ir Dr Mokhtar Awang


Matrix Addition and Subtraction
 Matrices must have the same size (mxn)
 Examples:
1 4 3  7 11 9 
A  B 
5 2 6  12 18 10 

 8 15 12    6  7  6
A B    A B   
17 20 26  7  16  4

Jan-20 Ir Dr Mokhtar Awang


Matrix Multiplication
Matrices can be multiplied by another matrix, but only if the left hand
matrix has the same number of columns as the right hand
matrix has rows.

Example
 7 12
1 4 3
A  B  11 18 A*B = C
5 2 6
 9 10

C11  (1* 7)  (4 *11)  (3 * 9)  78 C11 C12


C
C12  (1*12)  (4 *18)  (3 *10)  114 C 21 C 22
C21  (5 * 7)  (2 *11)  (6 * 9)  111
 78 114
C22  (5 *12)  (2 *18)  (6 *10)  156 C 
111 156 
Jan-20 Ir Dr Mokhtar Awang
Basic Matrix Laws
 A+B=B+A
 A+(B+C)=(A+B)+C
 c(A+B)=cA+cB
 A(B+C)=AB+AC, note: AB  BA
 (B+C)A=BA+CA
 A(BC)=(AB)C
 IA=AI=A, I is an identity matrix

Jan-20 Ir Dr Mokhtar Awang


Transpose of Matrix
 If A =[a ], then the transpose of A is
ij

 
A T  a ji

 Note that (AB)T=BTAT


1 5   3 2
A  , B 
 Example:  2 3  1 4 
1 2 3 1
A 
T
 , B 
T

5 3   2 4 
AB  ?
[ AB ]T  ?
B T AT  ?
Jan-20 Ir Dr Mokhtar Awang
Symmetric Matrix
 A square (nxn) matrix A is called
symmetric, if
A=AT or aij=aji
 Example:

Jan-20 Ir Dr Mokhtar Awang


Identity Matrix
 A square (nxn) matrix
 The elements of diagonal are equal to 1
and the rest are zeros.
 Example:
1 0 0 0
0 1 0 0 
I 
0 0 1 0 
 
0 0 0 1 

Jan-20 Ir Dr Mokhtar Awang


Determinant

A determinant is a scalar calculated from a square


matrix.
 If a matrix has a row or column of zeros, the
determinant is zero
 If a matrix has two identical rows or columns, the
determinant is zero
 A matrix with a determinant of zero is called a
singular matrix and has no inverse.

Jan-20 Ir Dr Mokhtar Awang


Inverse of a 2x2 Matrix
 Take for example an arbitrary 2x2 Matrix A
whose determinant (ad-bc) is not equal to zero

where a,b,c,d are numbers, The inverse is:

 Note: NOT all square matrices are invertible. A


matrix has an inverse if and only if it is
nonsingular (its determinant is nonzero)
Jan-20 Ir Dr Mokhtar Awang
Inverse Matrix of 3 by 3
 a11 a12 a13 
A  a21 a22 a23 
 a31 a32 a33 
T
 c11  c12 c13 
1 
A 
-1
  c21 c22  c23 
det A
 c31  c32 c33 
det( A)  a11c11  a12c12  a13c13
cij  cofactor
i.e;
c11  (a22a33  a23a32 ), etc
Jan-20 Ir Dr Mokhtar Awang
Inverse of a 3x3 Matrix

 There exists an inverse matrix of A when;

≠0

and it is:

Jan-20 Ir Dr Mokhtar Awang


Example
 2 1 - 1
A  - 3 - 1 2 
- 2 1 2 
det A  2(1* 2  2 *1)  1(3 * 2  2 * (2))  (1)(3 *1  (1) * (2))
det A  8  2  5  1 4 3 -1
-2 -2 1

c11  4, c12  2, c13  5 5 4 -1

c21  3, c22  2, c23  4


c31  1, c32  1, c33  1
 4  (2)  5
T
 4 2 5 
T
4 3  1
A -1  1  3 2  4   3  2 4    2  2 1 
 1 1 1   1 1  1  5 4  1
Jan-20 Ir Dr Mokhtar Awang
Inverse Matrix (cont)
 The product of a Matrix, A, and it’s inverse, A-1 is the
identity matrix, I.
 Only square matrices can be inverted.
3 5
4 5 
A 2
1
2
A   1 2 
 2 3  

1 0 1 0
1
A* A    I  
0 1 0 1 

Jan-20 Ir Dr Mokhtar Awang


Linear system of algebraic equations
 A system of linear equations is a set of equations with n
equations and n unknowns, is of the form of:

 The unknowns are denoted by x1,x2,...xn and the coefficients (a's


and b's above) are assumed to be given. In matrix form the
system of equations above can be written as:

 A simplified way of writing above is like this ; Ax = b


Jan-20 Ir Dr Mokhtar Awang
Solving System of Equation Using Matrices
a11x1+ a12x 2 +…+ a1nxn= b1
a21x1+ a22x2 +…+ a2nxn= b2
.
.
.
an1x1+ an2x 2 +…+ annxn= bn
Where x1, x2, …, xn are the unknowns
In matrix form: Ax=b  a11 a12 ... a1n   x1   b1 
a ... a 2 n   x 2  b2 
 21 a 22   
 ... ... ... ...   ...   ... 
 
 a n1 a n 2 ... a nn   x n  bn 

Parameter x’s can be solved by, x = A-1b

Jan-20 Ir Dr Mokhtar Awang


Solving System of Equation Using
Matrices

 There are 3 commonly used method to


find the solution:
 InverseMatrix Method
 Gaussian Elimination
 Cramer’s Rule

Jan-20 Ir Dr Mokhtar Awang


Inverse Matrix Method

 The inverse matrix method uses the inverse of a matrix to help solve
a system of equations, such like the above Ax = b. By pre-
multiplying both sides of this equation by A-1 gives:

 or alternatively this gives:

 So by calculating the inverse of the matrix and multiplying this by the


vector b we can find the solution to the system of equations directly.

Jan-20 Ir Dr Mokhtar Awang


Example 4x  5 y  6
2x  3y  5
Ax  b
4 5  x  6
2 3  y   5
    
1
 x  4 5 6
    
 y  2 3 5
 x   32  52  6  72 
     
 y   1 2  5  4 
Now, x   7 , y  4
2
Jan-20 Ir Dr Mokhtar Awang
Gauss Elimination Method

Algorithm:
•eliminate x from all equations below L1,
•and then eliminate y from all equations below L2.
•put the system into triangular form.
•Then, using back-substitution, each unknown can be
solved for.

Jan-20 Ir Dr Mokhtar Awang


Gaussian Elimination Method
2 x  y  z  8  (1)
 3 x  y  2 z  11  (2)
 2 x  y  2 z  3  (3)
3
2  (1) :
The result is:
3 x  32 y  32 z  12  (4)
( 2)  ( 4) :
1
2 y  12 z  1  (5)
(1)  (3)
2 y  z  5  ( 6)
4  (5) :
2 y  2 z  4  (7 )
(6)  (7) :
 z  1  (8)
Jan-20 Ir Dr Mokhtar Awang
3x3 matrix using MS Excel

Answer
x= 2
Shift + ctrl + enter y=3
z=-1
Jan-20 Ir Dr Mokhtar Awang
https://www.youtube.com/watch?v=PPzGy1MRK2E&feature=youtu.be

Thanks!

Jan-20 Ir Dr Mokhtar Awang

You might also like