188
Chapter
5.
Boundary value problems
in
statics
(b)
Now
suppose
A
e
R
nxn
is
tridiagonal,
that
is,
suppose
AIJ
— 0
whenever
\i
—
j\ > 1.
About
how
many arithmetic operations does
it
take
to
solve
Ax = b by
Gaussian elimination, assuming
that
the
algorithm takes
advantage
of the
fact
that
most
of the
entries
of A are
already zero?
(The student should work
out a
small example
by
hand
and
count
the
number
of
operation taken
at
each
step.
A
short calculation gives this
operation count
as a
function
of
n.)
(c)
Finally, suppose
that,
on a
certain computer,
it
takes 0.01
s to
solve
a
100 x 100
tridiagonal linear system
by
Gaussian elimination.
How
long
will
it
take
to
solve
a
1000
x
1000 system?
A
10000
x
10000 system?
5.6
Piecewise
polynomials
and the
finite
element
method
To
apply
the
Galerkin method
to
solve
a BVP
accurately
and
efficiently,
we
must
choose
a
subspace
V
n
of
C
2
[0,^]
and a
basis
for
V
n
with
the
following
properties:
1. The
stiffness
matrix
K and the
load vector
f can be
assembled
efficiently.
This means
that
the
basis
for
V
n
should consist
of
functions
that
are
easy
to
manipulate,
in
particular, differentiate
and
integrate.
2.
The
basis
for
V
n
should
be as
close
to
orthogonal
as
possible
so
that
K
will
be
sparse. Although
we do not
expect every pair
of
basis
functions
to be
orthogonal (which
would
lead
to a
diagonal
stiffness
matrix),
we
want
as
many pairs
as
possible
to be
orthogonal
so
that
K
will
be as
close
to
diagonal
as
possible.
3. The
true solution
u
of the BVP
should
be
well
approximated
from
subspace
V^,
with
the
approximation becoming arbitrarily good
as n
—>
oo.
We
will
continue
to use the BVP
as our
model problem.
Finite element methods
use
subspaces
of
piece
wise
polynomials;
for
simplicity,
we
will
concentrate
on
piece
wise
linear functions.
To
define
a
space
of
piecewise
linear functions,
we
begin
by
creating
a
mesh
(or
grid)
on the
interval
[0,^]:
The
points
XQ
,
Xi,...,
x
n
are
called
the
nodes
of the
mesh.
Often
we
choose
a
regular
mesh, with
xi
—
ih,
h =
t/n.
A
function
p
:
[0,^]
—>•
R is
piecewise linear (relative
to the
given mesh)
if, for
each
i =
l,2,...,n,
there exist constants
d{,
b{,
with
188
Chapter
5. Boundary value problems
in
statics
(b)
Now
suppose A E
Rnxn
is
tridiagonal,
that
is, suppose
Aij
= a whenever
Ii
- il >
1.
About how many arithmetic operations does
it
take to solve
Ax
= b by Gaussian elimination, assuming
that
the algorithm takes
advantage of the fact
that
most of the entries of A are already zero?
(The student should work
out
a small example by hand and count
the
number of operation taken
at
each step. A short calculation gives this
operation count as a function of n.)
(c)
Finally, suppose
that,
on a certain computer,
it
takes 0.01 s
to
solve a
100 x 100 tridiagonal linear system by Gaussian elimination.
How
long
will
it
take to solve a 1000 x 1000 system? A 10000 x 10000 system?
5.6 Piecewise polynomials and the finite element
method
To apply the Galerkin method to solve a
BVP
accurately and efficiently,
we
must
choose a subspace
Vn
of C
2
[0,
l]
and a basis for
Vn
with the following properties:
1.
The
stiffness matrix K and the load vector f can be assembled efficiently.
This means
that
the basis for
Vn
should consist of functions
that
are easy to
manipulate, in particular, differentiate and integrate.
2.
The
basis for
Vn
should be as close to orthogonal as possible
so
that
K will
be sparse. Although
we
do not expect every pair of basis functions
to
be
orthogonal (which would lead
to
a diagonal stiffness matrix),
we
want as
many pairs as possible
to
be orthogonal so
that
K will be as close
to
diagonal
as possible.
3.
The
true
solution u of the
BVP
should be well approximated from subspace
V
n
,
with the approximation becoming arbitrarily good as n -+
00.
We
will continue
to
use the BVP
d ( du )
-
dx
k(x)
dx
(x) =
f(x),
0 < x <
/!,
u(O)
= 0, (5.49)
u(/!) = a
as our model problem.
Finite element methods use subspaces of piecewise polynomials; for simplicity,
we
will concentrate on piecewise linear functions. To define a space of piecewise
linear functions,
we
begin by creating a
mesh
(or grid) on
the
interval
[0,
l]:
o = Xo <
Xl
< ... <
Xn
= l.
The
points
Xo,
Xl,
...
,
Xn
are called the nodes of
the
mesh. Often
we
choose a regular
mesh, with
Xi
=
ih,
h =
lin.
A function p :
[0,
l]
-+ R
is
piecewise linear (relative
to the given mesh)
if,
for each i = 1,2,
...
,n,
there exist constants
ai,
b
i
,
with
p(x)
=
aiX
+ b
i
for all X E
(Xi-l,Xi).