Sunteți pe pagina 1din 39

Advanced

Mathematics

Diego Mendoza,
PhD.

Introduction

FEM 1D
Advanced Mathematics formulation

Finite Element Method

Diego Mendoza, PhD.1

1 Programof Master in Mechanical Engineering


Universidad Autónoma del Caribe

May 1, 2017
Advanced
Outline Mathematics

Diego Mendoza,
PhD.

Introduction

FEM 1D
formulation

Introduction

FEM 1D formulation
Advanced
What is the finite element method? Mathematics

Diego Mendoza,
The finite element method (FEM) is a numerical technique PhD.
for solving problems described by partial differential
Introduction
equations.
FEM 1D
formulation
Advanced
Mathematics

Diego Mendoza,
PhD.
A domain of interest is represented by an assembly of finite
elements. A continuous physical problem is transformed into Introduction

a discretized finite element problem with unknown nodal FEM 1D


formulation
values.
Advanced
How does FEM work? Mathematics

Diego Mendoza,
PhD.

Introduction
The main steps in the FEM are:
FEM 1D
1. Discretize the continuum: Divide a solution region into formulation

finite elements.
2. Select interpolation functions: Interpolation functions
are used to interpolate the filed variables over the
element.
3. Find the elemen properties: The matrix equation for the
finite element should be stablished.
4. Assemble the element equations. To Find the global
equation system for the whole solution region we must
assemble all the element equations.
5. Solve the global equation system.
Advanced
Mathematics

Diego Mendoza,
PhD.

Introduction
Suppose we need to solve numerically the following BVP FEM 1D
formulation

uxx + f (x ) = 0 (0 < x < 1)

subject to the boundary conditions

u (1) = q, − ux ( 0 ) = h

where: f (x ) is a smooth scalar function defined on the unit


interval [0, 1], and q, h are given constants. subject to the
boundary conditions
Advanced
Strong, or classical, form of the problem Mathematics

Diego Mendoza,
A boundary-value problem for PhD.

uxx + f (x ) = 0 on Ω Introduction

FEM 1D
formulation
involves imposing boundary conditions on the function u. There
are many possibilities, a set of them are

u (1) = g , − ux ( 0 ) = h

where g and h are given constants.

The strong form of the BVP is stated as follows: Given


f : Ω̄ → < and constants g and h, find u : Ω̄ → < such
that
uxx + f (x ) = 0 on Ω
subject to:
u (1) = g , − ux ( 0 ) = h
Finite-difference method works directly on the strong form.
Advanced
Weak, or variational, form of the problem Mathematics

Diego Mendoza,
PhD.
FEM works with the weak form of the problem. To
define the weak form we need to characterize two classes of Introduction

functions. FEM 1D
formulation

1. Candidate, or trial, solutions: We shall require these


possible solutions to satisfy the boundary condition
u (1) = g . The other boundary will not required in the
definition. Besides, the derivatives of the trial solution
must be square integrable (H 1 -functions), that is, if u
is a trial solution, then
Z 1
ux2 dx < ∞
0

The collection of trial solutions are denoted by S

S = {u |u ∈ H 1 , u (1) = q }
Advanced
Mathematics

Diego Mendoza,
PhD.

2 Weighting functions, or variations: These functions Introduction


satisfy w (1) = 0. FEM 1D
The weighting-function set W is formulation

W = {w |w ∈ H 1 , w (1) = 0}

The variational problem can be stated as: Given f ,


g , h, as in the original problem. Find u ∈ S , such
that for all w ∈ W
Z 1 Z 1
wx ux dx = w f dx + w (0)h
0 0
Advanced
Equivalence between strong and weak forms Mathematics

Diego Mendoza,
PhD.

Introduction

FEM 1D
formulation
Proposition
a Let u be a solution of the strong problem, then u
is also a solution of the weak problem
b Let u be a solution of the weak problem, then u
is a solution of the strong problem.
Thus, by (a) and (b), the strong and weak solutions
are one and the same, consequently the weak and
strong formulations are equivalent.
Advanced
Proof Mathematics

Diego Mendoza,
Let us prove the part (a) of the proposition. Since u is PhD.

