Professional Documents
Culture Documents
The goal of this lecture is to shed light at one end of the axis of FD
(or convolutional) type differential operators. When one uses all
information of a space-dependent field to estimate the derivative at a
point one obtains spectral accuracy.
Pseudospectral methods 1
What is pseudospectral?
Pseudospectral methods
Fourier Derivatives
.. let us recall the definition of the derivative using Fourier integrals ...
⎛∞ ⎞
∂ x f ( x) = ∂ x ⎜⎜ ∫ F (k )e dk ⎟⎟
−ikx
⎝ −∞ ⎠
∞
= − ∫ ikF (k )e −ikx dk
−∞
Pseudospectral methods
The acoustic wave equation
1 ⎛ 1 ⎞
∂ 2
p = ∂ ⎜
x⎜ ∂ p ⎟⎟
ρc ⎝ ρ
2 t x
⎠
⎛ 1 ⎞
1
[p (t + dt ) − 2 p ( t ) + p ( t − dt ) ] = ∂ x ⎜⎜ ∂ x p ⎟⎟
ρ c 2 dt 2
⎝ ρ ⎠
Pseudospectral methods
The Fourier Method: acoustic wave propagation
⎛ 1 ⎞
p ( t + dt ) = ρ c 2 dt 2 ∂ x ⎜⎜ ∂ x p ⎟⎟ + 2 p ( t ) − p ( t − dt )
⎝ ρ ⎠
where the space derivatives will be calculated using the Fourier Method.
The highlighted term will be calculated as follows:
−1
P jn → FFT → Pˆυ n → ik υ Pˆυ n → FFT → ∂ x P jn
multiply by 1/ρ
n n
1 ⎛ 1 ˆ⎞ ⎛ 1 ˆ⎞ −1 ⎛1 n⎞
∂ x P → FFT → ⎜⎜ ∂ x P ⎟⎟ → ikυ ⎜⎜ ∂ x P ⎟⎟ → FFT → ∂ x ⎜⎜ ∂ x Pj ⎟⎟
n
ρ ⎝ρ ⎝ρ ⎝ρ
j
⎠υ ⎠υ ⎠
... then extrapolate ...
Pseudospectral methods
… and in 3D …
p ( t + dt ) =
⎛ ⎛1 ⎞ ⎛1 ⎞ ⎛1 ⎞⎞
ρ c dt ⎜ ∂ x ⎜⎜ ∂ x p ⎟⎟ + ∂ y ⎜⎜ ∂ y p ⎟⎟ + ∂ z ⎜⎜ ∂ z p ⎟⎟ ⎟⎟
2 2
⎜
⎝ ⎝ρ ⎠ ⎝ρ ⎠ ⎝ρ ⎠⎠
+ 2 p ( t ) − p ( t − dt )
−1
P jn → FFT → Pˆυ n → ik υ Pˆυ n → FFT → ∂ x P jn
n n
1 ⎛ 1 ˆ⎞ ⎛ 1 ˆ⎞ −1 ⎛1 n⎞
∂ x P → FFT → ⎜⎜ ∂ x P ⎟⎟ → ikυ ⎜⎜ ∂ x P ⎟⎟ → FFT → ∂ x ⎜⎜ ∂ x Pj ⎟⎟
n
ρ ⎝ρ ⎝ρ ⎝ρ
j
⎠υ ⎠υ ⎠
Pseudospectral methods
… FD in Matlab …
let us compare the core of the algorithm - the calculation of the derivative
(Matlab code)
function df=fder1d(f,dx,nop)
% fDER1D(f,dx,nop) finite difference
% second derivative
nx=max(size(f));
n2=(nop-1)/2;
df=[1:nx]*0;
for i=1:nop;
df=df+d(i).*cshift1d(f,-n2+(i-1));
end
Pseudospectral methods
… and as PS …
function df=sder1d(f,dx)
% SDER1D(f,dx) spectral derivative of vector
nx=max(size(f));
% initialize k
kmax=pi/dx;
dk=kmax/(nx/2);
for i=1:nx/2, k(i)=(i)*dk; k(nx/2+i)=-kmax+(i)*dk; end
k=sqrt(-1)*k;
Pseudospectral methods
Dispersion and Stability
− n ω dt )
p nj = e i ( kjdx
∂ 2x p nj = −k 2ei ( kjdx−ωndt )
4 2 ωdt i ( kjdx −ωndt )
∂ p = − 2 sin
2
t
n
j e
dt 2
2 ωdt
k= sin
cdt 2
Pseudospectral methods
Dispersion and Stability
2 ωdt 2 −1 kcdt
k= sin ω = sin ( )
cdt 2 dt 2
k max cdt
≤1
2
cdt / dx ≤ 2 / π ≈ 0.636
Pseudospectral methods
Results @ 10Hz
Source time function Gauss in space
1 1
0.5
0.5
0
-0.5 0
0 200 400 600 0 10 20
3 point - 2 order; T = 6.6 s, Error = 50.8352%
1
0.5
-0.5
0.5
0.5
0
-0.5 0
0 200 400 600 0 10 20
5 point - 2 order; T = 7.8 s, Error = 3.9286%
1
0.5
-0.5
0.5
0.5
0
-0.5 0
0 200 400 600 0 10 20
Fourier - 2 order; T = 35 s, Error = 2.72504%
1
0.5
-0.5
-1
0.8 0.9 1 1.1 1.2 1.3 1.4
Time (sec)
0.5
0.5
0
-0.5 0
0 200 400 600 0 10 20
3 point - 2 order; T = 7.8 s, Error = 156.038%
1
0.5
-0.5
-1
0.8 0.9 1 1.1 1.2 1.3 1.4
Time (sec)
0.5
0.5
0
-0.5 0
0 200 400 600 0 10 20
5 point - 2 order; T = 7.8 s, Error = 45.2487%
1
0.5
-0.5
0.5
0.5
0
-0.5 0
0 200 400 600 0 10 20 3
Fourier - 2 order; T = 34 s, Error = 18.0134%
1
0.5
-0.5
-1
0.8 0.9 1 1.1 1.2 1.3 1.4 1
Time (sec)
160
140
120
20
0
5 Hz 10 Hz 20 Hz
Pseudospectral methods
Numerics and Green‘s Functions
∂ t2 p = c 2 Δ p
∂ t2 p = δ ( x )δ ( t ) + c 2 Δ p
the formal solution to this equation is
1 δ (t − x / c )
p ( x, t) =
4π c 2 x
(Full proof given in Aki and Richards, Quantitative Seismology, Freeman+Co, 1981, p. 65)
Pseudospectral methods
Numerical Green‘s functions
3 point operator 5 point operator Fourier Method
10 10 10
8 8 8
7 7 7
Frequency increases
6 6 6
5 5 5
4 4 4
3 3 3
2 2 2
1 1 1
0 0 0
500 1000 1500 500 1000 1500 500 100
Pseudospectral methods
Pseudospectral Methods - Summary