Você está na página 1de 25

The Finite Element Method

Stiness Matrix, and Load Vector


Error Estimation
FEM for Partial Dierential Equations
Numerical Solutions to Dierential Equations
Lecture Notes #24
The Finite Element Method Numerics
Peter Blomgren,
blomgren.peter@gmail.com
Department of Mathematics and Statistics
Dynamical Systems Group
Computational Sciences Research Center
San Diego State University
San Diego, CA 92182-7720
http://terminus.sdsu.edu/
Spring 2011
Peter Blomgren, blomgren.peter@gmail.com FEM Numerics (1/24)
The Finite Element Method
Stiness Matrix, and Load Vector
Error Estimation
FEM for Partial Dierential Equations
Outline
1
The Finite Element Method
Recap
Looking for Solutions...
2
Stiness Matrix, and Load Vector
Identifying a Linear System...
Properties of the Stiness Matrix
3
Error Estimation
Building the Toolbox
Error Control
4
FEM for Partial Dierential Equations
Initial Example: The Poisson Equation
Analytical Tools: Vector Calculus
Variational Formulation
Minimization Formulation
The Road Ahead...
Peter Blomgren, blomgren.peter@gmail.com FEM Numerics (2/24)
The Finite Element Method
Stiness Matrix, and Load Vector
Error Estimation
FEM for Partial Dierential Equations
Recap
Looking for Solutions...
Quick Recap I/III
Last time we formulated the Galerkin (variational, (V
h
)) and Ritz
(minimization, (M
h
)) methods which will give us the nite element
solutions to the dierential equation (D):
u

= f , + Dirichlet Boundary Conditions.


The Function Space V
h
: Given the basis functions
i
(the tent
functions) we can write
V
h
=

v : v =
N

i =1

i
(x)

.
Peter Blomgren, blomgren.peter@gmail.com FEM Numerics (3/24)
The Finite Element Method
Stiness Matrix, and Load Vector
Error Estimation
FEM for Partial Dierential Equations
Recap
Looking for Solutions...
Quick Recap II/III
Inner Products: We dened the two (for now identical) inner
products:
a(u, v) =

I
uv dx, (u, v) =

I
uv dx.
Further, we dened the energy functional:
F(u) =
1
2
a(v

, v

) (f , v).
Given these denitions we formulated the Galerkin and Ritz
problems...
Peter Blomgren, blomgren.peter@gmail.com FEM Numerics (4/24)
The Finite Element Method
Stiness Matrix, and Load Vector
Error Estimation
FEM for Partial Dierential Equations
Recap
Looking for Solutions...
Quick Recap III/III
Galerkins Method (Variational Approach)
(V
h
) Find u
h
V
h
so that a(u

h
, v

h
) = (f , v
h
) v
h
V
h
.
Ritz Method (Minimization Approach)
(M
h
) Find u
h
V
h
so that F(u
h
) F(v
h
) v
h
V
h
.
Peter Blomgren, blomgren.peter@gmail.com FEM Numerics (5/24)
The Finite Element Method
Stiness Matrix, and Load Vector
Error Estimation
FEM for Partial Dierential Equations
Recap
Looking for Solutions...
Looking for the Solution...
If u
h
V
h
is a solution to (V
h
), then in particular
a(u

h
,

j
) = (f ,
j
), j = 1, 2, . . . , N.
Also, we can write u
h
in terms of the basis functions:
u
h
(x) =
N

j =1

j
(x),
j
= u
h
(x
j
).
Therefore we can rewrite the above equation
N

i =1

i
a(

i
,

j
) = (f ,
j
), j = 1, 2, . . . , N.
Peter Blomgren, blomgren.peter@gmail.com FEM Numerics (6/24)
The Finite Element Method
Stiness Matrix, and Load Vector
Error Estimation
FEM for Partial Dierential Equations
Identifying a Linear System...
Properties of the Stiness Matrix
The Stiness Matrix and Load Vector
From
N

i =1

i
a(

i
,

j
) = (f ,
j
), j = 1, 2, . . . , N,
we identify the vectors

= {
1
,
2
, . . . ,
N
}
T
, and

b = {b
1
, b
2
, . . . , b
N
}
T
, where b
i
= (f ,
i
), and the matrix A,
where A
ij
= a(

i
,

j
).
We can now write our problem as
A

=

b.
For historical reasons (Structural Mechanics) A is known as the
stiness matrix, and

