You are on page 1of 18

Finite Element Methods

An Introduction using Variational Calculus

Pouya Bastani

. p.1/18
Outline
Introduction
History and Application
Overview of FEM
Variational Calculus
Finite Element Method
Implementation
Numerical Results

. p.2/18
Introduction
The finite element method (FEM) is a technique in finding approximate
solutions of partial differential equations
One approach is based one eliminating the differential equation
completely and work with a minimization problem
Advantages:
Flexibility with respect to boundary conditions and gemetries
It is easy to incorporate adequate spatial resolution by varying the
element size manually or adaptively
Issues:
Implementation is often tough
Works best for diffusion-dominated problems; criticized for its
inability to handle convection-dominated problems occurring, for
example in high-speed flows

. p.3/18
History and Application
Mid-1950s: Origin of the FEM based on variational techniques
Initially used for solving problems in aeronautical and civil engineering
Later generalized for a broader ranger of differential equations, with
applications in fluid mechanics and structural dynamics
Late 1960s: new formulation by the method of weighted residuals
Weighted residual method has the advantage that it can be applied when
there is no variational formulation for the problem

. p.4/18
Overview of FEM
In FEM, the domain of the problem is divided into smaller subregions
1D: lines, 2D: triangles or quadrilaterals, 3D: tetrahedra and prisms
Approximate the unknown function by a set of simple functions
Replace the original problem with an integral formulation
Weighted residual and variational methods

. p.5/18
Variational Calculus - 1D
The goal is to find a minimizing function u(x) for the functional
Z b
F (u) = f (x, u(x), u (x)) dx (1)
a

Thus, for all functions (x) we require that

d
F (u(x) + (x)) =0

(2)
d =0

Regarding (x) as a small variation about u(x), Taylor expansion gives

f (x, u + , u + ) f (x, u, u ) + fu (x, u, u ) + fu (x, u, u )

It follows that
Z b
F (u + ) = F (u) + fu (x, u, u ) + fu (x, u, u ) dx (3)
a

. p.6/18
Euler-Lagrange Equations
Applying condition (2) and integrating by parts gives
Z b
0 = fu (x, u, u ) + fu (x, u, u ) dx
a Z b 
b d
= fu + fu fu dx

x=a a dx

By the fundamental lemma of variational calculus,

d
fu = fu (4)
dx

fu (a, u(a), u (a))(a) = 0 fu (b, u(b), u (b))(b) = 0 (5)

In general, this results in a second order boundary value problem. If u(a) is

given, we require (a) = 0; otherwise, fu = 0 at x = a (similarly for x = b).

. p.7/18
Example
Deduce a BVP by minimizing the functional below with u(1) = 1
Z 3
F (u) = {(u )2 4u} dx + 12u(3)
1

Because u(1) is given, we require (1) = 0, but otherwise, (x) is arbitrary.


Z 3  Z 3
2
F (u + ) = F (u)
{2u + 4} dx 12(3) ( )2 dx
1 1

Condition (2) along with integration by parts gives


Z 3
(2u 4) dx + (12 2u (3))(3) = 0
1

Thus, we obtain
u = 2 u(1) = 1 u (3) = 6

. p.8/18
Weak Solution
A second order BVP can be transformed into a minimization problem
where only the first derivatives occur
This was due to integration by parts which transfered the derivative from
the minimizer u(x) to the variation (x).
Thus, in finding the solutions, we do not require the approximation u(x)
to be twice-differentiable.
In fact, in many simple application, u is only once-differentiable
FEM is based on this weak formulation of the BVP and discards with the
twice-differentiabiliy condition required by the strong form of the BVP.

. p.9/18
FEM in 2D
The techniques of minimization in 1D can be extended to 2D. For example, it
can be shown that if u(x, y) = g1 (x, y) for (x, y) 1 , then minimizing

ZZ  2
 Z  
a b u
F (u) = f = |u|2 + u2 + hu dA + g2 u + h ds
2 2 2 2

is equivalent to solving the following BVP:

(au) bu = h for (x, y) (6)

u = g1 for (x, y) 1 (7)

a
n u = g2 for (x, y) 2 (8)

where we assume the domain has boundary = 1 2 .

. p.10/18
Discritization
The domain is approximated by a finite set of triangles, on each of
which, the function u is replaced by a linear function determined by the
three values of u at the corners.
Integral over the domain splits into a sum of integrals over each triangle.
We seek an approximation of the form
m
X
(x, y) = cj j (x, y)
j=1

where 1 , . . . , m are linearly independent piecewise-linear polynomials


with weighting constants c1 , . . . cm . For a minimum to occur,

F
j = 1, . . . , n =0
cj

This leads to a set of equations which can be written as Ac = b


. p.11/18
Implementation
Online software written by Ed Bueler which uses Persson and Strangs
mesh generator. Solves the Poissons equation

u = f in , u = 0 on (9)

2D hat function as the approximating function


Bueler formulates the problem in terms of a reference triangle
R = {(1 , 2 ) : 1 + 2 1, 1 , 2 0} and computes all the integrals
by a change of variable from domain triangles to the reference triangle.

. p.12/18
Numerical Results
Solution of (9) on a circular domain of radius 1 with f (x, y) = 4
Average triangle side: h = 0.05

. p.13/18
Convergence Rate
Exact solution of (9) is u(x, y) = 1 x2 y 2 . Knowing approximate
h (xi , yj ), the error was computed as eh = ||
solutions, u uh u|| for
h = h0 , h0 , . . . , 12 h0 , where = 4/5 and h0 = 0.5. Line slope in loglog
plot 2.3, so the error is O(h2 ).

. p.14/18
Other boundaries

Outer circle of radius 2 and inner circle or radius 1


f (x, y) = x + y

. p.15/18
Outer circle or radius 2 and inner square of side 1
f (x, y) = x + y

. p.16/18
Solution of Poisson Equation

0.25

0.2

0.15

0.1

0.05

0.05

0.1

0.15

0.2

0.25

2
1
0
1.5 2
1 0.5 1
0.5 0
2 1.5 1
2
y
x

Outer square of side 2 and inner off-centered ellipse


f (x, y) = sin(x) cos(y)

. p.17/18
References
[1] E. Bueler. Poissons Equation by the FEM using a Matlab Mesh Generator,
Math 692 Seminar in Finite Elements. 2004
[2] P. Persson, G. Strang. A Simple Mesh Generator in Matlab, SIAM Review,
Volume 46 (2), pp. 329-345, June 2004
[3] A. Stahel. Calculus of Variations and Finite Elements, 2005
[4] R.L. Burden, J.D. Faires. Numerical Analysis, Thomson Brooks/Cole, 2005.
[5] R.E. Lewis, J.P. Ward. The Finite Element Method: principles and applications,
Addison-Wesley, 1991.
[6] C. Pozrikidis. Introduction to Finite and Spectral Element Methods using
Matlab, Chapman & Hall/CRC, 2005.
[7] G.A. Hansen, Rod W. Douglass, A. Zardecki. Mesh Enhancement: selected
elliptic0 methods, Foundations and applications, Imperial College Press, 2005

. p.18/18

You might also like