Académique Documents
Professionnel Documents
Culture Documents
x0
x1
x3
x2
It is clear that the function v is continuous but has only one derivative, and this derivative is
only piecewise continuous (actually piecewise constant). Thus, V2 is not a subspace of V whose
elements must have two continuous derivatives. The way around this dilemma is to extend the
notion of a solution, i.e., enlarge the space V so that it contains subspaces of finite element
piecewise polynomials. We wont worry about how to do this, and will verify by examples that
we havent made the approximating subspaces too large. Thus, at least within the context of
this course, the difficulties just discovered may be forgotten, and we may assume whenever
necessary that the space V contains the finite element subspaces to be introduced.
To present the basic ideas of the finite element method and at the same time generalize our sample
problem, well consider a boundary value problem (BVP) for the ordinary differential equation of
the type weve been studying, but with some extra features. Let p 6= 0 R be given and set
Vp = {w C 2 ([0, 1]) : w(0) = p}, i.e. functions having two continuous derivatives and taking a
specified value at the left end point. We formulate our BVP as follows:
Problem P1 : find u Vp satsifying L(u) = u00 + u = f (x), 0 < x < 1,
u0 (1) = q,
u0 v 0 dx = qv(1) +
Z
0
u0 v 0 dx
where weve used the facts that v(0) = 0 and u0 (1) = q. Substuting we have
qv(1) +
where as before
a(u, v) =
(f, v) =
f v dx, u Vp , v V0
for all v V0 .
But now we can reverse the process just completed and find the P1 is equivalent to
Problem P2 : find u Vp such that a(u, v) = (f, v) + qv(1) for all v V0
Note that the only difference between Vp and V0 is that functions in Vp are required to take the value
p 6= 0 at x = 0, where as those in V0 vanish there. V0 is a linear space (since v, w V0 v + w and
v V0 ), but Vp is not e.g. if v(0) = p then v
/ Vp unless = 1. In fact, if v Vp is any fixed
element of Vp , then all other elements v are of the form v = v + w, w V0 (since the difference of
any two elements of Vp belongs to V0 ). Thus, Vp is just a translated version of the linear space V0
the dimension of Vp is defined as the dimension of V0 (it is called an affine subspace of V rather
than a linear subspace).
Ignoring the fact P1 and hence P2 can be solved exactly for any f , we will try to find an approximate
numerical solution. Using a small generalization of the previous Galerkin approach, we seek the
approximate solution u in a finite dimensional subspace of Vp,n Vp , and we require that P2 be
satisfied for all v V0,n where Vp,n and V0,n are n dimensional subspaces of V (any u Vp,n is
on the form u
+ v with u
a fixed element of Vp,n and v V0,n ). (u will usually be called the trial
function and any v will be called a test function.)
Of course, we could work with polynomials again, but now we introduce the finite element ideas.
We define a grid of points in the interval [0, 1], and call these points xi , i = 1, . . . , n + 1 where
0 = x1 < < xn+1 = 1, and xi+1 xi hi , i = 1, . . . , n is the grid spacing. Usually, these points
will be evenly spaced, hi = 1/n, but at this point we wont enforce this restriction. We take Vp,n
to be the space of continuous, piecewise linear functions u on [0, 1] such that u(0) = p, u is linear
in each subinterval [xi , xi+1 ], with u(xi ) = ui , i = 1, . . . , n. We take V0,n to be the same space but
with the value 0 specified at x = 0. Any function in either space is determined entirely by its values
at the n points xi , i = 2, . . . , n + 1, and this implies that the spaces are n dimensional. In fact well
now define a useful system of basis functions with n elements.
Consider three grid points xe1 , xe , xe+1 , and let v V0,n (or Vp,n ) have the values ve1 , ve , ve+1
at these points as shown in the sketch below.
The trial or test functions are linear on each interval, or element, I e = [xe , xe+1 ] of the grid.
Thus, on element e 1 we have v = ve1 (xe x)/he1 + ve (x xe1 )/he1 and on element e,
v = ve (xe+1 x)/he + ve+1 (x xe )/he . That is, on each element I e , a test or trial function v can
be expressed as a linear combination of two element basis functions H1e (x) = (xe+1 x)/he and
P2
H2e (x) = (x xe )/he , i.e., we can write v|I e = j=1 ve+j1 Hje , where the notation v|I e indicates the
restriction of v to element e. Combining the expressions for v on the separate elements, we arrive at
a formula which holds for all of I
n+1
X
v(x) =
i (x)vi
i=1
with
1 (x) =
and
n+1 (x) =
0,
H2n (x),
0 x xn ,
xn < x 1 = xn+1
0,
0 x < xj1
H j1 (x), x
j1 x < xj
2
, j = 2, . . . , n,
j (x) =
j
H1 (x),
xj x < xj+1
0,
xj+1 x 1
where v1 = 0 for a test function and v1 = p for the trial function. The i s, sketched below, are
often called tent functions for obvious reasons.
Now substitute the trial function into the weak form and use the fact that a is linear in its second
factor, i.e., a(w, u1 + u2 ) = a(w, u1 ) + a(w, u2 )
a(w, u) = a(w,
n+1
X
uj j ) =
j=1
n+1
X
j=1
where F (w) = (f, w) + qw(1). The now any test u function is a linear combination of tent functions
(excluding 1 , since w1 = 0). In addition, a is linear in its first argument w and F is also linear in
w. This means that requiring a(w, u) = F (w) for any test function is equivalent to the requirement
that a(i , u) = F (i ), i = 2, . . . , n + 1. Thus, we arrive at the system of n equations for the n
unknown quantities u2 , . . . , un+1
n+1
X
a(i , j )uj = F (i ), i = 2, . . . , n + 1
j=1
It is often convenient to ignor the fact that u1 = p and allow i to range over the range 1, . . . , n + 1
in the above system. Prior to obtaining an algebraic solution, of course, the constraint on u1 must
be imposed. Let us compute the coefficient matrix K = [a(i , j )] and the right hand side vector
F = [F (1 ), , F (n+1 ]T . As noted previously, K is often called the stiffness matrix and F the
load vector because of the structural origins of the FEM.
For the load vector we have (because only n+1 is nonzero at x = 1)
Fe = F (e ) =
e f (x) dx + e,n+1 q,
where
i,j =
i = j,
otherwise
1,
0,
I1
Given the functional form of f , we can evaluate these integrals either analytically or numerically.
For our first example, we take f to be a constant. In this case,
e=1
f h1 /2,
Fe = f (he1 + he )/2, e = 2, . . . , n
f hn /2 + q,
e=n+1
Next we turn to the stiffness matrix K. The element basis functions Hje (x) have constant derivatives
H1e 0 = 1/he ,
H2e 0 = 1/he .
0 x xn ,
xn < x 1
and
0j (x)
0,
1/h
j1 ,
1/hj ,
0,
x xj1
xj1 < x < xj
, j = 2, . . . , n
xj < x < xj+1
x xj+1
1 1 0
0 0
1 2 1 0 0
..
..
..
1
.
.
.
0
K|c=0 = .
..
h ..
.
0
0 1 2 1
0
0 0 1 1
R1
If c 6= 0, we must add the elements kc,ij = c 0 i j dx. We find for the diagonal elements
Z
Z
1
kc,ee =
H2e1 (x)2 dx +
H1e (x)2 dx = (he1 + he ), e = 2, . . . , n,
3
I e1
Ie
and kc,11 = h1 /3, kc,n+1,n+1 = hn /3. Of the off diagonal elements, only those on the first subdiagonal
and superdiagonal are nonzero, and we find
Z
kc,e1,e =
H2e1 (x)H1e (x) dx = he1 /3,
I e1
1.5
1.4
1.3
1.2
1.1
0.9
0.8
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
uexact
1.0000
0.9230
0.8730
0.8480
0.8470
0.8700
0.9178
0.9925
1.0969
1.2354
1.4134
error
0.0000
0.0004
0.0007
0.0010
0.0012
0.0014
0.0016
0.0018
0.0019
0.0020
0.0020
The computation above is not arranged in the usual FEM fashion. We have not taken advantage
of the fact that all computations can be performed locally on elements. We will in our future
work arrange things so that the element stiffness matrix and load vectors are computed and then
assembled into the global stiffness matrix and load vector. For the problem just completed, this
element approach would not achieve any gains in simplicity, but in more complex problems the
assembly process becomes necessary for computational efficiency.