assumed to be a solution of the strong problem, we may Introduction

write FEM 1D
Z 1 formulation
− w (uxx + f )dx = 0
0
for any w ∈ W . Further development
Z 1 Z 1
− wuxx dx − fdx = 0
0 0

Now we integrate by parts the first LHS term

A=w dBR = uxx dx


dA = wx dx B = uxx dx = ux
so, Z 1 Z 1 Z 1
− wuxx dx = − d (wux ) + ux wx dx
0 0 0
Advanced
Mathematics

Z 1 Z 1 Diego Mendoza,
1 PhD.
− wuxx dx = − (wux )|0 + ux wx dx
0 0 Introduction
Z 1 Z 1
FEM 1D
− wuxx dx = w (0)ux (0) − w (1)ux (1) + ux wx dx formulation
0 0

But w (1) = 0, therefore


Z 1 Z 1
− wuxx dx = w (0)ux (0) + ux wx dx
0 0

so, taking into account that −ux (0) = h

Z 1 Z 1 Z 1
− w (uxx + f )dx = −w (0)h + ux wx dx − fdx
0 0 0

that is the variational form of the strong formulation.


Advanced
Mathematics

Diego Mendoza,
PhD.

Notation Introduction

Now, we introduce a notation to simplify writing FEM 1D


formulation
Z 1
a(u, w ) = ux wx dx
0

Z 1
(w , f ) = wfdx
0

Then, the weak (variational) formulation reads:

a(u, w ) = (w , f ) + w (0)h
Advanced
Galerkin’s approxmation method Mathematics

Diego Mendoza,
PhD.

Introduction
This method aims to obtain approximte solutions to BVP FEM 1D
based upon weak formulations. formulation

The first step is to construct finite-dimensional


approximations of S and W . These functions are denoted
S h and W h , respectively.

Sh ⊂ S, (if u h ∈ S h , then u h ∈ S and u h (1) = g )

Wh⊂W, (if w h ∈ W h , then w h ∈ W and w h (1) = 0)


The superscript refers to the association of S h and W h
with a mesh (discretization), of the domain Ω, which is
parameterized by a characteristic length scale h.
Advanced
Mathematics

Diego Mendoza,
PhD.

Introduction

FEM 1D
formulation

The finite-variational problem using Galerkin’s ap-


proximation reads

a (w h , u h ) = (w h , f ) + w h (0)h
Advanced
Matrix equations Mathematics

Diego Mendoza,
PhD.

Let W h consist of all linear combinations of given functions Introduction

denoted by NA : Ω → <, where A = 1, . . . , n. Therefore, FEM 1D


formulation
there exists constants cA , A = 1, . . . , n such that
n
wh = ∑ c A NA
A=1
= c1 N1 + · · · + cn Nn

The NA ’s are referred to as shape, basis or interpolation


functions. We require that each NA satisfies

NA (1) = 0, A = 1, . . . , n

so that w (1) = 0 as required.


Now, we suppose a solution of type Advanced
Mathematics

n Diego Mendoza,

uh = ∑ dA NA + Nn+1 g
PhD.

A=1 Introduction

FEM 1D
where Nn+1 (1) = 1, and dA ’s are constants. This solution formulation

fulfills the requirement u h (1) = g .

Substitution of u h on the Galerkin’s approximation

a (w h , u h ) = (w h , f ) + w h (0)h

yields
!
n n
a ∑ cA NA , ∑ dA NA =
A=1 B =1
!
n
(w h , f ) + w h (0)h − a ∑ cA NA , gNn+1
A=1
Advanced
Further development of these terms Mathematics

Diego Mendoza,
n PhD.

∑ cA GA = 0 Introduction
A=1
FEM 1D
formulation
where

GA = a (NA , NB ) dB − (NA , f ) − NA (0)h + a (NA , Nn+1 ) g

Galerkin equation is to hold for all w h ∈ W , that is for all


cA ’s, A = 1, 2, . . . , n. So each GA , A = 1, 2, . . . , n, must be
identically zero, or

