Professional Documents
Culture Documents
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
• Ordinary differential equation (second-order
(second order or fourth-order)
fourth order)
can be solved using the weighted residual method, in
particular using Galerkin method
2
EXACT VS. APPROXIMATE SOLUTION
• Exact solution
– Boundary value problem: differential equation + boundary conditions
– Displacements in a uniaxial bar subject to a distributed force p(x)
d 2u
+ p( x ) = 0, 0 ≤ x ≤ 1
dx 2
u(0) = 0 ⎫⎪
⎪
⎪
du ⎬ Boundary conditions
(1) = 1⎪
⎪
dx ⎪
⎭
– Essential BC: The solution value at a point is prescribed (displacement
or kinematic BC)
– Natural BC: The derivative is given at a point (stress BC)
– Exact
E t solution
l ti u(x):
( ) twice
t i differential
diff ti l function
f ti
– In general, it is difficult to find the exact solution when the domain
and/or boundary conditions are complicated
– Sometimes the solution may not exists even if the problem is well
defined
3
– 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
4
GALERKIN METHOD
• Approximate solution is a linear combination of trial functions
N
u( x ) = ∑ ci φi ( x ) Trial function
i =1
– Accuracy depends on the choice of trial functions
– The approximate solution must satisfy the essential BC
• Galerkin
G l ki method
th d
– Use N trial functions for weight functions
1
∫0 R( x )φi ( x )ddx = 0,
0 i =1
1,…, N
1⎛ d 2u ⎞⎟
⎜⎜
∫0 ⎜⎝ dx 2 + p( x ) ⎟⎟φi ( x )dx = 0, i = 1,…, N
⎠
1 d 2u 1
∫0 dx 2 φi ( x )dx = −∫0 p( x )φi ( x )dx, i = 1,
1 …, N
– Apply
Appl natural
nat ral BC and rearrange
1 dφ du 1 du du
∫0 dx = ∫0 p( x )φi ( x )dx + ddx ((1))φi ((1)) − ddx ((0))φi ((0),), i = 1,,…, N
i
dx d
d dx
– 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φ
N
dφ j 1 du du
∫0 dx ∑ j ∫0 p( x )φi ( x )dx + dx (1)φi (1) − dx (0)φi (0),
i
c dx = i = 1,…, N
j =1 dx
6
GALERKIN METHOD cont.
• Galerkin method cont
cont.
– Write in matrix form
N
1 d φi d φ j
K ij = ∫0 dx dx
dx
1 du du
Fi = ∫0 p( x )φi ( x )dx + dx
d
((1))φi ((1)) −
d
dx
((0))φi (0)
( )
EXAMPLE1
• Differential equation Trial functions
2
d u
+ 1 = 0,0 ≤ x ≤ 1 φ1( x ) = x φ1′( x ) = 1
dx 2 φ2 ( x ) = x 2 φ2′ ( x ) = 2 x
u(0) = 0 ⎪⎫
⎪
⎪
du ⎬ Boundary conditions
(1) = 1⎪
⎪
dx ⎪
⎭
• Approximate solution (satisfies the essential BC)
2
u( x ) = ∑ ci φi ( x ) = c1x + c2 x 2
i=1
• Approximate solution
x2
u( x ) = 2 x −
2
– Approximate solution is also the exact solution because the linear
combination of the trial functions can represent the exact solution
EXAMPLE2
• Differential equation Trial functions
2
d u
+ x = 0, 0 ≤ x ≤1 φ1( x ) = x φ1′( x ) = 1
dx 2 φ2 ( x ) = x 2 φ2′ ( x ) = 2 x
u(0) = 0 ⎪⎫
⎪
⎪
du ⎬ Boundary conditions
(1) = 1⎪
⎪
dx ⎪
⎭
⎪ ⎪ 1 ⎧ 16 ⎫
• Coefficient matrix is same, force vector: {F} = 12 ⎨⎪15 ⎬⎪
⎩⎪ ⎭⎪
⎧⎪ 19 ⎫⎪ x2
{c } = [K ]− 1 {F } = ⎪⎨ 12 ⎪⎬ u( x ) =
19
x−
⎪⎩⎪ − 41 ⎪⎭⎪ 12 4
• Exact solution
3 x3
u( x ) = x−
2 6
10
EXAMPLE2 cont.
• Approximation is good for u(x),
u(x) but not good for du/dx
1.6
1.4
1.2
1.0
u(x), du/dx
0.8
u
06
0.6
0.4
0.2
0.0
0 0.2 0.4 x 0.6 0.8 1
11
• 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
L L
d 3w d 2w d φi L d 2w d 2φi L
φi − 2 +∫ dx = ∫0 p( x )φi ( x )dx, i = 1,…, N
dx 3 0 dx dx 0
0 dx 2 dx 2
L L
L d 2wd 2φi L d 3w d 2w d φi
∫0 dx 2 dx 2
dx = ∫0 p( x )φi ( x )dx − 3 φi
dx
+ 2
dx dx
, i = 1,…, N
0 0
EXMAPLE
• Fourth-order
Fourth order DE dw
w (0) = 0 (0) = 0
dx
d 4w d 2w d 3w
− 1 = 0, 0≤x≤L (1) = 2 (1) = −1
dx 4 dx 2 dx 3
• Two trial functions
φ1 = x 2, φ2 = x 3 φ1′′ = 2,
2 φ2′′ = 6x
• Coefficient matrix
1
∫0 ( φ1′′)
2
K11 = dx = 4
1 ⎡4 6 ⎤
K12 = K 21 = ∫0 ( φ1′′φ2′′ ) dx = 6 [K ] = ⎢ ⎥
⎢⎣ 6 12 ⎥⎦
1
∫0 ( φ2′′ )
2
K 22 = dx = 12
14
EXAMPLE cont.
• RHS
1 d 3w (0) d 2w (0) 16
F1 = ∫0 x 2dx + V φ1(1) +
dx 3
φ1(0) + M φ1′(1) −
dx 2
φ1′(0) =
3
1 d 3w (0) d 2w (0) 29
F2 = ∫0 x 3dx + V φ2 (1) +
dx 3
φ2 (0) + M φ2′ (1) −
dx 2
φ2′ (0) =
4
• Approximate solution
⎧ 41 ⎪
⎪ ⎫
{c} = [K ]−1 {F} = ⎪
⎨ 241 ⎪
41 2 1 3
⎬ w(x) = x − x
⎪⎩
⎪ − 4 ⎪⎭
⎪ 24 4
• Exact solution
1 4 1 3 7 2
w(x) = x − x + x
24 3 4
15
EXAMPLE cont.
1
w'', w''
-1
-2
-3
3
0 0.2 0.4 x 0.6 0.8 1
w'' (exact) w'' (approx.) w''' (exact) w''' (approx.)
16
FINITE ELEMENT APPROXIMATION
• Domain Discretization
– Weighted residual method is still difficult to obtain the trial functions
that satisfy the essential BC
– FEM is i to
t divide
di id th
the entire
ti d domain
i iinto
t a sett off simple
i l sub-domains
bd i
(finite element) and share nodes with adjacent elements
– Within a finite element, the solution is approximated in a simple
polynomial
l i l form
f
u(x)
Approximate
solution
x
Finite Analytical
elements 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
One element
18
TRIAL SOLUTION
– Solution within an element is approximated using simple polynomials
polynomials.
1 2 n−1 n
1 2 3 n−1 n n+1
xi xi+1
i
– i-th element is composed of two nodes: xi and xi+1. Since two
unknowns are involved,, linear polynomial
p y can be used:
u ( x ) = a0 + a1x, 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
xi +1 − x x−x
u( x ) = (i )
ui + ( i ) i ui +1
L L
Ni ( x ) Ni +1( x )
20
TRIAL SOLUTION cont.
• Observations
– Solution u(x) is interpolated using its nodal values ui and ui+1.
– Ni(x) = 1 at node xi, and =0 at node xi+1.
Ni(x) Ni+1(x)
xi xi+1
– The solution is approximated by piecewise linear polynomial and its
gradient is constant within an element
element.
u ui+2 du
ui dx
ui+1
21
GALERKIN METHOD
• Relation between interpolation functions and trial functions
– 1D problem with linear interpolation
⎧ 0,
⎪ 0 ≤ x ≤ xi −1
⎪
⎪
⎪⎪ ( i −1) x−x
⎪ Ni ( x ) = ( i −1)i −1 , xi −1 < x ≤ xi
ND ⎪
φi ( x ) = ⎪
L
u( x ) = ∑ ui φi ( x ) ⎨
⎪ xi +1 − x
⎪
⎪⎪ Ni ( x ) =
(i )
, xi < x ≤ xi +1
i =1
⎪ L( i )
⎪
⎪
⎩ 0,
⎪ xi +1 < x ≤ xND
– Difference: the interpolation function does not exist in the entire
domain but it exists only in elements connected to the node
domain,
• Derivative
⎧⎪ 0, 0 ≤ x ≤ xi −1 1
⎪⎪
⎪⎪ 1 ( i −1 ) φi (x )
⎪ , xi −1 < x ≤ xi 1/ L
d φi ( x ) ⎪⎪ L( i −1)
=⎨ x i −2 x i −1 xi x i +1
dx ⎪⎪ 1
⎪⎪ − ( i ) , xi < x ≤ xi +1 −1/ L( i )
d φi (x )
⎪⎪ L
⎪⎪⎩ 0, xi +1 < x ≤ xND dx
22
EXAMPLE
• Solve using two equal
equal-length
length elements
u (0) = 0 ⎫⎪
d 2u ⎪
⎪
+ 1 = 0,0 ≤ x ≤ 1 du ⎬ Boundary conditions
dx 2 (1) = 1⎪
⎪
dx ⎪
⎭
⎩⎪ −1 + 2 x,
⎪ 0.5 < x ≤ 1
φ_1
φ 0.5 φ_2
φ_3
0
0 0.5 1
x
23
EXAMPLE cont.
• Derivatives of interpolation functions
d φ1( x ) ⎧⎪ −2, 0 ≤ x ≤ 0.5 d φ2 ( x ) ⎧⎪ 2, 0 ≤ x ≤ 0.5
=⎨ =⎨
dx ⎪
⎪⎩ 0, 0.5 < x ≤ 1 dx ⎪⎪⎩ −2, 0.5 < x ≤ 1
d φ3 ( x ) ⎪⎧ 0, 0 ≤ x ≤ 0.5
=⎨
dx ⎪
⎩ 2, 0.5 < x ≤ 1
⎪
• Coefficient matrix
d φ1 d φ2
1 0.5 1
K12 = ∫0 dx dx dx = ∫0 (−2)(2)
)( )dx + ∫0.5
05
)(−2))dx = −2
((0)(
1 dφ dφ 0.5 1
K 22 =∫ 2 2
dx = ∫ 4dx + ∫ 4dx = 4
0 dx dx 0 0.5
• RHS
0.5 1 du du du
F1 = ∫0 1× (1− 2 x )dx + ∫ 1× (0)dx +
0.5 dx
(1)φ1(1) − (0)φ1(0) = 0.25 − (0)
dx dx
0.5 1 du du
F2 = ∫0 2 xdx + ∫
0.5
(2 − 2 x )dx +
dx
(1)φ2 (1) −
dx
(0)φ2 (0) = 0.5
24
EXAMPLE cont.
• Matrix equation
⎡ 2 −2 0 ⎤ ⎧⎪ u1 ⎫⎪ ⎧⎪ F1 ⎫⎪ Consider it as unknown
⎢ ⎥⎪ ⎪ ⎪ ⎪ ⎪⎪
⎢ −2 4 −2 ⎥ ⎪ ⎪
⎨ u2 ⎬ = ⎨ 0.5 ⎬
⎢ ⎥⎪ ⎪ ⎪ ⎪
⎢⎣ 0 −2 2 ⎥⎦ ⎩⎪
⎪ u3 ⎭⎪
⎪ ⎩⎪
⎪1.25 ⎭⎪⎪
• Striking the 1st row and striking the 1st column (BC)
⎡ 4 −2 ⎤ ⎧⎪ u2 ⎫⎪ ⎧⎪ 0.5 ⎫⎪
⎢ ⎥⎨ ⎬ = ⎨ ⎬
⎢⎣ −2 2 ⎥⎦ ⎪⎩⎪ u3 ⎪⎪⎭ ⎩⎪⎪1.25 ⎭⎪⎪
• Solve for u2 = 0.875, u3 = 1.5
• Approximate solution
⎧1.75
⎪ 1 75 x, 0≤x ≤0 0.5
5
u( x ) = ⎨
⎪
⎩ 0.25 + 1.25 x,
⎪ 0.5 ≤ x ≤ 1
25
EXAMPLE cont.
• Solution comparison 16
1.6
0.8
• Derivative shows a large
discrepancy 0.4
u-exact
u-approx.
• Approx.
A derivative
d i ti iis 0
constant as the solution is 0 0.2 0.4 x 0.6 0.8 1
piecewise linear
p 2
1.5
du/dx
x
du/dx (exact)
0.5
du/dx (approx.)
0
0 0.2 0.4 x 0.6 0.8 1
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 x−x
x = xi (1 − ξ ) + x j ξ ξ= = (e ) i
x j − xi L
28
FORMAL PROCEDURE cont.
• Change variable from x to ξ
1 1 dNi ⎢ dN1 dN2 ⎥ ⎧ u1 ⎫
⎥ d ξ i⎪⎨ ⎪⎬ = L( e ) ∫ p( x )Ni (ξ )d ξ
1
L( e ) ∫0 d ξ
⎢
⎣⎢ d ξ d ξ ⎦⎥ ⎪⎩⎪ u2 ⎪⎭⎪ 0
du du
+ ( x j )Ni (1) − ( x )N (0), i = 1,2
dx dx i i
– Do not use approximate solution for boundary terms
• Element-level matrix equation
⎧ du
⎪ ⎫
− ( xi ) ⎪
d
⎪
⎪ ⎪
⎪ 1 ⎧
⎪ N (ξ ) ⎫⎪
⎪
[k ]{u } = { f } + ⎨
(e ) (e ) (e ) dx ⎪
⎬ {f (e ) } = L(e ) ∫ p( x )⎨ 1 ⎬ d ξ
⎪ du ⎪ 0 ⎪
⎪ N2 (ξ ) ⎪⎭⎪
⎩
⎪
⎪ + ( x j )⎪
⎪
⎪ dx
⎩ d ⎪
⎭
⎡ ⎛ dN ⎞2 dN1 dN2 ⎤⎥
⎢ ⎜ 1 ⎟⎟
1 ⎝ d ξ ⎟⎠
1⎢ ⎜ dξ dξ ⎥ ⎡ 1 −1⎤
⎡ k( e ) ⎤ = ⎢ ⎥ dξ = 1 ⎢
⎣ ⎦ L( e ) ∫0 ⎢ 2 ⎥ (e ) ⎢
−
⎥
⎥
2×2 ⎢ dN2 dN1 ⎛ dN2 ⎞⎟ ⎥ L ⎣ 1 1 ⎦
⎜
⎢ dξ dξ
⎣ ⎜⎝ d ξ ⎟⎟⎠ ⎥⎦
29
[K ]{q} = {F}
31
EXAMPLE
• Use three equal
equal-length
length elements
d 2u
+ x = 0, 0 ≤ x ≤1 u(0) = 0, u(1) = 0
dx 2
33
EXAMPLE cont.
• Approximate solution
⎧⎪ 4 1
⎪⎪ x, 0≤x≤
⎪⎪ 27 3 0.08
u-approx.
⎪⎪ 4 1⎛ 1⎞ 1 2
u-exact
u e act
u( x ) = ⎪⎨ + ⎜⎜ x − ⎟⎟⎟, ≤x≤
0.06
⎪⎪ 81 27 ⎝ 3⎠ 3 3
u(x)
⎪⎪ 0.04
5 5⎛ 2⎞ 2
⎪⎪⎪ − ⎜⎜ x − ⎟⎟, ≤ x ≤1
⎪⎩ 81 27 ⎝ 3⎠
0.02
3
0
1
u( x ) = x (1 − x 2 )
6
– Three element solutions are poor
– Need more elements
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 tbboundaries
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)
– Complete polynomials: v(x) = a0 + a1x + a2x2 + a3x3
– Continuity on v(x) and dv(x)/dx across element boundaries
– Uniform v(x)
( ) = a0
Beam elements will converge
– Uniform derivative dv(x)/dx = a1
upon refinement
35
36
CONVERGENCE RATE
Quadratic curve u=a+bx+cx2
modeled by linear FE
ufe=a+(b+ch)x
a (b ch)x
uC − u A h
eA' = − b = hc = u ''
h 2
• Error in function converges faster than in derivative!
37
• 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 dh2 h2
eD = − =− u' ' ' and e =−
'
A = − u' ' '
64 128 2 12
38
CONVERGENCE RATE
• Useful to know convergence rate
– Estimate how much to refine
– Detect modeling crimes
– Extrapolate
• Most studies just do series of refinements if anything
39