Professional Documents
Culture Documents
Lect06 Not So
Lect06 Not So
INTRODUCTION
Direct stiffness method is limited for simple 1D problems
PMPE is limited to potential problems
FEM can be applied to many engineering problems that are
governed by a differential equation
Need systematic approaches to generate FE equations
Weighted residual method
Energy method
Boundary conditions
du
(1) = 1
dx
0 R( x )W ( x )dx = 0
Weight function
If it satisfies for any W(x), then R(x) will approaches zero, and the
approximate solution will approach the exact solution
Depending on choice of W(x): least square error method,
method collocation
method, Petrov-Galerkin method, and Galerkin method
GALERKIN METHOD
Approximate solution is a linear combination of trial functions
N
u( x ) = ci i ( x )
Trial function
i =1
Galerkin
G l ki method
th d
Use N trial functions for weight functions
1
0
0 R( x )i ( x )ddx = 0,
i =1
1,, N
1 d 2u
+
p
(
x
)
i ( x )dx = 0, i = 1,, N
0 dx 2
1 d 2u
0 dx 2 i ( x )dx = 0 p( x )i ( x )dx,
i = 1,
1 , N
5
du
dx i
1
0
1 du d
d
i
dx dx
dx = p( x )i ( x )dx, i = 1,,N
0
Apply
Appl natural
nat ral BC and rearrange
1 d
i
du
dx =
dx d
d
dx
du
du
i = 1,,, N
Same order of differentiation for both trial function and approx. solution
Substitute
S b tit t the
th approximate
i t solution
l ti
1 d
i
c
dx j
j =1
d j
dx =
dx
du
du
i = 1,, N
Kij c j = Fi ,
i = 1,, N
( NN )( N1)
j =1
K ij =
Fi =
( N1)
d i d j
dx
dx dx
du
du
((1))i ((1))
((0))i (0)
( )
0 p( x )i ( x )dx + dx
d
d
dx
EXAMPLE1
Differential equation
Trial functions
d u
+ 1 = 0,0 x 1
dx 2
u(0) = 0
Boundary conditions
du
(1) = 1
dx
1( x ) = x
1( x ) = 1
2 ( x ) = x 2
2 ( x ) = 2 x
u( x ) = ci i ( x ) = c1x + c2 x 2
i=1
K11 = ( 1 ) dx = 1
2
K12 = K21 = ( 12 ) dx = 1
0
2
K22 = ( 2 ) dx =
0
4
3
du
F1 =
F2 =
du
EXAMPLE1 cont.
Matrix equation
1 3 3
[K ] =
3 3 4
{F} =
{c } = [K ] 1 {F } =
1
1 9
6 8
Approximate solution
u( x ) = 2 x
x2
2
EXAMPLE2
Differential equation
Trial functions
d u
+ x = 0,
0 x 1
dx 2
u(0) = 0
Boundary conditions
du
(1) = 1
dx
1( x ) = x
1( x ) = 1
2 ( x ) = x 2
2 ( x ) = 2 x
1 16
Coefficient matrix is same, force vector: {F} = 12 15
{c } = [K ] 1 {F } =
19
12
41
u( x ) =
19
x2
x
12
4
Exact solution
u( x ) =
3
x3
x
2
6
EXAMPLE2 cont.
Approximation is good for u(x),
u(x) but not good for du/dx
1.6
1.4
u(x), du/dx
u
1.2
1.0
0.8
06
0.6
0.4
0.2
0.0
0
0.2
u-exactt
u-approx.
0.4
0.6
d /d ((exact)
du/dx
t)
0.8
d /d ((approx.))
du/dx
11
0xL
Approximate solution
N
w (0) = 0
Essential BC
dw
(0) = 0
dx
2
d w
(L ) = M
2
dx
Natural BC
d 3w
L
V
(
)
=
dx 3
w ( x ) = ci i ( x )
i =1
Weighted
W i ht d residual
id l equation
ti (G
(Galerkin
l ki method)
th d)
L d 4w
0 dx 4 p( x ) i ( x )dx = 0,
i = 1,, N
12
HIGHER-ORDER DE cont.
After integration-by-parts
integration by parts twice
d 3w
i
dx 3
d 2w d i
2
dx dx
d 2i
dx =
dx 2 dx 2
L d 2w
d 2i
dx =
dx 2 dx 2
L d 2w
d 3w
p( x )i ( x )dx 3 i
dx
p( x )i ( x )dx, i = 1,, N
d 2w d i
+ 2
dx dx
, i = 1,, N
0
d 2 j d 2i
dx =
c j dx
d 2 d
dx 2
j =1
N
d 3w
p( x )i ( x )dx 3 i
d
dx
d 2w d i
+ 2
d
d
dx dx
, i = 1,, N
0
Matrix form
[K] {c} = {F}
NN N1
L d 2
i
2
0
Kij =
N1
Fi =
d 2j
dx
dx 2
dx
d 3w
p( x )i ( x )dx 3 i
dx
d 2w di
+ 2
dx dx
13
EXMAPLE
dw
(0) = 0
dx
d 2w
d 3w
=
(1)
2
(1) = 1
dx 2
dx 3
Fourth-order
Fourth order DE
d 4w
1 = 0,
dx 4
w (0) = 0
0xL
1 = 2,
2 2 = 6x
Coefficient matrix
K11 =
0 ( 1)
K12 = K 21 =
K 22 =
dx = 4
1
0 ( 12 ) dx = 6
0 ( 2 )
4 6
[K ] =
6 12
dx = 12
14
EXAMPLE cont.
RHS
F1 =
F2 =
d 3w (0)
d 2w (0)
16
(0) =
(0)
M
(1)
1
1
1
3
dx 3
dx 2
x 2dx + V 1(1) +
x 3dx + V 2 (1) +
d 3w (0)
d 2w (0)
29
(0)
M
(1)
2 (0) =
2
2
3
2
4
dx
dx
Approximate solution
41
{c} = [K ]1 {F} =
241
w(x) =
41 2 1 3
x x
24
4
Exact solution
w(x) =
1 4 1 3 7 2
x x + x
24
3
4
15
EXAMPLE cont.
4
3
w'', w''
2
1
0
-1
-2
-3
3
0
w'' (exact)
0.2
0.4
w'' (approx.)
0.6
w''' (exact)
0.8
1
w''' (approx.)
16
Approximate
solution
x
Finite
elements
Analytical
solution
Wh
When more number
b off finite
fi it elements
l
t are used,
d th
the approximated
i t d
piecewise linear solution may converge to the analytical solution
17
1D
2D
3D
dx =
0.1
dx +
0.2
01
0.1
dx +
0
0.9
9
dx
One element
18
TRIAL SOLUTION
Solution within an element is approximated using simple polynomials
polynomials.
1
1
2
2
n1
3
n1
xi
n+1
xi+1
i
xi x xi +1
19
u( xi ) = ui = a0 + a1xi
u( xi +1) = ui +1 = a0 + a1xi +1
Express a0 and a1 in terms of ui and ui+1. Then, the solution is
approximated by
u( x ) =
xi +1 x
xx
ui + ( i ) i ui +1
(i )
L
L
Ni ( x )
Ni +1( x )
xi x xi +1
Ni+1(x)
xi
xi+1
ui+2
ui
xi
ui+1
xi+1
du
dx
xi
xi+2
xi+1
xi+2
GALERKIN METHOD
Relation between interpolation functions and trial functions
1D problem with linear interpolation
ND
u( x ) = ui i ( x )
i =1
0,
0 x xi 1
( i 1)
xx
Ni ( x ) = ( i 1)i 1 , xi 1 < x xi
L
i ( x ) =
xi +1 x
(i )
, xi < x xi +1
Ni ( x ) =
L( i )
xi +1 < x xND
0,
Derivative
0,
1
,
d i ( x ) L( i 1)
=
dx
1
( i ) ,
L
0,
0 x xi 1
1
i (x )
( i 1 )
xi 1 < x xi 1/ L
x i 2
xi < x xi +1 1/ L( i )
xi +1 < x xND
x i 1
xi
x i +1
d i (x )
dx
22
EXAMPLE
Solve using two equal
equal-length
length elements
u (0) = 0
Boundary conditions
du
(1) = 1
dx
d 2u
+ 1 = 0,0 x 1
dx 2
0.5 < x 1
0,
0 x 0.5
0,
3 ( x ) =
0.5 < x 1
1 + 2 x,
2 x, 0 x 0.5
2 ( x ) =
2 2 x, 0.5 < x 1
1
_1
_2
_3
0.5
0
0
0.5
23
EXAMPLE cont.
Derivatives of interpolation functions
0 x 0.5
d 1( x )
2,
=
dx
0, 0.5 < x 1
0, 0 x 0.5
d 3 ( x )
=
dx
2, 0.5 < x 1
d 2 ( x ) 2, 0 x 0.5
=
dx
2, 0.5 < x 1
Coefficient matrix
0.5
1
d 1 d 2
dx
(
2)(2)
)(
)
dx
((0)(
)(2))dx = 2
=
+
0 dx dx
0
0.5
05
1 d d
0.5
1
2
2
=
dx =
4dx + 4dx = 4
0 dx dx
0
0.5
1
K12 =
K 22
RHS
0.5
F1 =
F2 =
1 (1 2 x )dx + 1 (0)dx +
0.5
0.5
2 xdx +
0.5
(2 2 x )dx +
du
du
du
(1)1(1) (0)1(0) = 0.25 (0)
dx
dx
dx
du
du
(1)2 (1)
(0)2 (0) = 0.5
dx
dx
24
EXAMPLE cont.
Matrix equation
2 2 0 u1 F1
2 4 2
u2 = 0.5
0 2 2
u3
1.25
Consider it as unknown
Striking the 1st row and striking the 1st column (BC)
4 2 u2 0.5
2 2 u3 1.25
u( x ) =
0.25 + 1.25 x,
0x 0
0.5
5
0.5 x 1
25
EXAMPLE cont.
16
1.6
u(x)
1.2
0.8
u-exact
0.4
u-approx.
0
0
0.2
0.4
0.6
0.8
1.5
du/dx
x
Solution comparison
Approx. solution has about
8% error
Derivative shows a large
discrepancy
Approx.
A
derivative
d i ti iis
constant as the solution is
piecewise linear
p
1
du/dx (exact)
0.5
du/dx (approx.)
0
0
0.2
0.4
0.6
0.8
26
FORMAL PROCEDURE
Galerkin method is still not general enough for computer code
Apply Galerkin method to one element (e) at a time
Introduce a local coordinate
=
x = xi (1 ) + x j
x xi
xx
= (e ) i
x j xi
L
u( x ) = ui N1( x ) + u j N2 ( x )
N1( ) = (1 )
Element e
N2 ( ) =
xi
xx
N1( x ) = 1 ( e ) i
L
N2 ( x ) =
x xi
L( e )
dN1 dN1 d
1
=
= (e )
dx
d dx
L
dN2
dN2 d
1
=
= + (e )
dx
d dx
L
xj
L(e )
27
u( xi ) = ui
u( x j ) = u j
u1
dN2
d
u2
dNi du
dx =
dx dx
xj
p( x )Ni ( x )dx +
du
du
( x j )Ni ( x j ) ( xi )Ni ( xi ), i = 1,2
dx
dx
28
1 1 dNi
L( e ) 0 d
+
1
u1
dN2
d i = L( e ) p( x )Ni ( )d
0
d
u2
du
du
( x j )Ni (1)
( x )N (0), i = 1,2
dx
dx i i
( xi )
dx
(e )
(e )
(e )
[k ]{u } = { f } +
du
+ ( x j )
dx
N ( )
{f (e ) } = L(e ) p( x ) 1 d
0
N2 ( )
dN 2
1
1
d
1
k( e ) =
L( e ) 0
22
dN2 dN1
d d
dN1 dN2
1 1
d d
d = 1
(e )
2
1
1
dN2
d
29
du
(1)
(
x
)
1
k11 k12 (1)
u1 f1
dx
= +
k21 k22
du
u2
f2
+ ( x2 )
dx
du
(2)
(
x
)
2
k11 k12 (2)
u2 f2
dx
= +
k21 k22
u
f
du
3
3
+ ( x )
dx 3
Assembly
k (1)
11
k (1)
21
(1)
k12
(1)
(2)
k22
+ k11
(2)
k21
Vanished
du
(1)
dx ( x1 ) unknown term
0
u1 f1
(1)
(2)
(2)
k12
u
f
f
0
=
+
+
2
(2)
d
u3 f (2) du
k22
3
( x3 )
dx
30
k ((1))
21
(1)
k12
(1)
( )
(2)
( )
k22
+ k11
((2))
k12
(2)
k221
(2)
(2)
+ k11
k22
( NE )
k21
( NDND )
du
( x1 )
f (1)
dx
1
f ((1)) + f ((2))
0
0
u2
2
2
= (2)
(3) +
0
0 u3 f3 + f3
( NE )
( NE )
du
u
N
f
k22
N
+ ( xN )
dx
( ND1)
( ND1)
( ND1)
[K ]{q} = {F}
31
EXAMPLE
Use three equal
equal-length
length elements
d 2u
+ x = 0,
dx 2
0 x 1
u(0) = 0, u(1) = 0
22 L( e ) 1 1 = 3 3 , (e = 1,2,3)
p( ) = xi (1 ) + x j
1
1
N ( )
{f (e ) } = L(e ) p( x ) 1 d = L( e ) [ xi ( 1 ) + x j ]
d
0
0
N2 ( )
xi
xj
3
6
(e = 1,2,3)
, , )
= L(e )
,
xi
xj
+
3
6
32
EXAMPLE cont.
RHS cont
cont.
f1(1)
1 1
(1) =
,
f2
54 2
Assembly
3 3
3 3 + 3
0
3
0
0
0
3
3+3
3
f2(2)
(2) =
,
5
f3 54
f3(3)
7
(3) =
8
f4 54
1 du
(0)
54 dx
0 u1 2
0 u2 54 + 54
=
3 u3 7
5
+
3 u4 54 54
8
du
(1)
+
54 dx
Element 1
Element 2
Element 3
2
=
3 6
u3
9 2
u2 =
4
81
u3 =
5
81
33
EXAMPLE cont.
Approximate solution
1
3
1
2
x
3
3
0x
2
x 1
3
0.08
u-approx.
u-exact
u
e act
0.06
u(x)
4
x,
27
4
1
1
u( x ) = + x ,
3
81 27
5
5
2
x ,
3
81 27
0.04
0.02
Exact solution
u( x ) =
0.2
0.4
0.6
0.8
1
x (1 x 2 )
6
34
CONVERGENCE
Weighted residual of 2m
2m-th
th order DE has highest
derivatives of order m
With exact arithmetic, the following is sufficient for
convergence to true solution () as mesh is refined:
Complete polynomials of at least order m inside element
Continuity
C ti it across element
l
tb
boundaries
d i up tto d
derivatives
i ti
of order m-1
Element must be capable of representing exactly
uniform and uniform derivatives up to order m-1.
Beam: 4-th order DE (m = 2)
u a1
=
v a4
cos 1
sin
1
sin
x
cos 1
y
CONVERGENCE RATE
Quadratic curve u=a+bx+cx2
modeled by linear FE
ufe=a+(b+ch)x
a (b ch)x
uA + uC
ch2 h2 ''
eD = uD uB =
uB =
= u
2
4 8
eA' =
uC u A
h
b = hc = u ''
2
h
Exact solution
u = a + bx + cx 2 + dx 3
Finite element approximation
1
3
u = a + b dh 2 x + c + dh x 2
2
2
Maximal errors
3dh3
h3
eD =
=
u' ' '
64
128
and
dh2
h2
e =
= u' ' '
2
12
'
A
38
CONVERGENCE RATE
Useful to know convergence rate
Estimate how much to refine
Detect modeling crimes
Extrapolate
39