You are on page 1of 12

Formulations

1. Collocation method
The residual,

N
R(x) ≡ ui Lei (x) − c(x), (1)
i=1

must vanish at selected N points as

R(x1 ) = 0, R(x2 ) = 0, . . . R(xn ) = 0. (2)

Hence

Le1 |x=x1 u1 + Le2 |x=x1 u2 + Le3 |x=x1 u3 + . . . + LeN |x=x1 uN = c(x1 ) (3)
Le1 |x=x2 u1 + Le2 |x=x2 u2 + Le3 |x=x2 u3 + . . . + LeN |x=x2 uN = c(x2 ) (4)
... (5)
Le1 |x=xN u1 + Le2 |x=xN u2 + Le3 |x=xN u3 + . . . + LeN |x=xN uN = c(xN ), (6)

or   u  
c(x1 )

Le1 |x=x1 Le2 |x=x1 . . . LeN |x=x1 1
 Le1 |x=x2   u2   c(x2 ) 
 Le2 |x=x2 . . . LeN |x=x2     
 ... ... ... ...  .
 ..
=
 
.. .

(7)
.
Le1 |x=xN Le2 |x=xN . . . LeN |x=xN uN c(xN )

Note that the matrix in the left side is not necessarily symmetrical.

2. Least square method

||R||2 = (R, R)
 

N ∑
N
=  ui Lei − c, uj Lej − c
i=1 j=1
N ∑
∑ N ∑
N
= ui uj (Lei , Lej ) − 2 ui (Lei , c) + c2 , (8)
i=1 j=1 i=1

so
∂||R||2 ∑N
=2 uj (Lei , Lej ) − 2(Lei , c) = 0, (9)
∂ui j=1

from which

N
(Lei , Lej )uj = (Lei , c), (10)
j=1
or     
(Le1 , Le1 ), (Le1 , Le2 ), . . . , (Le1 , LeN ) u1 (Le1 , c)
 (Le2 , Le1 ) (Le2 , Le2 ), . . . , (Le2 , LeN )   u2   (Le2 , c) 
  = . (11)
 ..., ..., ..., ...  ...   ... 
(LeN , Le1 ) (LeN , Le2 ), . . . , (LeN , LeN ) uN (LeN , c).

Note that the matrix is symmetrical.

3. Galerkin method

N
( uj Lej , ei ) = (c, ei ) (12)
j=1

1
or

N
(Lei , ej )uj = (c, ei ) (13)
j=1
or     
(Le1 , e1 ), (Le1 , e2 ) . . . (Le1 , eN ) u1 (e1 , c)
 (Le2 , e1 ) (Le2 , e2 ) . . . (Le2 , eN )   u2   (e2 , c) 
  = 
 ..., ..., ..., ...  ...   ... . (14)
(LeN , e1 ) (LeN , e2 ) . . . (LeN , eN ) uN (eN , c).

Note that the matrix is symmetrical when L is symmetrical (such as the Sturm-Liouville system).

Finite element method


The finite element method is a special case of the Galerkin method in which the base functions are chosen
such that each base function is 1 at the corresponding point (node) but otherwise 0 at other points (see the
figure below).

Advantages:

2
1. The coefficient, ui , of the approximation,

ũ = u1 e1 + u2 e2 + . . . + uN eN (15)

gives the value of u at x = xi .


2. The matrix for the finite element method is tri-diagonal, i.e.
 
# # 0 0 ... 0
 # # # 0 ... 0 
 
 0 # # # 0 0  (16)
 
 0 0 # # # 0 
... ... ... ... ...
which is easier to invert than fully populated matrices (L and U in the LU decomposition are also
tri-diagonal).
Example
u′′ + u = −x, u(0) = u(1) = 0. (17)
This differential equation has the exact solution as
sin x
u = −x + . (18)
sin 1
Solution by the finite element method

• Two nodes
Choose e1 (x) and e2 (x) as

3
Each component of the matrix can be computed as

(Lei , ej ) = (e′′i + ei , ej )
= (e′′i , ej ) + (ei , ej )
∫ 1 ∫ 1
′′
= ei ej dx + ei ej dx
0 0
∫ 1 ∫ 1
= [e′i ej ]10 − e′i e′j dx + ei ej dx
0 0
∫ 1 ∫ 1
= − e′i e′j dx + ei ej dx. (19)
0 0

Equation (19) is preferred over


∫ 1
(e′′i ej + ei ej )dx
0

4
as ei is differentiated once instead of twice.1
For instance,

