Académique Documents
Professionnel Documents
Culture Documents
)
EE 522 Numerical Methods for Electromagnetics (METU)
Lecture 6:
Introduction to Finite Element Method (FEM)
by
zlem zgn & Mustafa Kuzuolu
FEM is an element-wise
application of a variational
method."
(1) LD u = f in
The boundary condition (BC) is given as:
(2) Bu = g on
where is a partial differential operator, is a
given function, and is the boundary of .
Dirichlet BC (it prescribes the field value at the boundary, and is an essential
BC that must be imposed explicitly)
u = g
Neumann BC (it requires the normal derivative of the field value to vanish at
the boundary, and is called a natural BC since it is satisfied implicitly and
automatically in the solution phase)
u n
= n u = g
n
du
Mixed BC u + =g
dn
If =0 , Dirichlet BC
If = 0, Neumann BC
2u = f in
u=0 on
2 2 2
2 = = 2 + 2 + 2
x y z
Laplacian operator
LD u f
N
LD u j j f
j =1
Using linearity:
N
u L
j =1
j D j f
1
F ( u ) = Lu , u f , u
2
F
=0
ui
A matrix system is formed and solved for the unknown coefficients.
R , wi = 0 or R w d = 0
i i = 1, 2,..., N
R , wi = 0
f LD u , wi = 0
LD u , wi = f , wi
N
u L ,w
j =1
j D j i = f , wi
u
j =1
j LD j , wi = f , wi i = 1, 2,..., N
T
Unknown vector: x = [u1 u2 ... u N ]
Solution of this matrix system gives the unknown coefficients ..
The weight functions are chosen to be the same as the basis functions.
wi = i ' = 1, 2, , *
R , i = 0
N N
u ( x ) = u j j ( x ) = u j ( x x j +1 )
j =1 j =1
d2 N j +1
2 u j ( x x ) = 1 + 4 x 2
dx j =1
Linearity
Simplify
d2 j +1
N N
u j 2
( x x ) = 1 + 4 x 2
j
u j ( j + 1) x j 1
= 1 + 4 x 2
j =1 dx j =1
LD j
Prepared by zlem zgn (Hacettepe U.) and Mustafa Kuzuolu (METU) 17
An Example
Using the Galerkin approach, the weight functions are chosen to be the same as
the basis functions.
wi = i = x x i +1 , i = 1, 2,..., N
Using the method of weighted residuals, multiply the equation by the weight
function and integrate.
1 1
d 2u
0 dx 2 i 0
2
w ( x ) d x = (1 + 4 x ) wi ( x ) dx
LD u f
LD u , w = f , w
Prepared by zlem zgn (Hacettepe U.) and Mustafa Kuzuolu (METU) 18
An Example
Therefore,
1 N 1
j
j 1 2
u j ( j + 1) x wi dx = (1 + 4 x ) wi dx
0 j =1 0
N 1 1
j
u j
j =1
( j + 1) x j 1
( x x i +1
) dx = (1 + 4 x 2
) ( x x i +1
) dx
0 0
N
ij i (3i + 8)
j =1
uj =
i + j + 1 2(i + 2)(i + 4)
Aij bi
Matrix system:
[ A][ x ] = [b ]
ij
Aij =
i + j +1
', 0 = 1, 2, , *
i (3i + 8)
bi =
2(i + 2)(i + 4)
For N = 1:
1 11 11 11
A11 = b1 = u1 = u( x ) ( x x 2 )
3 30 10 10
For N = 2:
1 1 11 1
3 2 u1 30 u1 10
= u = 2
1 4 u2 7 2
2 5 12 3
1 2
u( x )
10
( x x 2
) +
3
( x x3 )
1 1 3 11
3 1
2 5 u 30 u1 2
1
1 4
1 u2 = 7 u = 0
2 5 12 2
3 u u3 1
9 3 51
1 3
5 7 70
1 1 (exact
u( x )
2
( x x 2
) +
3
( x x4 ) solution)
For N = 4: For N = 5:
1 1
u1 2 u1 2
u 0 u 0
2 = 2
u3 1 u3 = 1
3 3
u4 u4
0 u5 0
0
u(x)
d du
a ( x ) = f ( x ) for 0< x<
dx dx
BCs: u (0) = u0 du
a = Q
dx x =
d du
0 w dx a dx f dx = 0
d du
du dw du
0 dx a dx
w f dx = 0
0 a dx dx w f dx wa = 0
dx 0
Original (strong form) New (weak form)
w dv = v dw + [ wv ]0
integration-by-parts
technique
0 0
du du du
Consider the term: wa dx = wa dx wa dx
0 x = x =0
( wQ ) x =0 ( wQ ) x =
Since 0 = 2 w(0) =0
du dw
Weak Form: 0 a dx dx wf dx ( wQ ) x = = 0
d 2u
2 u = x2 0< x <1
dx
u (0) = 0, u (1) = 0
Exact solution:
sin( x ) + 2 sin(1 x )
u exact = + x2 2
sin(1)
Elements e =1 e =2 e =3 e =4
Global Nodes 1 2 3 4 5
x
Coordinates x1 x2 x3 x4 x5
NN NN : Number of Nodes
u = u j j . : Nodal unknown coefficients
j =1 =. : Basis/approximation functions
u
u3
u4
u2
u1 = 0 u5 = 0
x
x1 x2 x3 x4 x5
The above sum should provide nodal unknown values at the nodes.
This is satisfied if the following Kronecker-Delta property holds:
1 if i = j
j ( xi ) = , i , j = 1, 2,..., NN
0 if i j
x
FEM
e =1 e =2 e =3 e =4
1 2 1 2 3 4 5
1
x
x
1 e =1 e =2 e =3 e =4
3
u11 u55
u1 =u5 = 0 x
e=1 e=2 e=3 e=4
u
u3 NN
u4
u = u j j
u2 j =1
u1 = 0 u5 = 0
x
e=1 e=2 e=3 e=4
j j+1
N1e N 2e
1
"Shape" functions e x
1 2
e = x j +1 x j = x2e x1e
j e j+1
x
xj xj+1
Local node
numbers
1 e 2
e e x
x 1
x 2
0 if i j e
e
x2e x x x
Linear element shape functions are: e
N1 = N 2e = 1
e e
FEM solution over eth element is:
N1e N 2e j =1
1
x Nodal unknown at eth
x1e x2e elements jth node
1 1
d 2u 2
R w dx = 0
0
0 dx 2
w w u + w x dx = 0
Integration by parts
1 1
dw du du
0 dx dx dx w dx 0
1 1
dw du 2 du
Weak form: w u + wx dx w =0
0 dx 0
dx dx
x2e
du dw 2 du du
e dx dx w u + wx dx w dx x = xe + w dx x = xe = 0
x1 2 1
e
Using Galerkin method, weight functions are
chosen to be identical to shape functions.
wi = N i
x2e
dN ej dN ie dN e
dN j
e
e dx dx N i N j + N i x dx N i dx e + N i dx e = 0
e e e 2 e j e
x1 x = x2 x = x1
', 0 = 1,2
Ae x e = b e
1
Positions of elemental matrix systems
in global matrix system:
x
e =1 e =2 e =3 e =4
x
e =1 e =2 e =3 e =4
A111 1
A12 0 0 0 u1 b11
1 1 u 1 2
A21 A22 + A112 A122 0 0 2 b2 + b1
0 A221 2
A22 + A113 A132 0 u3 = b22 + b13
3 4 3 4
0 0 A21 A232 + A114 A12 u4 b2 + b1
0 0 0 4
A21 A242 u5 b24
[ A][ x ] = [b ]
Global Global Global RHS
matrix unknown vector
vector
A11 A12 0 0 0 u1 b1
A A22 A23 0 0 u2 b2
21
0 A32 A33 A34 0 u3 = b3
0 0 A43 A44 A45 u4 b4
0 0 0 A54 A55 u5 b5