b as the load vector.
Peter Blomgren, blomgren.peter@gmail.com FEM Numerics (7/24)
The Finite Element Method
Stiness Matrix, and Load Vector
Error Estimation
FEM for Partial Dierential Equations
Identifying a Linear System...
Properties of the Stiness Matrix
Computing the Stiness Matrix
The elements of the stiness matrix can be computed:
First we notice that if the basis is the piecewise linear
tent-functions, then if |i j | > 1, then
i
and
j
are
non-overlapping which means a(

i
,

j
) = 0.
The Diagonal Entries, j = 1, 2, . . . , N.
a(

j
,

j
) =

x
j
x
j 1
1
h
2
j
dx +

x
j +1
x
j
1
h
2
j +1
dx =
1
h
j
+
1
h
j +1
.
The Super- and Sub-Diagonal Entries, j = 2, 3, . . . , N.
a(

j 1
,

j
) = a(

j
,

j 1
) =

x
j
x
j 1
1
h
j
1
h
j
dx =
1
h
j
.
Peter Blomgren, blomgren.peter@gmail.com FEM Numerics (8/24)
The Finite Element Method
Stiness Matrix, and Load Vector
Error Estimation
FEM for Partial Dierential Equations
Identifying a Linear System...
Properties of the Stiness Matrix
Illustration: Overlapping and Nonoverlapping Tent-Functions
0 1 2 3 4 5
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
0 1 2 3 4 5
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Peter Blomgren, blomgren.peter@gmail.com FEM Numerics (9/24)
The Finite Element Method
Stiness Matrix, and Load Vector
Error Estimation
FEM for Partial Dierential Equations
Identifying a Linear System...
Properties of the Stiness Matrix
The Stiness Matrix is Symmetric Positive Denite (SPD)
A is symmetric since a(u, v) = a(v, u), and with
v(x) =

N
i =1

j

i
(x) we get
N

i ,j =1

i
a(

i
,

j
)
j
= a

i =1

i
,
N

j =1

I
[v

h
(x)]
2
dx 0
Equality holds if and only if v

(x) 0, which implies v(x) 0 by


the boundary conditions.
Fact: A matrix A is SPD if
x
T
Ax > 0, x R
n
\{0}
Fact: An SPD matrix (i) has positive eigenvalues, (ii) is non-
singular.
Peter Blomgren, blomgren.peter@gmail.com FEM Numerics (10/24)
The Finite Element Method
Stiness Matrix, and Load Vector
Error Estimation
FEM for Partial Dierential Equations
Identifying a Linear System...
Properties of the Stiness Matrix
The Special Case h
j
= h, j = 1, 2, . . . , N
If we equi-partition the interval we get the linear system
1
h

2 1 0 . . . . . . 0
1 2 1
.
.
.
.
.
.
0
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
0
.
.
.
.
.
.
1 2 1
0 . . . . . . 0 1 2

b
1
b
2
.
.
.
.
.
.
.
.
.
b
N

If we divide by h the we recover the standard nite dierence method


for the problem, where the right hand-side
b
j
h
=
1
h

x
j +1
x
j 1
f (x)
j
dx
is a weighted mean of f (x) over the interval [x
j 1
, x
j +1
].
Peter Blomgren, blomgren.peter@gmail.com FEM Numerics (11/24)
The Finite Element Method
Stiness Matrix, and Load Vector
Error Estimation
FEM for Partial Dierential Equations
Building the Toolbox
Error Control
Estimating the Error for the Model Problem
We are now going to look at the error (u u
h
) where u is the
exact solution of the dierential equation, and u
h
is the solution to
the nite element problem (V
h
).
Since V
h
V,
a(u

, v

h
) = (f , v
h
), v
h
V
h
a(u

h
, v

h
) = (f , v
h
), v
h
V
h
a((u u
h
)

, v

h
) = 0, v
h
V
h
That means that the error is orthogonal to the function space V
h
(as measured by a(

).)
Peter Blomgren, blomgren.peter@gmail.com FEM Numerics (12/24)
The Finite Element Method
Stiness Matrix, and Load Vector
Error Estimation
FEM for Partial Dierential Equations
Building the Toolbox
Error Control
Denition and Tools
Denition (The L
2
-norm (L
2,a
?))
w
2
=

a(w, w) =