∫ 1 ∫ 1
(Le1 , e2 ) = − e′1 e′2 dx + e1 e2 dx
0 0
∫ 2/3 ∫ 2/3
2 1
= − (−9)dx + (−3)(x − )3(x − )dx
1/3 1/3 3 3
55
= , (20)
18

∫ 1 ∫ 1
(Le1 , e1 ) = − (e′1 )2 dx + (e1 )2 dx
0 0
∫ 2/3 ∫ 1/3 ∫ 2/3
2
= − 9dx + (3x)2 dx + (−3(x − ))2 dx
0 0 1/3 3
52
= − , (21)
9

∫ 1/3 ∫ 2/3
2
(c, e1 ) = (−x)(3x)dx + (−x)(−3(x − ))dx
0 1/3 3
1
= − . (22)
9
Hence the equations for ui are
( )( ) ( )
− 52
9
55
18 u1 − 19
= , (23)
55
18 − 52
9 u2 − 29
which can be solved for u1 and u2 as

428 526
u1 = ∼ 0.0549352, u2 = ∼ 0.0675138, (24)
7791 7791
so
ũ = 0.0549352e1 + 0.0675138e2 . (25)
It is seen that
ũ = 0.0549352 at x = 1/3, ũ = 0.0675138 at x = 2/3,
while the exact solution is
u = 0.0555032 at x = 1/3, u = 0.068201 at x = 2/3,

Here is a comparison between the exact solution and FEM approximation.

1 Higher order derivatives of a function lose accuracy.

5
• Nine nodes
Choose e1 ∼ e9 as

Each component of the matrix can be computed as

(Lei , ej ) = (e′′i + ei , ej )
= (e′′i , ej ) + (ei , ej )
∫ 1 ∫ 1
= e′′i ej dx + ei ej dx
0 0
∫ 1 ∫ 1
= [e′i ej ]10 − e′i e′j dx + ei ej dx
0 0
∫ 1 ∫ 1
= − e′i e′j dx + ei ej dx. (26)
0 0

For instance,

∫ 1 ∫ 1
(Le1 , e2 ) = − e′1 e′2 dx + e1 e2 dx
0 0

6
∫ 2/10 ∫ 2/10
= − (−100)dx + (−2 + 10(3 − 10x)x) dx
1/10 1/10
601
= , (27)
60

∫ 1 ∫ 1
(Le1 , e1 ) = − (e′1 )2 dx + (e1 )2 dx
0 0
∫ 2/10 ∫ 1/10 ∫ 2/10
= − 100dx + 4(5x)2 dx + (1 − 5x)2 dx
0 0 1/10
−299
= , (28)
15

∫ 1/10 ∫ 2/10
(c, e1 ) = 10x(−x)dx + 2(1 − 5x)(−x)dx
0 1/10
1
= − . (29)
100

Hence the equations for ui are

    
− 299
15
601
60 0 0 0 0 0 0 0 u1 − 100
1
 601
− 299 601
0 0 0 0 0 0  u2   − 50
1 
 60 15 60    
 0 601
− 299 601
0 0 0 0 0  u3   − 100
3 
 60 15 60    
 0 0 601
− 299 601
0 0 0 0  u4   − 25
1 
 60 15 60    
 0 0 0 601
− 299 601
0 0 0  u5 = − 20
1  (30)
 60 15 60    
 0 0 0 0 601
− 299 601
0 0  u6   − 50
3 
 60 15 60    
 0 0 0 0 0 601
− 299 601
0  u7   − 100
7 
 60 15 60    
 0 0 0 0 0 0 601
− 299 601  u8   − 25
2 
60 15 60
0 0 0 0 0 0 0 601
60 − 299
15
u9 − 100
9

which can be solved for u1 ∼ u9 as


   
u1 0.018624
 u2   0.0360638 
   
 u3   0.0511469 
   
 u4   0.0627243 
   
 u5 = 0.0696822 
   
 u6   0.0709528 
   
 u7   0.0655249 
   
 u8   0.0524546 
u9 0.0308739
so

9
ũ = ui ei . (31)
i=1

Here is a comparison between the exact solution and FEM approximation.

7
Base functions in 2-D

Examples of MWR Applied to S-L systems


Trigonometric functions (sine)
1. S-L system:

d2
Ly = λy, L≡− , (y ′′ + λy = 0), y(0) = y(1) = 0. (32)
dx2
2. Eigenfunctions/Eigenvalues
√ √ 2
yn = 2 sin λn x, λn = (nπ) , (yn , ym ) = δnm . (33)

3. Galerkin method

2 Sayas, F. J. Cited on, 87.

8
Figure 1: The first three eigenfunctions.

