Professional Documents
Culture Documents
Lecture6 PDF
Lecture6 PDF
Lu = f
in
u=g
on 0
0
n u = g1
on 1
n u + u = g on
2
Minimization problem
Given a functional J : V R
find u V such that
J(u) J(w),
w V
J(w) =
R x1
x0
x, w, dw
dx dx
over
w V = C 2 ([x0 , x1 ])
R, v V0 = {v V : v(x0 ) = 0}
x1
du
dv
x, u + v,
dx = I()
+
dx
dx
x0
By construction
w(x) = u(x)
I(0) I(),
for = 0
so that
dI
= 0,
d =0
v V0
u +v
u
x0
v V0
x1
dx
x d
dw
w d
= (x, w, w ),
dw
w d ,
where
w =
dx
d
dw
dx
= 0,
dw
d
dw
d
= v,
=
dx = 0,
J(u + v)
v+
dx
d
w
w
x0
=0
v V0
v
dx
+
(x1 )v(x1 ) = 0,
v V0
w
dx
w
w
x0
d
including v V = {v V0 : v(x1 ) = 0} w dx w = 0
Substitution
w (x1 )
v(x1 ) = 0,
| {z }
arbitrary
v V0
w (x1 )
=0
dv
dx
f (x)v(x) dx = 0,
Then
f (x) = 0,
x [a, b].
Let v(x) =
v V
but
f (x) = 0,
exp
0
Rb
a
f (x) > 0,
1
2 (xx
2
0)
f (x)v(x) dx =
x (a, b)
x (x0 , x0 + ) (a, b)
if |x x0 | <
if |x x0 |
R x0 +
x0
f (x) exp
f C([a, b])
x0
1
2 (xx
2
0)
f 0
x0
x0
dx > 0
in [a, b]
Euler-Lagrange equation
w dx w = 0
u(x0 ) = g0
w (x1 )
=0
dw
=
,
w
dx
dw
dx
2
d
dx
f w,
= f
w
d2 w
=
dx2
d2 u
in (0, 1)
dx2 = f
u(0) = g0 Dirichlet BC
du
dx (1) = 0 Neumann BC
Z
where
Z
Z
Z
1
g2 w ds +
g1 w ds
w2 ds,
|w|2 f w dx
2
2 2
2
1
f = f (x),
g0 = g0 (x),
Admissible functions
g1 = g1 (x),
w = u + v,
2
|w|
w 2
x
[u v f v] dx
w
y
2
: v| = 0}
v V0 = {v C 2 () C()
0
d
d J(u
g2 = g2 (x),
w Vg
=2
g1 v ds
+ v)=0 = 0,
w v
x x
w v
y y
g2 v ds +
v V0
= 2w v
uv ds = 0,
v V0
1 2
g1 v ds
: v| = 0
v V0 including v C 2 () C()
g2 v ds +
uv ds = 0
[u f ]v dx = 0
= 0, n u + u = g2
Consider v C () C() : v|0 1 = 0
2
R
= 0, n u = g1 and the following BVP
Substitution yields
1
u = f
in
2D Poisson equation
u=g
on 0
Dirichlet BC (essential)
0
n u = g1
on 1
Neumann BC (natural)
n u + u = g on
Robin BC (natural)
2
Rayleigh-Ritz method
Approximate solution
Exact solution
uV :
u = 0 +
cj j
uh Vh :
uh = 0 +
j=1
0
j
N
X
cj j
j=1
Continuous problem
Find u V such that
J(u) J(w),
J(uh ) J(wh ),
w V
Linear system:
Ac = b,
A RN N ,
J
= 0,
ci
b RN ,
wh Vh
i = 1, . . . , N
c = [c1 , . . . , cN ]T
Z 1
Z
N
N
X
J
1 1 X dj
cj j dx = 0
dx
f
cj
=
ci
ci 2 0
dx
0
j=1
j=1
Z
Z 1
N
di X dj
cj
dx =
f i dx,
dx j=1 dx
0
i = 1, . . . , N
di dj
dx,
dx dx
bi =
f i dx,
c = [c1 , . . . , cN ]T
N
X
cj x ,
j=1
A=
1 4/3
6/4
1 6/4
9/5
1 8/5
12/6
0 = 0,
Z
i = xi ,
i = 1, . . . , N
ij
aij =
ij xi+j2 dx =
,
i
+
j
1
0
8/5 2N/(N + 1)
12/6 3N/(N + 2)
, b =
16/7 4N/(N + 3)
N 2 /(2N 1)
bi =
f xi dx
b1
b2
b3
,
b4
bN
c=
c1
c2
c3
c4
cN
A is known as the Hilbert matrix which is SPD but full and ill-conditioned
so that the solution is expensive and corrupted by round-off errors.
for A to be sparse, the basis functions should have a compact support
Figure
Two nodal
functions for the polygonal
domain example
The finite element subspace
Vh4:consists
of basis
piecewise-polynomial
functions.
Typically, Vh = {v C m () : v|K Pk , K Th }.
comprising the right hand side as well as the entries
i;j
(12)
of the
element system
matrixone
A. degree
This is where
the advantage
Each basis function
i nite
accommodates
exactly
of freedom
and of the nodal basis
function
becomes
apparent: the
above integrals
reduce to integrals over supp( ) in the
has a small support
so that
the resulting
matrices
are sparse.
i
rst case and supp( ) \ supp( ) in the second. The supports of two nodal basis functions
for linear triangles consists of all those triangles of which the corresponding node is a
vertex. The supports of two basis functions in our example are shown in Figure 5.
i
K is a closed subset of
P is the polynomial space for the shape functions
is the set of local degrees of freedom
Basis functions possess the property
1 if i = j
j (xi ) = ij =
0 if i 6= j
uh (x) =
N
X
j=1
uj j (x)
x i1
x0
uh (xi ) =
N
X
j=1
xi
uj j (xi ) =
x i+1
N
X
xN
uj ij = ui
j=1
xi x
,
xi xi1
i (x) =
'
x xi1
xi xi1
x
N
X
u1
ui 1
uN 1 uN
uj j = ui1 i1 + ui i
0
j=1
= ui1 +
x xi1
(ui ui1 )
xi xi1
x0
x1
xi 1
xi
xi+1
xN 1 xN
ui+1
continuous, piecewise-linear
N Z
X
k=1
ek
di dj
dx,
dx dx
Fi =
N Z
X
k=1
f i dx
ek
2 1
1
2 1
A=
,
F =
2
(x)
1
2 1
1
1
1
1/2
This is the same linear system as the one obtained for the finite difference method!
Lu = f
in ,
u| = 0
u0
if
uLu dx = 0
d
L = dx
2
vLu dx
du
dx
d u
v dx =
dx2
u 0 since u(0) = 0
= g1
1
du dv
du
dx
v
dx
dx
dx
0
0
0
1 Z 1
Z 1 2
dv
d v
=
=
u 2 dx + u
uLv dx
dx
dx
0
0
0
R 1 du 2
R 1 d2 u
R1
uLu dx = 0 u dx2 dx = 0 dx dx 0
0
=
Positive-definiteness:
2
R1
If 0 du
dx = 0 then
dx
Non-homogeneous BC
w(0) = 0
u(0) = g0 w(0) = g0
(essential)
i
R 1 h 1 dw 2
J(w) = 0 2 dx f w dx g1 w(1) (natural)
Least-squares method
Idea: minimize the residual of the PDE
R(w) = Lw f
Least-squares functional
such that
J(w) =
R(u) = 0
(Lw f )2 dx
Lu = f
always exists
=0
=0
Integration by parts:
Euler-Lagrange equation
(Lu f )Lv dx =
L Lu = L f
L (Lu f )v dx
[. . .] ds = 0
Lu = f in
P
j j V0 be the solution of
Let u =
u=0
j=1
on
Residual is zero if its projection onto each basis function equals zero
Lu f = 0
Test functions
v=
j j
(Lu f )i dx = 0
j=1
(Lu f )v dx = 0,
i = 1, 2, . . .
a(u, v) = l(v)
v V0
a(u, v) =
v V0
f v dx
g(u) v dx
Discrete problem
a(u, v) = l(v),
a(uh , vh ) = l(vh ),
v V0
FEM approximations:
uh =
N
X
u j j V h ,
vh =
j=1
N
X
vh Vh
vj j Vh
j=1
Vh = Vh
a(u, i ) = l(i ),
i = i
Petrov-Galerkin method
Vh 6= Vh
a(u, i ) = l(i ),
i 6= i
N
X
i = 1, . . . , N
j=1
Matrix form
Au = F
with coefficients
aij = a(j , i ),
Fi = l(i )
d2 u = f in (0, 1)
dx2
u(0) = 0, du (1) = 0
dx
Weak formulation
u V0
Z 1 2
d u
2 f v dx = 0, v V0
dx
0
v dx =
dx
v
2
dx
dx
dx
dx
0
0
0
Continuous problem
a(u, v) = l(v),
Discrete problem
a(uh , i ) = l(i ),
Approximate solution
uh (x) =
N
X
uj j (x)
j=1
a(u, v) =
R1
du dv
0 dx dx
i = 1, . . . , N
dx,
l(v) =
R1
0
f v dx
(Galerkin method)
di dj
dx,
dx dx
Fi =
f i dx,
u = [u1 , . . . , uN ]T
The Galerkin and Ritz methods are equivalent if the minimization problem exists
u = f
in
u=g
on 0
0
n u = g1
on 1
n u + u = g on
2
Weak formulation
u Vg
Z
[u f ]v dx = 0, v V0
Vg = {v V : v|0 = g0 }
V0 = {v V : v|0 = 0}
= 0 1 2
(n u)v ds = 0 since v = 0 on 0
Boundary conditions
0
R
R
R
R
R
(n u)v ds = 1 g1 v ds,
(n u)v ds = 2 g2 v ds 2 uv ds
1
2
Approximate solution
uh (x) = 0 +
N
P
j=1
uj j (x),
0 |0 = g0
Continuous problem
Discrete problem
a(uh , i ) = l(i ) +
i (xj ) = ij ,
g1 i ds +
i C(),
g2 i ds,
i = 1, . . . , N
i |K P1 , K Th
i, j = 1, . . . , N
2
Z
Z
Z
Fi =
f i dx +
g1 i ds +
g2 i ds
The matrix A is SPD, sparse and banded for a proper node numbering