1
0
w
2
dx
Theorem (Cauchys Inequality)
|a(v, w)| vw
Peter Blomgren, blomgren.peter@gmail.com FEM Numerics (13/24)
The Finite Element Method
Stiness Matrix, and Load Vector
Error Estimation
FEM for Partial Dierential Equations
Building the Toolbox
Error Control
Cauchys Inequality: Proof
Cauchys Inequality.
Given v and w, dene the renormalized functions v =
v
v
and w =
w
w
.
Which means v = w = 1. Now
0 v w
2
= a( v w, v w)
= a( v, v) 2a( v, w) + a( w, w)
= 2 2a( v, w).
Hence,
|a( v, w)| 1.
Removing the linear normalization factors give
|a(v, w)| vw.
Peter Blomgren, blomgren.peter@gmail.com FEM Numerics (14/24)
The Finite Element Method
Stiness Matrix, and Load Vector
Error Estimation
FEM for Partial Dierential Equations
Building the Toolbox
Error Control
Error Control Theorem
Theorem
For any v
h
V
h
we have
(u u
h
)

(u v
h
)

.
So, measured in the L
2
-norm of the derivative (also known as the
H
1
-seminorm), the solution u
h
to the discrete problem is closer to
the solution u to the original continuous ODE than any other
function in the function space V
h
.
Peter Blomgren, blomgren.peter@gmail.com FEM Numerics (15/24)
The Finite Element Method
Stiness Matrix, and Load Vector
Error Estimation
FEM for Partial Dierential Equations
Building the Toolbox
Error Control
Error Control Proof
Proof.
Let v
h
V
h
be arbitrary, and set w
h
= u
h
v
h
. Then w
h
V
h
and we
get:
(u u
h
)

2
= a((u u
h
)

, (u u
h
)

) + a((u u
h
)

, w

h
)
. .. .
=0
= a((u u
h
)

, (u u
h
+ w
h
)

)
= a((u u
h
)

, (u v
h
)

)
{Cauchys} (u u
h
)

(u v
h
)

.
Dividing through by (u u
h
)

gives
(u u
h
)

(u v
h
)

.
Peter Blomgren, blomgren.peter@gmail.com FEM Numerics (16/24)
The Finite Element Method
Stiness Matrix, and Load Vector
Error Estimation
FEM for Partial Dierential Equations
Building the Toolbox
Error Control
Error Control Applying the Theorem
From the theorem we can get a quantitative estimate (upper
bound) for the error (u u
h
)

by estimating (u v
h
)

where
v
h
V
h
is a suitably chosen function.
Let v
h
be the linear interpolant of u, i.e. v
h
(x
j
) = u(x
j
), then
|u

(x) v

h
(x)| h max
x[0,1]
|u

(x)| [1]
|u(x) v
h
(x)|
h
2
8
max
x[0,1]
|u

(x)| [2]
Peter Blomgren, blomgren.peter@gmail.com FEM Numerics (17/24)
The Finite Element Method
Stiness Matrix, and Load Vector
Error Estimation
FEM for Partial Dierential Equations
Building the Toolbox
Error Control
Error Control Applying the Theorem
From the theorem we can get a quantitative estimate (upper
bound) for the error (u u
h
)

by estimating (u v
h
)

where
v
h
V
h
is a suitably chosen function.
Let v
h
be the linear interpolant of u, i.e. v
h
(x
j
) = u(x
j
), then
|u

(x) v

h
(x)| h max
x[0,1]
|u

(x)| [1]
|u(x) v
h
(x)|
h
2
8
max
x[0,1]
|u

(x)| [2]
The rst result and the theorem gives
(u u
h
)

h max
x[0,1]
|u

(x)|.
Similarly, from [2], we can get
u(x) u
h
(x) Ch
2
max
x[0,1]
|u

(x)|.
Peter Blomgren, blomgren.peter@gmail.com FEM Numerics (17/24)
The Finite Element Method
Stiness Matrix, and Load Vector
Error Estimation
FEM for Partial Dierential Equations
Initial Example: The Poisson Equation
Analytical Tools: Vector Calculus
Variational Formulation
Minimization Formulation
The Road Ahead...
FEM for PDEs the Poisson Equation
Consider the following boundary value problem
u = f in
u = 0 on = ,
where is a bounded domain in R
2
= {(x
1
, x
2
) : x
1
R, x
2
R}.
is the boundary of , f (x
1
, x
2
) a given function, and
u =


2
x
2
1
+

2
x
2
2