d2 ∑
N
Ly = λy, L≡− , ỹ = ci ei (x), ei = {x(1 − x), x2 (1 − x), x3 (1 − x) . . .} (34)
dx2 i=1


N ∑
N ∑
N ∑
N
R≡ ci L ei − λ ci ei ⇒ (R, ei ) = 0 ⇒ (Lei , ej )cj = λ (ei , ej )cj . (35)
i=1 i=1 j=1 j=1

Ac = λBc. (36)

 1 1
  1 1

3 6 ... 30 60 ...
aij =  1
6
2
15 ...  bij =  1
60
1
105 ...  (37)
... ... ... ... ... ...

y1 = 1.72629 × 10−6 (1 − x)x10 + 0.0344002(1 − x)x9 − 0.137617(1 − x)x8


−0.0827522(1 − x)x7 + 0.729932(1 − x)x6 + 0.744424(1 − x)x5 −
2.86596(1 − x)x4 − 2.86531(1 − x)x3 + 4.44288(1 − x)x2 + 4.44288(1 − x)x (38)

Bessel functions

1. S-L system:
( ) ( )
1 d d 1 d dy
Ly = λy, L≡− x , − x = λy, y ′ (0) = y(1) = 0. (39)
x dx dx x dx dx

2. Bessel functions

2
yn = J0 (λn x) , (yn , ym ) = δnm . (40)
J1 (λn )

3. Galerkin method

( ) ∑
N
1 d d
Ly = λy, L≡− x y= ci ei (x), ei = {x2 − 1, x3 − 1, . . .} (41)
x dx dx i=1


N ∑
N ∑
N ∑
N
L ci e i = λ ci e i ⇒ (Lei , ej )cj = λ (ei , ej )cj . (42)
i=1 i=1 j=1 j=1

9
Figure 2: Bessel Avenue just south of UTA campus.

Figure 3: The first three eigenfunctions.

Ac = λBc. (43)

 6
  1 27

1 5 ... 6 140 ...
aij =  6
5
3
2 ...  bij =  27
140
9
40 ...  (44)
... ... ... ... ... ...

( ) ( ) ( )
y1 = 0.000755405 x11 − 1 − 0.00469829 x10 − 1 + 0.00798563 x9 − 1
( ) ( ) ( )
+0.0100234 x8 − 1 + 0.00891029 x7 − 1 − 0.233494 x6 − 1
( ) ( ) ( )
+0.00165695 x5 − 1 + 1.42322 x4 − 1 + 0.0000411283 x3 − 1
( )
−3.93851 x2 − 1 (45)

10
Weak form in FEM
It is common in FEM to use the weak form formulation instead of the direct formulation (strong form) as
the weak form formulation allows less restrictions on the solution’s behavior (differentiability).

• Statement 1
The problem of solving the following boundary value problem,

−∆u = f in Ω, (46)
u = 0 on ∂Ω. (47)

is equivalent to

• Statement 2
Find u such that
∫ ∫ ∫ ∫
∇u · ∇vdS = f vdS, (48)
Ω Ω
for all v such that v = 0 on ∂Ω.

(Proof)

• Statement 1 ⇒ Statement 2

Multiply a function that vanishes on the boundary, v, on both sides of Eq. (46) to get
∫ ∫ ∫ ∫
− ∆u v dS = f v dS. (49)
Ω Ω

By integrating the left hand side of Eq.(49) by parts, we have


∫ ∫ ∫ ∫
− ∆u v dS = − ∇ · ∇u v dS

I Ω ∫ ∫
= − n · ∇u vdℓ + ∇u · ∇v dS
∫ ∫ ∂Ω Ω

= ∇u · ∇v dS, (50)

because v vanishes on the boundary.


• Statement 2 ⇒ Statement 1

Just go backwards.

In FEM, choose v as the base function, ei , and set u as



N
u= uj ej .
j=1

Equation (48) then becomes


∫ ∫ ∑
N ∫ ∫
∇ uj ej · ∇ei dS = f ei dS, (51)
Ω j=1 Ω

11
or
N (∫ ∫
∑ ) ∫ ∫
∇ei · ∇ej dS uj = f ei dS, (52)
j=1 Ω Ω

or
Lu = c, (53)
where ∫ ∫ ∫ ∫
Lij = ∇ei · ∇ej dS, ci = f ei dS.
Ω Ω
This result is, of course, identical to what we already derived using the Galerkin method in Lecture Note
23. The term “weak” comes from the fact that the weak form requires u to be differentiable only once while
the strong form requires u to be differentiable twice.

12

You might also like