Professional Documents
Culture Documents
f ( x + dx) f ( x)
x f
dx
+
Finite Differences
Computational Seismology
pressure
pressure
acoustic
acousticwave
wavespeed
speed
sources
sources
t C = kC v C RC + p
CC
kk
vv
RR
pp
Finite Differences
tracer
tracerconcentration
concentration
diffusivity
diffusivity
flow
flowvelocity
velocity
reactivity
reactivity
sources
sources
The acoustic
wave equation
- seismology
- acoustics
- oceanography
- meteorology
Diffusion, advection,
Reaction
- geodynamics
- oceanography
- meteorology
- geochemistry
- sedimentology
- geophysical fluid dynamics
Finite differences
- time-dependent PDEs
- seismic wave propagation
- geophysical fluid dynamics
- Maxwells equations
- Ground penetrating radar
-> robust, simple concept, easy to
parallelize, regular grids, explicit method
Finite elements
Finite volumes
- time-dependent PDEs
- seismic wave propagation
- mainly fluid dynamics
-> robust, simple concept, irregular grids, explicit
method
Finite Differences
Particle-based
methods
Boundary element
methods
Pseudospectral
methods
Finite Differences
f ( x + dx) f ( x)
x f = lim
dx 0
dx
f ( x) f ( x dx )
x f = lim
dx 0
dx
f ( x + dx) f ( x dx)
x f = lim
dx 0
2dx
These are all correct definitions in the limit dx->0.
But we want dx to remain FINITE
Finite Differences
f ( x + dx ) f ( x)
x f
dx
forward difference
f ( x) f ( x dx )
x f
dx
backward difference
f ( x + dx) f ( x dx)
x f
2dx
Finite Differences
centered difference
The
big question:
Finite Differences
Taylor Series
f ( x + dx ) f ( x)
x f
dx
+
Finite Differences
Taylor Series
f ( x + dx) f ( x) 1
dx
dx
'
''
' ''
=
f ( x) +
f ( x) + ...
dxf ( x) +
dx
dx
2!
3!
= f ' ( x) + O(dx)
Finite Differences
Taylor Series
dx
f ( x + dx / 2) f ( x dx / 2) 1
'
'''
=
f ( x) + ...
dxf ( x) +
dx
dx
3!
= f ' ( x) + O(dx 2 )
Finite Differences
Alternative Derivation
f(x)
f ( xj )
dx
xj 1
h
xj
xj + 1
xj + 2
xj + 3
desired x location
What is the (approximate) value of the function or its (first,
second ..) derivative at the desired location ?
How can we calculate the weights for the neighboring points?
Finite Differences
Alternative Derivation
f(x)
f ( x)
dx
f ( x + dx) f ( x) + f ' ( x)dx
f ( x dx) f ( x) f ' ( x)dx
(1)
(2)
f
Finite Differences
(i )
( x ) w f ( xindex ( j ) )
j =1 , L
(i )
j
af
bf
af
+ bf
af + af 'dx
bf bf ' dx
(a + b) f + (a b) f ' dx
a +b =1
ab = 0
Finite Differences
Derivative
a+b = 0
a b = 1 / dx
Taylor Operators
... in matrix form ...
Interpolation
Derivative
1 a 1
=
1 b 0
1 a 0
=
1 b 1 / dx
a 1
=
b 1
Finite Differences
1
0
a 1
=
b 1
1 / dx
a 1 / 2
=
b 1 / 2
Derivative
a
1
=
b 2 dx
Finite Differences
*a |
( 2 dx ) 2
( 2 dx ) 3
f ( x 2 dx ) f ( 2 dx ) f '+
f ' '
f '''
2!
3!
*b |
( dx ) 2
( dx ) 3
f ( x dx ) f ( dx ) f '+
f ' '
f '''
2!
3!
*c |
( dx ) 2
( dx ) 3
f ( x + dx ) f + ( dx ) f '+
f ' '+
f '''
2!
3!
*d |
( 2 dx ) 2
( 2 dx ) 3
f ( x + 2 dx ) f + ( 2 dx ) f '+
f ' '+
f '''
2!
3!
... again we are looking for the coefficients a,b,c,d with which
the function values at x(2)dx have to be multiplied in order
to obtain the interpolated value or the first (or second) derivative!
... Let us add up all these equations like in the previous case ...
Finite Differences
af
+ bf
+ cf
+ df
++
f (a + b + c + d ) +
dxf ' ( 2 a b + c + 2 d ) +
dx
dx
b
c
+
+ 2d ) +
2
2
8
1
1
8
f '''(
a
b +
c +
d)
6
6
6
6
2
f ''(2 a +
... we can now ask for the coefficients a,b,c,d, so that the
left-hand-side yields either f,f,f,f ...
Finite Differences
Linear system
a + b + c + d = 1
2a b + c + 2d = 0
2a +
b
c
+
+ 2d = 0
2
2
8
1
1
8
a
b +
c +
d = 0
6
6
6
6
... you need to solve the matrix system ...
Finite Differences
High-order interpolation
... Interpolation ...
1
1
1 a 1
1
1 1
2 b 0
2
=
2
0
1/ 2 1/ 2 2 c
8/ 6 1/ 6 1/ 6 8/ 6 d 0
... with the result after inverting the matrix on the lhs ...
a 1/ 6
b 2/ 3
c = 2/ 3
d 1/ 6
Finite Differences
First derivative
... first derivative ...
1
1
1 a 0
1
1 1
2 b 1/ dx
2
=
2
0
1/ 2 1/ 2 2 c
8/ 6 1/ 6 1/ 6 8/ 6 d 0
a
1/ 6
b 1 4 / 3
c = 2dx 4 / 3
d
1/ 6
Finite Differences
PP
cc
ss
pressure
pressure
acoustic
acousticwave
wavespeed
speed
sources
sources
Problem:
Problem:Solve
Solvethe
the1D
1Dacoustic
acousticwave
waveequation
equationusing
usingthe
thefinite
finite
Difference
Differencemethod.
method.
Solution:
Solution:
c 2 dt 2
[ p ( x + dx ) 2 p ( x ) + p ( x dx ) ]
p (t + dt ) =
2
dx
+ 2 p (t ) p (t dt ) + sdt 2
Finite Differences
Problems: Stability
c 2 dt 2
[ p ( x + dx ) 2 p ( x ) + p ( x dx ) ]
p ( t + dt ) =
2
dx
+ 2 p ( t ) p ( t dt ) + sdt 2
Stability:
Stability:Careful
Carefulanalysis
analysisusing
usingharmonic
harmonicfunctions
functionsshows
showsthat
that
aastable
stablenumerical
numericalcalculation
calculationisissubject
subjectto
tospecial
specialconditions
conditions
(conditional
(conditionalstability).
stability).This
Thisholds
holdsfor
formany
manynumerical
numericalproblems.
problems.
(Derivation
(Derivationon
onthe
theboard).
board).
dt
1
c
dx
Finite Differences
Problems: Dispersion
c 2 dt 2
[ p ( x + dx ) 2 p ( x ) + p ( x dx ) ]
p ( t + dt ) =
2
dx
+ 2 p ( t ) p ( t dt ) + sdt 2
True velocity
Finite Differences
Dispersion:
Dispersion:The
Thenumerical
numerical
approximation
approximationhas
has
artificial
artificialdispersion,
dispersion,
ininother
otherwords,
words,the
thewave
wave
speed
speedbecomes
becomesfrequency
frequency
dependent
dependent(Derivation
(Derivationinin
the
theboard).
board).
You
Youhave
haveto
tofind
findaa
frequency
frequencybandwidth
bandwidth
where
wherethis
thiseffect
effectisissmall.
small.
The
Thesolution
solutionisisto
touse
useaa
sufficient
sufficientnumber
numberof
ofgrid
grid
points
per
wavelength.
points per wavelength.
Finite Differences
Snapshot Example
Velocity 5 km/s
3000
2500
Time (s)
2000
1500
1000
500
0
0
Finite Differences
1000
2000
3000
4000
Distance (km)
5000
Seismogram Dispersion
Finite Differences
Finite Differences