a (NA , NB ) dB = (NA , f ) + NA (0)h − a (NA , Nn+1 ) g

Everything is known in this equation, except dB ’s. This


equation set has n unknowns in n equations.
Advanced
Mathematics

Diego Mendoza,
PhD.
The equation set can be written in concise form as follows:
let Introduction

FEM 1D
formulation
KAB = a(NA , NB )
F A = ( N A , f ) + NA ( 0 ) h − a ( NA , N n + 1 ) g

so GA becomes
n
∑ KAB dB = FA , A = 1, 2, . . . , n
B =1

The equation set generated by these equations are:

Kd = F
Advanced
Mathematics
where   Diego Mendoza,
K11 · · · K1n PhD.
 .. .. .. 
K= . . .  Introduction

Kn1 · · · Knn FEM 1D


formulation

is called the stiffness matrix,


 
d1
 .. 
d=.
dn

is the displacement vector, and


 
F1
F =  ... 
 

Fn

the force vector.


Advanced
Mathematics

Diego Mendoza,
PhD.

Introduction

FEM 1D
formulation
Once d is known, uh is obtained
n
u h (x ) = ∑ dA NA (x ) + gNn+1 (x )
A=1

The quality of this approximated solution depends on the


specific choice of NA ’s and the number n
Advanced
Piecewise linear finite element Mathematics

Diego Mendoza,
PhD.

Introduction

FEM 1D
formulation

We partition the domain [0, 1] into n nonoverlaping


subintervals. The typical subinterval is denoted by
[xA , xA+1 ], where xA < xA+1 and A = 1, 2, . . . , n. We also
require x1 = 0 and xn+1 = 1. The xA ’s are called nodal
points or nodes. The subintervals are sometimes referred to
as the finite element domain. Note that hA = xA+1 − xA are
not required to be equal.
The shape functions of internal nodes (2 ≤ A ≤ n) Advanced
Mathematics
 x −x
A−1
hA−1 , xA−1 ≤ x ≤ xA
 Diego Mendoza,

 PhD.



Introduction
NA (x ) = xA+h1 −x , xA ≤ x ≤ xA+1
 A FEM 1D

 formulation


0, elsewhere

Initial boundary node


x2 − x
N1 ( x ) =
h1
final boundary node
x − xn
Nn + 1 ( x ) =
hn

Piecewise linear finite element functions are the sim-


plest and most widely used finite element functions
for one-dimensional problems.
Advanced
Example Mathematics

Diego Mendoza,
PhD.

Introduction
Use Galerkin’s finite element to solve the following BVP FEM 1D
formulation

d 2u
=x 0<x <2
dx 2
with
u (0) = 0 u (2) = 0
First of all we need to transform this problem into its
variational form, that is the weighted residual of the ODE
Z 2  2 
d u
w − x dx = 0
0 dx 2
Advanced
Mathematics
we rewrite this expression as
Diego Mendoza,
PhD.
Z 2  2  Z 2
d u
w dx = wxdx Introduction
0 dx 2 0
FEM 1D
formulation
Now we focus on the LHS integral and solve it integrating by
parts

du 2
Z 2  2  Z 2  
d u du dw
w dx = w − dx
0 dx 2 dx 0 0 dx dx
Z 2    
du dw
=− dx
0 dx dx

The variational formulation of the problem becomes


Z 2   Z 2
du dw
− dx = wxdx
0 dx dx 0
Advanced
Mathematics
and the finite-variational problem using Galerkin’s approach Diego Mendoza,
PhD.
is
Introduction
Z 2 h
dw h
 Z 2
du FEM 1D
− dx = w h xdx formulation
0 dx dx 0

We divide the domain into four finite elements, n = 4. This


four finite elements have 5 nodes, where x1 = 0 and x5 = 2.

Next, we suppose weighting an solution functions of the form


4
u h (x ) = ∑ dA NA + 0 ∗ Nn+1
A=1
4
w h (x ) = ∑ cA NA
A=1
Advanced
Mathematics
and replace it into the variational problem
Diego Mendoza,
PhD.
4
du h dNB
dx
= ∑ dB dx
Introduction
B =1 FEM 1D
formulation
4
wh dNA
dx
= ∑ cA dx
A=1

