Вы находитесь на странице: 1из 20

WEIGHTED RESIDUAL METHOD

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

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

Boundary conditions

du
(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

EXACT VS. APPROXIMATE SOLUTION cont.


Approximate solution
It satisfies the essential BC, but not natural BC
The approximate solution may not satisfy the DE exactly
Residual: d 2u
+ p( x ) = R ( x )
dx 2
Want to minimize the residual by
y multiplying
p y g with a weight
g W and
integrate over the domain
1

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

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
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

GALERKIN METHOD cont.


Galerkin method cont
cont.
Integration-by-parts: reduce the order of differentiation in u(x)

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

0 p( x )i ( x )dx + ddx ((1))i ((1)) ddx ((0))i ((0),),

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

0 p( x )i ( x )dx + dx (1)i (1) dx (0)i (0),

i = 1,, N

GALERKIN METHOD cont.


Galerkin method cont
cont.
Write in matrix form
N

Kij c j = Fi ,

[K] {c} = {F}

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

Coefficient matrix is symmetric; Kij = Kji


N equations with N unknown coefficients

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

Approximate solution (satisfies the essential BC)


2

u( x ) = ci i ( x ) = c1x + c2 x 2
i=1

Coefficient matrix and RHS vector


1

K11 = ( 1 ) dx = 1
2

K12 = K21 = ( 12 ) dx = 1
0

2
K22 = ( 2 ) dx =
0

4
3

du

F1 =

0 1( x )dx + 1(1) dx (0)1(0) = 2

F2 =

0 2 ( x )dx + 2 (1) dx (0)2 (0) = 3

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

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

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

The trial functions cannot express


p
the exact solution;; thus,,
approximate solution is different from the exact one
10

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

HIGHER-ORDER DIFFERENTIAL EQUATIONS


Fourth-order
Fourth order differential equation
d 4w
p( x ) = 0,
dx 4

0xL

Beam bending under pressure load

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

In order to make the order of differentiation same, integration-by-parts


must be done twice

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

Substitute approximate solution


L

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

Do not substitute the approx. solution in the boundary terms

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

Two trial functions


1 = x 2, 2 = x 3

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

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
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

FINITE ELEMENT METHOD cont.


Types of finite elements

1D

2D

3D

Variational equation is imposed on each element.


1

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

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

The unknown coefficients,


coefficients a0 and a1, will be expressed in terms of
nodal solutions u(xi) and u(xi+1).

19

TRIAL SOLUTION cont.


Substitute two nodal values

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 )

Solution for i-th element:


u ( x ) = Ni ( x )ui + Ni +1( x )ui +1,

Ni(x) and Ni+1(x): Shape

xi x xi +1

Function or Interpolation Function


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
ui

xi

ui+1
xi+1

du
dx

xi

xi+2

xi+1

xi+2

Stress and strain (derivative) are often averaged at the node.


21

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,

Difference: the interpolation function does not exist in the entire


domain but it exists only in elements connected to the node
domain,

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

Three nodes at x = 0, 0.5, 1.0; displ at nodes = u1, u2, u3


Approximate solution u( x ) = u11( x ) + u22 ( x ) + u33 ( x )
1 2 x, 0 x 0.5
1( x ) =

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

Solve for u2 = 0.875, u3 = 1.5


Approximate solution
1.75
1 75 x,

u( x ) =

0.25 + 1.25 x,

0x 0
0.5
5
0.5 x 1

Piecewise linear solution

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

Approximate solution within the element


N 1() N 2 ()

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

FORMAL PROCEDURE cont.


Interpolation property
N1( xi ) = 1, N1( x j ) = 0
N2 ( xi ) = 0,, N2 ( x j ) = 1

u( xi ) = ui
u( x j ) = u j

Derivative of approx. solution


du
dN1
dN2
+ uj
= ui
dx
dx
dx
u1
1 dN
du dN1 dN2
=
= (e ) 1
dx dx
dx
u2 L d

u1

dN2

d
u2

Apply Galerkin method in the element level


xj

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

FORMAL PROCEDURE cont.


Change variable from x to
dN1

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

Do not use approximate solution for boundary terms

Element-level matrix equation


du

( 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

FORMAL PROCEDURE cont.


Need to derive the element
element-level
level equation for all elements
Consider Elements 1 and 2 (connected at Node 2)

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

FORMAL PROCEDURE cont.


Assembly of NE elements (ND = NE + 1)
(1)
k11

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}

Coefficient matrix [K] is singular; it will become non-singular


after applying boundary conditions

31

EXAMPLE
Use three equal
equal-length
length elements
d 2u
+ x = 0,
dx 2

0 x 1

u(0) = 0, u(1) = 0

All elements have the same coefficient matrix


1 1 1 3 3
k(e )
=
1 2 3)

22 L( e ) 1 1 = 3 3 , (e = 1,2,3)

Change variable of p(x) = x to p():


RHS

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

Apply boundary conditions

Deleting 1st and 4th rows and columns


6 3
u 1 1

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

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
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)

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

RIGID BODY MOTION


Rigid
Ri id b
body
d motion
ti ffor CST can llead
d tto non zero strains!
t i !

Rigid body motion

u a1
=
v a4

cos 1
sin

1
sin
x
cos 1
y

The normal strain x = x = cos 1 0


36

CONVERGENCE RATE
Quadratic curve u=a+bx+cx2
modeled by linear FE
ufe=a+(b+ch)x
a (b ch)x

Maximal error at mid-point D

uA + uC
ch2 h2 ''
eD = uD uB =
uB =
= u
2
4 8

Maximal gradient error is maximal at ends

eA' =

uC u A
h
b = hc = u ''
2
h

Error in function converges faster than in derivative!


37

QUADRATIC ELEMENT FOR CUBIC SOLUTION

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

Most studies just do series of refinements if anything

39

Вам также может понравиться