u(x
1
, x
2
) = u
x
1
x
1
(x
1
, x
2
) + u
x
2
x
2
(x
1
, x
2
).
Physical problems: Our simple 1-D model problems from last
lecture carry over to this 2-D model: heat distribution in a plate,
the displacement of an elastic membrane xed at the boundary
under transverse load, etc...
Peter Blomgren, blomgren.peter@gmail.com FEM Numerics (18/24)
The Finite Element Method
Stiness Matrix, and Load Vector
Error Estimation
FEM for Partial Dierential Equations
Initial Example: The Poisson Equation
Analytical Tools: Vector Calculus
Variational Formulation
Minimization Formulation
The Road Ahead...
Vector Calculus Review (or Crash Course) I/III
We need to generalize integration by parts to higher
dimensions... We start with the divergence theorem:

udx =

u nds,
where u = {u
1
, u
2
}
T
, and
u =
u
1
x
1
+
u
2
x
2
.
n = {n
1
, n
2
}
T
is the unit (length-one, outward) normal to . dx
denotes area-integration, and ds integration along the boundary.
c.f. in 1-D:

[a,b]
du
dx
dx =

{a,b}
u(1) ds = u(a) + u(b)
Peter Blomgren, blomgren.peter@gmail.com FEM Numerics (19/24)
The Finite Element Method
Stiness Matrix, and Load Vector
Error Estimation
FEM for Partial Dierential Equations
Initial Example: The Poisson Equation
Analytical Tools: Vector Calculus
Variational Formulation
Minimization Formulation
The Road Ahead...
Vector Calculus Review (or Crash Course) II/III
If we apply the divergence theorem to the vector functions
u
1
= (vw, 0) and u
2
= (0, vw), we nd

v
x
i
w + v
w
x
i
dx =

vwn
i
ds, i = 1, 2.
Let v denote the gradient
v =

v
x
1
,
v
x
2

T
,
and use the result above to write Greens Formula

v w dx

v
x
1
w
x
1
+
v
x
2
w
x
2

dx
=

v
w
x
1
n
1
+ v
w
x
2
n
2

ds

2
w
x
2
1
+

2
w
x
2
2

dx
=

v
w
n
ds

vw dx.
Peter Blomgren, blomgren.peter@gmail.com FEM Numerics (20/24)
The Finite Element Method
Stiness Matrix, and Load Vector
Error Estimation
FEM for Partial Dierential Equations
Initial Example: The Poisson Equation
Analytical Tools: Vector Calculus
Variational Formulation
Minimization Formulation
The Road Ahead...
Vector Calculus Review (or Crash Course) III/III
The normal derivative
w
n
=
w
x
1
n
1
+
w
x
2
n
2
= w n
is the derivative in the outward normal direction to the boundary .
With this notation we are ready to state the variational formulation
corresponding to the dierential equation...
Peter Blomgren, blomgren.peter@gmail.com FEM Numerics (21/24)
The Finite Element Method
Stiness Matrix, and Load Vector
Error Estimation
FEM for Partial Dierential Equations
Initial Example: The Poisson Equation
Analytical Tools: Vector Calculus
Variational Formulation
Minimization Formulation
The Road Ahead...
Variational Formulation
(V) Find u V so that a(u, v) = (f , v), v V.
where
a(u, v) =

u v dx
(f , v) =

fv dx
V =

v : v C()
v
x
1
and v
x
2
are piecewise continuous in
v = 0 on

Note: We have slightly changed the notation of the a(, ) inner-product.


This is very common in the PDE framework. The a(, ) inner-
product generically involves integrating the product(s) of deriva-
tive(s) of the two arguments over the domain.
Peter Blomgren, blomgren.peter@gmail.com FEM Numerics (22/24)
The Finite Element Method
Stiness Matrix, and Load Vector
Error Estimation
FEM for Partial Dierential Equations
Initial Example: The Poisson Equation
Analytical Tools: Vector Calculus
Variational Formulation
Minimization Formulation
The Road Ahead...
Minimization Formulation
u is a solution to (V) if and only if it is also a solution to the
following minimization problem.
(M) Find u V such that F(u) F(v) v V,
where F(v) is the potential energy
F(v) =
1
2
a(v, v) (f , v).
Peter Blomgren, blomgren.peter@gmail.com FEM Numerics (23/24)
The Finite Element Method
Stiness Matrix, and Load Vector
Error Estimation
FEM for Partial Dierential Equations
Initial Example: The Poisson Equation
Analytical Tools: Vector Calculus
Variational Formulation
Minimization Formulation
The Road Ahead...
Next...
Constructing a Finite Element Method for this problem...
Peter Blomgren, blomgren.peter@gmail.com FEM Numerics (24/24)

Você também pode gostar