198
Chapter
5.
Boundary value problems
in
statics
new
BVP for the
unknown
w(x)
=
u(x]
—
g(x).
We can
apply this idea
to the
weak
form
of the
BVP.
A
calculation similar
to
that
of
Section 5.4.1 shows
that
the
weak
form
of
(5.55)
is
Here, however,
we do not
look
for the
solution
u in
V,
but
rather
in g + V =
{g
+ v
:
v €
V}.
We now
write
u = g +
w,
and the
problem becomes
But
a(w
+
g,
v) =
a(w,
v) +
a(g,
v),
so we can
write (5.56)
as
It
turns
out
that
solving (5.57)
is not
much harder
than
solving
the
weak formulation
of
the
homogeneous Dirichlet problem;
the
only
difference
is
that
we
modify
the
right-hand-side vector
f,
as we
explain below.
Shifting
the
data
is
easy because
we can
delay
the
choice
of the
function
g
until
we
apply
the
Galerkin
method;
it is
always simple
to find a finite
element function
g
n
which
satisfies
the
boundary conditions
on the
boundary nodes (actually,
for a
one-dimensional problem like
this,
it is
trivial
to find
such
a
function
g in any
case;
however,
this
becomes
difficult
in
higher dimensions, while
finding a finite
element
function
to
satisfy
the
boundary conditions,
at
least
approximately,
is
still easy
in
higher dimensions).
The
Galerkin problem
is:
We
choose
g
n
to be
piece
wise
linear
and
satisfy
g
n
(xo}
= a,
g
n
(x
n
)
=
/3-
the
simplest
such function
has
value zero
at the
other nodes
of the
mesh, namely
g
n
=
afio+ftfin.
Substituting
w
n
=
^ii=i
a
i^i
m
*°
(5-58),
we
obtain,
as
before,
the
linear system
Ku
=
f.
The
matrix
K
does
not
change,
but f
becomes
Example
5.22.
We now
solve
an
inhomogeneous
version
of
Example 5.21;
specif-
i.rnll.ii
IIJP
n.nnln
the
finite
pl.pm.pni.
mpthntt
t.n
198
Chapter
5.
Boundary value problems in statics
new
BVP
for the unknown w(x) = u(x) - g(x).
We
can apply this idea to
the
weak
form of the BVP.
A calculation similar to
that
of Section 5.4.1 shows
that
the weak form of
(5.55)
is
a(u,v) =
(f,v)
for all v E
V.
Here, however,
we
do
not look for the solution u in V,
but
rather in g + V
{g
+ v : v E
V}.
We
now write u = g + w,
and
the
problem becomes
find
wE
V such
that
a(w + g,v) =
(f'v)
for all v E
V.
(5.56)
But
a(w +
g,
v) = a(w, v) + a(g, v),
so
we
can write (5.56) as
find
w E V such
that
a(w,v) =
(f'v)
- a(g,v) for all v E
V.
(5.57)
It
turns out
that
solving (5.57)
is
not much harder
than
solving the weak formulation
of the homogeneous Dirichlet problem; the only difference
is
that
we
modify the
right-hand-side vector
f, as
we
explain below.
Shifting
the
data
is
easy because
we
can delay the choice of the function g until
we
apply
the
Galerkin method; it
is
always simple
to
find a finite element function
gn
which satisfies the boundary conditions on the boundary nodes (actually, for a
one-dimensional problem like this, it
is
trivial
to
find such a function g in any case;
however, this becomes difficult in higher dimensions, while finding a finite element
function
to
satisfy
the
boundary conditions,
at
least approximately,
is
still easy in
higher dimensions).
The Galerkin problem
is:
find
Wn
E
Sn
such
that
a(w
n
,
v)
=
(f,
v)
- a(gn, v) for all v E
Sn-
(5.58)
We
choose
gn
to be piecewise linear
and
satisfy
gn(XO)
=
a,
gn(xn) =
(3;
the simplest
such function has value zero
at
the other nodes
ofthe
mesh, namely
gn
= a¢o+(3¢n.
Substituting
Wn
=
l:~:ll
ai¢i
into (5.58),
we
obtain, as before, the linear system
Ku
=
f.
The matrix K does not change,
but
f becomes
i = 2,3,
...
, n - 2 (since a(gn, ¢i) = 0),
i = 1, (5.59)
i=n-1.
Example
5.22.
We now solve an inhomogeneous version
of
Example 5.21; specif-
ically, we apply the finite element method to
d (
dU)
- dx
(1
+ x) dx (x) =
1,
0 < x <
1,
u(O)
= 2, (5.60)
u(l)
= 1.