0% found this document useful (0 votes)
11 views14 pages

Fem Engineering

The document discusses the finite element method (FEM), a numerical technique for solving complex physical problems, particularly those with non-linearities. It covers the weak formulation, mathematical equivalences, and the application of FEM in a one-dimensional boundary value problem. The document also details the steps for constructing a variational formulation, generating a mesh, and approximating solutions using shape functions.

Uploaded by

johnson
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views14 pages

Fem Engineering

The document discusses the finite element method (FEM), a numerical technique for solving complex physical problems, particularly those with non-linearities. It covers the weak formulation, mathematical equivalences, and the application of FEM in a one-dimensional boundary value problem. The document also details the steps for constructing a variational formulation, generating a mesh, and approximating solutions using shape functions.

Uploaded by

johnson
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Finite Element Method

H. Kasumba

October 6, 2021

1 Introduction

The finite element method (FEM) is a numerical technique for solving a wide range of complex
physical phenomena, particularly those exhibiting geometrical and material non-linearities (such
as those that are often encountered in the physical and engineering sciences). These problems can
be structural in nature, thermal (or thermo-mechanical), electrical, magnetic, acoustic etc. plus
any combination of. It is used most frequently to tackle problems that aren’t readily amenable to
analytical treatments.

Figure 1:

Physical problems are governed by differential equations which satisfy Boundary conditions Initial
conditions

One variable: Ordinary differential equation (ODE) Multiple independent variables: Partial dif-
ferential equation (PDE)

1
Figure 2:

2 Weak Formulation and Mathematical equivalences

Consider the problem


−u′′ (x) = f (x), 0 < x < 1, u(0) = 0, u(1) = 0.
R1 R1
Set F (v) = 12 0 (v ′ )2 dx − 0 f v dx.

2.1 Minimization problem

The minimization problem is set as follows: Find u ∈ V such that


F (u) ≤ F (v) for all v ∈ V
Note: If u represents the transverse displacement of a membrane, then F (u) is the total energy.

2.2 Variational formulation

Consider again the problem


−u′′ (x) = f (x)
We multiply this PDE with a test function ϕ and integrate

Z 1 Z 1
′′
(1) −u (x)ϕ(x) dx = f (x)ϕ(x) dx
0 0

2
Integrating by parts the left hand side of (1), we obtain
Z 1 Z 1
′ ′ ′ ′
−u (1)ϕ(1) + u (0)ϕ(0) + u (x)ϕ (x) dx = f (x)ϕ(x) dx
0 0

Next, we choose ϕ(x) such that it has compact support in [0, 1], i.e., ϕ(0) = ϕ(1) = 0. Then, the
variational formulation becomes
Z 1 Z 1
′ ′
(2) u (x)ϕ (x) dx = f (x)ϕ(x) dx
0 0

2.3 Mathematical Equivalences


1. If u is a solution to the strong formulation, then u is a solution to the variational formulation.

Proof. Integrate by parts the strong formulation.

2. If u is a solution to the variational formulation, then u solves the minimization problem.

Proof. Suppose u∗ satisfies the (VP) i.e.,


Z 1 Z 1

(3) ux ϕx dx = f (x)ϕ(x) dx for any ϕ ∈ V and ϕ(0) = ϕ(1) = 0
0 0

Then

F (u) = F (u∗u − u∗ )
Z 1 Z 1
1 ∗
= 2
[(u + w)x ] dx − f (u∗ + w) dx where w = u − u∗
0 2 0
1 1 ∗ 2
Z Z 1

= 2
(u ) + 2ux wx + (wx ) dx − (f u∗ + f w) dx
2 0 x 0
1 1 ∗ 2
Z 1 Z 1
1 1 2
Z Z
∗ ∗
= (u ) − f u dx + ux wx − f w dx + w dx
2 0 x 0 0 2 0 x
| {z } | {z }
=0 ≥0
1 1 2
Z

F (u) = F (u ) + w dx
2 0 x
| {z }
≥0
⇒ F (u∗ ) ≤ F (u) for all u ∈ V

Therefore, u∗ solves the minimization problem.