The product of the derivatives of u h and w h is

du h dw h
  
=
dx dx
4 4
dN1 dNB dN2 dNB
c1
dx ∑ dB dx
+ c2
dx ∑ dB dx
+
B =1 B =1
4 4
dN3 dNB dN4 dNB
c3
dx ∑ dB
dx
+ c4
dx ∑ dB dx
B =1 B =1
Advanced
and Mathematics

w h x = c1 N1 x + c2 N2 x + c3 N3 x + c4 N4 x Diego Mendoza,
PhD.

The finite variational problem becomes Introduction

Z 2      FEM 1D
du dw formulation
+ wx dx =
0 dx dx
" #
dN1 4
Z 2
dNB
dx B∑
c1 dB + N1 x dx +
0 =1 dx
" #
dN2 4
Z 2
dNB
dx B∑
c2 dB + N2 x dx +
0 =1 dx
" #
dN3 4
Z 2
dNB
dx B∑
c3 dB + N3 x dx +
0 =1 dx
" #
dN4 4
Z 2
dNB
dx B∑
c4 dB + N1 x dx = 0
0 =1 dx
Advanced
Mathematics

Diego Mendoza,
c1 , c2 , c3 , c4 are arbitrary (possitive) constants, then PhD.

Introduction
" #
dN1 4
Z 2
dNB
dx B∑
dB + N1 x dx = 0 FEM 1D
0 =1 dx formulation

" #
dN2 4
Z 2
dNB
dx B∑
dB + N2 x dx = 0
0 =1 dx
" #
dN3 4
Z 2
dNB
dx B∑
dB + N3 x dx = 0
0 =1 dx
" #
dN4 4
Z 2
dNB
dx B∑
dB + N1 x dx = 0
0 =1 dx

So we get four equations and four unknowns (dB ’s) provided


N’s are known.
Advanced
Mathematics
Now we develop the first equation
Diego Mendoza,
" # PhD.

dN1 4
Z 2 Z 2
dNB dN1 dN1
0 dx ∑ d B
dx
+ N 1 x dx = d1
0 dx dx
dx Introduction

B =1 FEM 1D
Z 2 Z 2 Z 2 formulation
dN1 dN2 dN1 dN3 dN1 dN4
d2 dx + d3 dx + d4 dx +
0 dx dx 0 dx dx 0 dx dx
Z 2
N1 xdx = 0
0
or
k11 d1 + k12 d2 + k13 d3 + k14 d4 = F1
where
Z 2 Z 2
dNA dNB
kAB = kBA = dx and F1 = − N1 xdx
0 dx dx 0

The other three equations can be developed in similar


fashion.
Advanced
Mathematics

Diego Mendoza,
PhD.

Introduction

FEM 1D
The equation set of the Galerkin’s formulation becomes formulation

    
k11 k12 k13 k14 d1 F1
k21 k22 k23 k24   d2   F 2 
   =  
k31 k32 k33 k34  d3  F3 
k41 k42 k43 k44 d4 F4

Now we require to provide the shape function. In this case


we use a piecewise linear function.
Advanced
Mathematics

Diego Mendoza,
PhD.

Introduction

FEM 1D
formulation
The shape functions of internal nodes (2 ≤ A ≤ 4) Advanced
Mathematics
 x −x Diego Mendoza,
A−1
hA−1 , xA−1 ≤ x ≤ xA
 PhD.



Introduction


NA (x ) = xA+h1 −x , xA ≤ x ≤ xA+1 FEM 1D
 A formulation




0, elsewhere

Initial boundary node


 x2 −x
 h1 , x1 ≤ x ≤ x2
N1 ( x ) =
0, elsewhere

final boundary node


 x − x4
 h4 , x4 ≤ x ≤ x5
N5 ( x ) =
0, elsewhere

The derivatives of the shape functions correspond to: Advanced
Mathematics
nodes (2 ≤ A ≤ 4)
Diego Mendoza,
 PhD.
1
hA−1 , xA−1 ≤ x ≤ xA

Introduction




