Sie sind auf Seite 1von 11

Finite Elements: 1D acoustic wave equation

Helmholtz (wave) equation (time-dependent)

Regular grid
Irregular grid

Explicit time integration


Implicit time integraton
Numerical Examples
Scope: Understand the basic concept of the finite element
method applied to the 1D acoustic wave equation.

Finite element method

Acoustic wave equation in 1D


How do we solve a time-dependent problem such
as the acoustic wave equation?

t2u v 2 u = f
where v is the wave speed.
using the same ideas as before we multiply this equation with
an arbitrary function and integrate over the whole domain, e.g. [0,1], and
after partial integration
1

2
2

dx

v
t j
u j dx = f j dx

.. we now introduce an approximation for u using our previous


basis functions...

Finite element method

Weak form of wave equation


N

u u~ = ci (t ) i ( x)
i =1

note that now our coefficients are time-dependent!


... and ...
N

t2u t2u~ = t2 ci (t ) i ( x)
i =1

together we obtain
1
1
1

2
2

dx
+
v
t i i j
ci i j dx = f j
0
i

i 0
0

which we can write as ...


Finite element method

Time extrapolation
1
1
1

2
2

+
c

dx
v
t i i j
ci i j dx = f j
0
i

i 0
0

mass matrix

stiffness matrix

... in Matrix form ...

M T c&& + v 2 AT c = g
... remember the coefficients c correspond to the
actual values of u at the grid points for the right choice
of basis functions ...
How can we solve this time-dependent problem?
Finite element method

Time extrapolation
M T c&& + v 2 AT c = g
... let us use a finite-difference approximation for
the time derivative ...

ck +1 2c + ck 1 2 T
M
+ v A ck = g
2
dt

... leading to the solution at time tk+1:

ck +1 = ( M T ) 1 ( g v 2 AT ck ) dt 2 + 2ck ck 1
we already know how to calculate the matrix A but
how can we calculate matrix M?

Finite element method

Mass matrix
1
1
1

2
2
c

dx
+
v

t i i j
ci i j dx = f j
0
i

i 0
0

... lets recall the definition of our basis functions ...

x
~
h +1
i 1 ~
x

i ( ~x ) = 1
hi

M ij = i j dx
0

i=1
+

2
+

3
+

h1 h2
Finite element method

4
+
h3

5
6 7
+ + +
h4 h5 h6

for

x 0
hi 1 < ~

for

x < hi
0<~

x = x xi
,~

elsewhere

... let us calculate some


element of M ...

Mass matrix some elements


Diagonal elements: Mii, i=2,n-1
1

hi 1

M ii = i i dx =

hi 1 hi
=
+
3
3

i=1
+

2
+

3
+

h1 h2

4
+
h3

dx + 1 dx
hi
hi 1
0
hi

for

x 0
hi 1 < ~

for

x < hi
0<~
elsewhere

ji

5
6 7
+ + +
h4 h5 h6

xi
hi-1

Finite element method

x
~
h +1
i 1 ~
x

i ( ~x ) = 1
hi

hi
7

Matrix assembly
Mij

Aij

% assemble matrix Mij

% assemble matrix Aij

M=zeros(nx);

A=zeros(nx);

for i=2:nx-1,

for i=2:nx-1,

for j=2:nx-1,

for j=2:nx-1,

if i==j,

if i==j,

M(i,j)=h(i-1)/3+h(i)/3;

A(i,j)=1/h(i-1)+1/h(i);

elseif j==i+1

elseif i==j+1

M(i,j)=h(i)/6;

A(i,j)=-1/h(i-1);

elseif j==i-1

elseif i+1==j

M(i,j)=h(i)/6;

A(i,j)=-1/h(i);

else

else

M(i,j)=0;

A(i,j)=0;

end

end

end
end

Finite element method

end
end

Numerical example

Finite element method

Implicit time integration


M T c&& + v 2 AT c = g
... let us use an implicit finite-difference approximation for
the time derivative ...

ck +1 2c + ck 1 2 T
M
+ v A ck +1 = g
2
dt

... leading to the solution at time tk+1:

] (gdt

T 1

ck +1 = M + v dt A
T

+ M T (2c ck 1 )

How do the numerical solutions compare?

Finite element method

10

Summary

The
The time-dependent
time-dependent problem
problem (wave
(wave equation)
equation) leads
leads to
to the
the
introduction
introduction of
of the
the mass
mass matrix.
matrix.
The
The numerical
numerical solution
solution requires
requires the
the inversion
inversion of
of aa system
system
matrix
matrix (it
(it may
may be
be sparse).
sparse).
Both
Both explicit
explicit or
or implicit
implicit formulations
formulations of
of the
the time-dependent
time-dependent part
part
are
are possible.
possible.

Finite element method

11

Das könnte Ihnen auch gefallen