3. If u solves the minimization problem, then u solves the variational problem.

3
Proof. u solution to minimization problem implies that

F (u) ≤ F (u + ϵv), ϵ ∈ R, ∀v ∈ V.

The functional
1 1 1 1 1
ϵ2
Z Z Z Z Z
1 ′ 2 ′ ′ ′ 2
g(ϵ) := F (u + ϵv) = (u ) dx + ϵ u v dx + (v ) dx − f u dx − ϵ f v dx.
2 0 0 2 0 0 0

has a minimum at ϵ = 0, implying that g ′ (0) = 0. But


Z 1 Z 1 Z 1
′ ′ ′
g (ϵ) = u v dx − f v dx + ϵ (v ′ )2 dx
0 0 0
R1 R1
Hence, g ′ (0) = 0 implies g ′ (0) = 0
u′ v ′ dx − 0
f v dx = 0. Thus u solves the variational
problem.

3 The Finite Element Method: 1D Case

We illustrate the FE method for the 1D two-point BVP

−u′′ (x) = f (x), 0 < x < 1, u(0) = 0, u(1) = 0.

The steps to follow are as follows:

1. Construct a variational or weak formulation .


Z 1 Z 1
′ ′
u v dx = f v dx,
0 0

where v(x) is a test function satisfying the boundary conditions, i.e., v(0) = v(1) = 0.

Step 2: We generate a mesh: e.g. a uniform mesh.

ˆ Without loss of generality, let Ω = (0, 1).

ˆ Let τh := partition of Ω into N subintervals Ki = (xi−1 , xi ) of width hi = xi − xi−1 :

a = 0 < x1 < x2 < · · · < xn = 1.

ˆ The mesh will be called uniform if the points xi are equidistant, that is,
1
xi = ih, with h = , 0 ≤ i ≤ n.
n

4
ˆ The points xi are called vertices or nodes of the mesh.

3. We replace the Hilbert space V on which we pose the variational formulation by a subspace Vh
of finite dimension.

Motivation

Suppose the value of u(x) at nodes xi and xi+1 are known such that

u(xi ) = ui , u(xi+1 ) = ui+1

but the value of u(x) is unknown.

This value can be approximated by uh (x) and using interpolation, we have


ui+1 − ui uh (x) − ui
=
xi+1 − xi x − xi
Re-arranging, we obtain
   
x − xi xi+1 − x
uh (x) = ui+1 + ui
h h
= ui+1 ψi+1 (x) + ui ψi (x),

where  
xi+1 − x
ψi (x) = , ψi (xi ) = 1, ψi (xi+1 ) = 0.
h
Similarly,  
x − xi
ψi+1 (x) = , ψi+1 (xi ) = 0, ψi+1 (xi+1 ) = 1.
h

5
The above functions are known as shape functions. The union of 2 shape functions in neighboring
elements gives a global basis function at a node xi :
 x−x

 h
i−1
x ∈ (xi−1 , xi ),

xi+1 −x
(4) ϕi (x) = h
x ∈ (xi , xi+1 ),


0 otherwise

Note: Supp(ϕi (x)) = Ki ∪ Ki+1 and belong to the set

ˆ Vh = {vh ∈ C([0, 1]) : vh |Kj ∈ P1 , for all Kj ∈ τh , vh (0) = vh (1) = 0}.


ˆ Here, P1 is the space of polynomials of degree ≤ 1.
ˆ Vh1 =continuous, piecewise linear functionals.
ˆ dim(Vh1 ) = N .

step 4: Representation of approximate solution in terms of the basis functions.


Lemma 3.1. The space Vh1 is a subspace of V = H01 (0, 1) and every function uh (x) is defined
uniquely by its values at the vertices (xi )1≤i≤n−1 :
n−1
X
uh (x) = u(xi )ϕi (x), for all x ∈ [0, 1].
i=1

6
ˆ On assuming the hat basis functions, obviously uh (x) is also a piecewise linear function,
although this is not usually the case for the true solution u(x).

ˆ Next substitute the approximate solution