dNA 
−1
FEM 1D
= hA , xA ≤ x ≤ xA+1 formulation
dx 




 0, elsewhere

Initial boundary node


 −1
dN1  h1 , x1 ≤ x ≤ x2
=
dx
0, elsewhere

final boundary node


1
dN5  h4 , x4 ≤ x ≤ x5
=
dx
0, elsewhere

Advanced
Mathematics

Diego Mendoza,
PhD.

Now, we compute the elements of the stiffness matrix Introduction

Z 2 Z x2 FEM 1D
dN1 dN1 1 1 1 1 formulation
k11 = dx = dx = 2 (x2 − x1 ) =
0 dx dx x1 h1 h1 h1 h 1
(1)2 (−1)2
Z 2 Z x2 Z x3
dN2 dN2 1 1
k22 = dx = dx + dx = +
0 dx dx x1 h12 x2 h22 h1 h2
(1)2 (−1)2
Z 2 Z x3 Z x4
dN3 dN3 1 1
k33 = dx = dx + dx = +
0 dx dx x2 h22 x3 h32 h2 h3
(1)2 (−1)2
Z 2 Z x4 Z x5
dN4 dN4 1 1
k44 = dx = dx + dx = +
0 dx dx x3 h32 x4 h42 h3 h4
Advanced
Mathematics

Diego Mendoza,
PhD.

Z 2 Z x2
dN1 dN1 −1 1 1 Introduction
k12 = k21 = dx = dx = − FEM 1D
0 dx dx x1 h1 h1 h1 formulation
Z 2
dN2 dN2
k13 = k31 = dx =0
0 dx dx
Z 2
dN3 dN3
k14 = k14 = dx =0
0 dx dx
Z 2 Z x3
dN4 dN4 −1 1 1
k23 = k32 = dx = dx = −
0 dx dx x2 h2 h2 h2
Z 2
dN4 dN4
k24 = k42 = dx =0
0 dx dx
Z 2 Z x4
dN4 dN4 −1 1 1
k34 = k43 = dx = dx = −
0 dx dx x3 h3 h3 h3
Advanced
Mathematics

Diego Mendoza,
PhD.

Introduction

FEM 1D
The stiffness matrix for the problem is: formulation

 1 1

h1 − h 1
0 0
 1 1 1

− h1 + − h12 0

h1 h2 
k=
   
1 1 1 1
 0 − h2 h2 + h3 − h3 

  
1 1 1
0 0 − h3 h3 + h4
Advanced
Mathematics

Diego Mendoza,
PhD.
Now, we compute the elements of force vector
Introduction
Z 2 Z x2 
x2 − x
 FEM 1D
F1 = − N1 xdx = − xdx formulation
0 x1 h1
Z 2 Z x2  Z x3 
x − x1 x3 − x
 
F2 = − N2 xdx = − xdx − xdx
0 x1h1 x2 h2
Z 2 Z x3 Z x4 
x − x2 x4 − x
  
F3 = − N3 xdx = − xdx − xdx
0 x2 h2 x3 h3
Z 2 Z x4  Z x5 
x − x3 x5 − x
 
F4 = − N4 xdx = − xdx − xdx
0 x3 h3 x4 h4
Advanced
Mathematics

Diego Mendoza,
PhD.

Introduction
 
x23 −x13 x 2 −x 2 FEM 1D
3h1 − x2 22h1 1 formulation
 
   
F1  3 3
− x2 −x1 + x x22 −x12 − x x32 −x22 + x33 −x23 

 F2   3h1 1 2h1 3 2h2 3h2 
F= = 
 F3   3 3

2 2 2 2 3 3

− x3 −x2 + x2 x3 −x2 − x4 x4 −x3 + x4 −x3 
F4

 3h1 2h2 2h3 3h2 
 
 3 3 
x −x x 2 −x 2 x 2 −x 2 3
x5 −x4 3
− 43h3 3 + x3 42h3 3 − x5 52h4 4 + 3h4

We locate the node values at: x1 = 0.0, x1 = 0.5, x1 = 1.0,


x1 = 1.5, x1 = 2.0

S-ar putea să vă placă și