Information Technology Reference
In-Depth Information
Ta b l e 2 . 1
Difference between finite differences and finite elements
FDM
FEM
u m
vector of u i
u(t m ,x i )
coeff. vector of u N (t m ,x)
B
I
+ G
M
+ A
C
I
k( 1
θ) G
M
k( 1
θ) A
h 2 tridiag (
h 1 tridiag (
G
=
1 , 2 ,
1 )
A
=
1 , 2 ,
1 )
a f(t m ,x)b i (x) d x
f i
f(t m ,x i )
It remains to discretize the ODE ( 2.24 ). Proceeding exactly as in the FDM, we
choose time levels t m , m
=
0 ,...,M as in ( 2.6 )
t m =
mk, m
=
0 , 1 ,...,M, k
:=
T/M
=
t,
and denote u N := u N (t m ) and f m
:= f (t m ) . Then, the fully discrete scheme reads:
Find u m + 1
N
N
∈ R
such that for m
=
0 ,...,M
1 ,
k θ f m + 1
θ) f m ,
A ) u m + 1
N
θ) A ) u N +
( M
+
=
( M
k( 1
+
( 1
(2.26)
u 0 N = u 0 .
Thus, in both the finite difference and the finite element method we have to solve M
systems of N linear equations of the form
B u m + 1
C u m
k F m ,m
=
+
=
0 ,...,M
1 ,
where F m
= θ f m + 1
θ) f m . The difference between FDM and FEM is shown
+ ( 1
in Table 2.1 .
From Table 2.1 we see that both discretization schemes for the heat equation
lead to similar linear systems of equations to be solved in each timestep. For all the
partial differential equations which we will encounter in these note, we will use both
finite differences and finite elements for the discretization.
1, and u(t, x) = e t x sin (πx) . We measure the
discrete L ( 0 ,T ; L 2 (G)) -error defined by sup m h 2
Example 2.3.9 Let G = ( 0 , 1 ) , T
=
ε m
2
where
N
ε m
2
1 | u(t m ,x i ) u i
2 .
2 :=
|
i
=
( k) and obtain first order convergence
with respect to the time step k both for FDM and FEM, i.e.
For θ
=
1 (backward Euler), we let h
= O
h 2
ε m
su m
2 = O
(k).
(2.27)
Search WWH ::




Custom Search