n−1
X
uh (x) = ui ϕi (x)
i=1

for the exact solution u(x) in the weak form


Z 1 Z 1
′ ′
u v dx = f v dx,
0 0

i.e.,
Z 1 Z 1
(5) u′h v ′ dx = f v dx,
0 0
Z n−1
1X Z 1
(6) ⇒ ui ϕ′i v ′ dx = f v dx
0 i=1 0
n−1
X Z 1 Z 1
(7) ⇒ ui ϕ′i v ′ dx = f v dx
i=1 0 0

Now the test function v(x) is chosen to be ϕ1 , ϕ2 , · · · , ϕn−1 successively, to get the system of linear
equations (noting that further errors are introduced).

AU = F,

where  
a(ϕ1 , ϕ1 ) a(ϕ1 , ϕ2 ) ··· a(ϕ1 , ϕn−1 )
 a(ϕ2 , ϕ1 ) a(ϕ2 , ϕ2 ) ··· a(ϕ2 , ϕn−1 ) 
A=
 
.. .. .. .. 
 . . . . 
a(ϕn−1 , ϕ1 ) a(ϕn−1 , ϕ2 ) · · · a(ϕn−1 , ϕn−1 )
   
U1 (f, ϕ1 )
Z 1
 U2   (f, ϕ2 ) 
U = ..  , F =   , a(ϕi , ϕj ) = ϕ′i ϕ′j dx.
   
..
 .   .  0
Un−1 (f, ϕn−1 )
Example 3.1. Consider the two point boundary value problem

(P) −u′′ (x) = 1, 0 < x < 1


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

(a) Derive the variational formulation of (P). (03 marks)

7
(b) Divide the interval (0,1) into 3 subintervals of equal length h = 13 and let Vh be the corre-
sponding space of continuous piecewise linear functions vanishing as x = 0 and x = 1.

(i) Use Vh to formulate a finite element method for (P).


(ii) Verify that the stiffness matrix A and the load vector b are given by
   
2 −1 1 1
A=3 , b=
−1 2 3 1

(iii) Discuss the solvability of the system

Ax = b,

where A and b are defined as above.

Solution
Let V := {ϕ ∈ H 1 (0, 1) | ϕ(0) = 0, ϕ(1) = 0}.

(a) Variational formulation


Z 1 Z 1
′ ′
u (x)v(x) dx = v(x) dx + [u′ (x)v(x)]10
Z0 1 Z0 1
⇒ u′ (x)v(x)′ dx = v(x) dx + u′ (1)v(1) − u′ (0)v(0)
Z0 1 Z0 1
⇒ u′ (x)v(x)′ dx = v(x) dx.
0 0

(b) Let ϕi ∈ Vh ⊂ V, i = 1, 2 such that ϕi (xj ) = 1 if i = j and ϕi (xj ) = 0 if i ̸= j. Then we can


express uh as
X2
uh (x) = ui ϕi (x)
i=1

where
 
 3x x ∈ (0, 1/3),  3x − 1 x ∈ (1/3, 2/3),
(8) ϕ1 (x) = 2 − 3x x ∈ (1/3, 2/3), ϕ2 (x) = 3 − 3x x ∈ (2/3, 1),
0 otherwise 0 otherwise
 

and the variational form becomes


X Z 1 Z 1
ui ϕ′i (x)v(x)′ dx = v(x) dx,
Z 1 Z 01 0
Z 1
⇒ u1 ϕ′1 (x)v(x)′ dx + u2 ϕ′2 (x)v(x)′ dx = v(x) dx.
0 0 0

8
Note
supp(ϕ1 ) = (0, 2/3)
supp(ϕ2 ) = (1/3, 1)
supp(ϕ1 ∩ ϕ2 ) = (1/3, 2/3)

 
 3 x ∈ (0, 1/3),  3 x ∈ (1/3, 2/3),
(9) ϕ′1 (x) = −3 x ∈ (1/3, 2/3), ϕ′2 (x) = −3 x ∈ (2/3, 1),
0 otherwise 0 otherwise
 

Choose v(x) = ϕ1 (x). Then


"Z # "Z #
1/3 Z 2/3 2/3 Z 1
u1 9 dx + 9 dx − u2 9 dx = ϕ1 (x) dx.
0 1/3 1/3 0

1
(10) 6u1 − 3u2 =
3
Next, choose v(x) = ϕ2 (x). Then
"Z # "Z #
2/3 2/3 Z 1 Z 1
−u1 9 dx + u2 9 dx + 9 dx = ϕ2 (x) dx.
1/3 1/3 2/3 0

1
(11) −3u1 + 6u2 = .
3
Collecting the above results, we find
   
2 −1 1 1
A=3 , b=
−1 2 3 1
Since     
1 20 −11 −9 −11 693
Det(A) = 16det + 9det = ̸= 0
2 −11 11 0 11 2
Matrix A is invertible and the linear system

Ax = b,

is uniquely solvable.
Example 3.2. Consider the two point boundary value problem

(P) −((1 + x)u′ )′ = 1, 0 < x < 1


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

9
(a) Derive the variational formulation of (P). (03 marks)
(b) Divide the interval (0,1) into 3 subintervals of equal length h = 31 and let Vh be the corre-
sponding space of continuous piecewise linear functions vanishing as x = 0.
(i) Use Vh to formulate a finite element method for (P). (04 marks)
(ii) Verify that the stiffness matrix A and the load vector b are given by
   
16 −9 0 1
1 1
A =  −9 20 −11  , b =  1  .
2 3
0 −11 11 7
(15 marks)

Let V := {ϕ ∈ H 1 (0, 1) | ϕ(0) = 0}.

(a) Variational formulation


Z 1 Z 1
′ ′
((1 + x)u (x)v(x) dx = v(x) dx + [(1 + x)u′ (x)v(x)]10
Z0 1 Z0 1
⇒ ((1 + x)u′ (x)v(x)′ dx = v(x) dx + 2u′ (1)v(1) − 2u′ (0)v(0)
Z0 1 Z0 1
⇒ ((1 + x)u′ (x)v(x)′ dx = v(x) dx + 2v(1).
0 0

(b) Let ϕi ∈ Vh ⊂ V, i = 1, 2, 3 such that ϕi (xj ) = 1 if i = j and ϕi (xj ) = 0 if i ̸= j. Then we


can express uh as
Xn
uh (x) = ui ϕi (x)
i=1
and the variational form becomes
X Z 1 Z 1
′ ′
ui (1 + x)ϕi (x)v(x) dx = v(x) dx + 2v(1),
0 0
Z 1 Z 1
′ ′
⇒ u1 (1 + x)ϕ1 (x)v(x) dx + u2 (1 + x)ϕ′2 (x)v(x)′ dx
0 0
Z 1 Z 1
′ ′
+u3 (1 + x)ϕ3 (x)v(x) dx = v(x) dx + 2v(1).
0 0

Note supp(ϕ1 ) = (0, 2/3),supp(ϕ2 ) = (1/3, 1),supp(ϕ3 ) = (2/3, 1) supp(ϕ1 ∩ϕ2 ) = (1/3, 2/3),
supp(ϕ2 ∩ ϕ3 ) = (2/3, 1).
 
 3 x ∈ (0, 1/3),  3 x ∈ (1/3, 2/3),
(12) ϕ′1 (x) = −3 x ∈ (1/3, 2/3), ϕ′2 (x) = −3 x ∈ (2/3, 1),
0 otherwise 0 otherwise
 

3 x ∈ (2/1, 1),
(13) ϕ′3 (x) =
0 otherwise

10
Since v ∈ Vh , choose v(x) = ϕ1 (x). Then
"Z # "Z #
1/3 Z 2/3 2/3
u1 (1 + x)9 dx + (1 + x)9 dx − u2 (1 + x)9 dx + u3 · 0 =
0 1/3 1/3
Z 1
ϕ1 (x) dx + 2ϕ1 (1).
0

Since ϕ1 (1) = 0, we have


9 1
(14) 8u1 − u2 + u3 · 0 =
2 3
Next, choose v(x) = ϕ2 (x). Then
"Z # "Z #
2/3 2/3 Z 1 Z 1
−u1 (1 + x)9 dx − u2 (1 + x)9 dx + (1 + x)9 dx − u3 (1 + x)9 dx =
1/3 1/3 2/3 2/3
Z 1
ϕ2 (x) dx + 2ϕ2 (1).
0

Since ϕ2 (1) = 0, we have


9 11 1
(15) − u1 + 10u2 − u3 = .
2 2 3
Finally, set v(x) = ϕ3 (x). Then
Z 1 Z 1
u1 · 0 − u2 (1 + x)9 dx + u3 (1 + x)9 dx =
2/3 2/3
Z 1
ϕ3 (x) dx + 2ϕ3 (1).
0

Since ϕ3 (1) = 1, we have


11 11 1
(16) 0 · u1 − u2 + u3 = + 2.
2 2 3
Collecting the above results, we find
  
16 −9 0 1
1 1
A =  −9 20 −11  , b=  1 
2 3
0 −11 11 7

11
4 Implementation of FEM

weak formulation . Z 1 Z 1
′ ′
u v dx = f v dx,
0 0
Discretization
n−1
X Z 1 Z 1
(17) ui ϕ′i ϕ′j dx = f ϕj dx
i=1 0 0

Note: Z 1 Nk Z
X
ϕ′i ϕ′j dx = ϕ′i ϕ′j dx
0 k=1 ek

In element ek we have two local basis functions ϕi and ϕi+1

Figure 3:

given by
xi+1 − x 1
ϕi (x) = , ϕi (x)′ = −
h h
x − xi 1
ϕi+1 (x) = , ϕi+1 (x)′ =
h h
The local stiffness matrix is given by
" R xi+1 ′ 2 R xi+1 ′ ′ #
x i
(ϕ i ) dx x i
ϕi ϕi+1 dx
(18) Kie = R xi+1 R xi+1 ′ 2
′ ′
ϕi ϕi+1 dx xi (ϕi+1 ) dx
" x1i
− h1
#
h
(19) =
− h1 h1
Local load vector.
Assume f = 1, then
" R xi+1 #
xi
ϕi dx
(20) Fie = R xi+1
xi
ϕi+1 dx
h
" #
2
(21) =
h
2

12
4.1 Implementation of the sum

Consider the case of 3 sub-intervals.

4.1.1 Global Stiffness Matrix

Define an empty global stiffness matrix S of size 4 × 4.


 
0 0 0 0
 0 0 0 0 
S=  0 0 0 0


0 0 0 0

In element 1
S([1, 2], [1, 2]) = S([1, 2], [1, 2]) + K1e
 
1 −1 0 0
1  −1 1 0 0 
S=  
h 0 0 0 0 
0 0 0 0
In element 2
S([2, 3], [2, 3]) = S([2, 3], [2, 3]) + K2e
The global stiffness matrix becomes
 
1 −1 0 0
1  −1 2 −1 0 
S=  
h  0 −1 1 0 
0 0 0 0

In element 3
S([3, 4], [3, 4]) = S([3, 4], [3, 4]) + K3e
The global stiffness matrix becomes
 
1 −1 0 0
1  −1 2 −1 0 
S=  
h  0 −1 2 −1 
0 0 −1 1

13
4.1.2 Global Load Vector

Assume f = 1, then
h
" #
2
(22) Fie =
h
2

Then        
0 1 1 1
 0  h 1  h  1+1
⇒ h 2 
  
 0 ⇒ 2
F =   ⇒ 
0  2 1  2 1+1 

0 0 0 1
The entire system reads
    
1 −1 0 0 u1 1
1 −1 2 −1 0   u2

 1 2 
=  
h  0 −1 2 −1   u3  h 2 
0 0 −1 1 u4 1

Since, u1 = u4 = 0, we re-modify the above system to obtain


    
1 0 0 0 u1 0
1
 −1 2 −1 0 

 u2 
= h  2 

h  0 −1 2 −1   u3  2  2 
0 0 0 1 u4 0

14

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy