0% found this document useful (0 votes)
41 views20 pages

04 Pseudospectralmethods

spectralmethods

Uploaded by

Rahul Tanwar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views20 pages

04 Pseudospectralmethods

spectralmethods

Uploaded by

Rahul Tanwar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 20

Pseudospectral methods

Pseudospectral Methods

What is a pseudo-spectral Method?
Fourier Derivatives
The Acoustic Wave Equation with the Fourier Method
Comparison with the Finite-Difference Method
Dispersion and Stability of Fourier Solutions

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.


1
Pseudospectral methods
What is pseudospectral?
Spectral solutions to time-dependent PDEs are formulated
in the frequency-wavenumber domain and solutions are
obtained in terms of spectra (e.g. seismograms). This
technique is particularly interesting for geometries where
partial solutions in the e-k domain can be obtained
analytically (e.g. for layered models).

In the pseudo-spectral approach - in a finite-difference like
manner - the PDEs are solved pointwise in physical space
(x-t). However, the space derivatives are calculated using
orthogonal functions (e.g. Fourier Integrals, Chebyshev
polynomials). They are either evaluated using matrix-
matrix multiplications, fast Fourier transform (FFT), or
convolutions.


Pseudospectral methods
Fourier Derivatives

}
}

=
|
|
.
|

\
|
c = c
dk e k ikF
dk e k F x f
ikx
ikx
x x
) (
) ( ) (
.. let us recall the definition of the derivative using Fourier integrals ...
... we could either ...

1) perform this calculation in the space domain by convolution

2) actually transform the function f(x) in the k-domain and back
Pseudospectral methods
The acoustic wave equation
let us take the acoustic wave equation with variable density
|
|
.
|

\
|
c c = c p p
c
x x t

1 1
2
2
the left hand side will be expressed with our
standard centered finite-difference approach
| |
|
|
.
|

\
|
c c = + + p dt t p t p dt t p
dt c
x x

1
) ( ) ( 2 ) (
1
2 2
... leading to the extrapolation scheme ...
Pseudospectral methods
The Fourier Method: acoustic wave propagation
where the space derivatives will be calculated using the Fourier Method.
The highlighted term will be calculated as follows:
) ( ) ( 2
1
) (
2 2
dt t p t p p dt c dt t p
x x
+
|
|
.
|

\
|
c c = +

n
j x
n n n
j
P P ik P P c
1
FFT

FFT
u u u
multiply by 1/
|
|
.
|

\
|
c c
|
|
.
|

\
|
c
|
|
.
|

\
|
c c
n
j x x
n
x
n
x
n
j x
P P ik P P

u
u
u
1
FFT

1
FFT
1
1
... then extrapolate ...
Pseudospectral methods
and in 3D
) ( ) ( 2
1 1 1
) (
2 2
dt t p t p
p p p dt c
dt t p
z z y y x x
+
|
|
.
|

\
|
|
|
.
|

\
|
c c +
|
|
.
|

\
|
c c +
|
|
.
|

\
|
c c
= +

n
j x
n n n
j
P P ik P P c
1
FFT

FFT
u u u
|
|
.
|

\
|
c c
|
|
.
|

\
|
c
|
|
.
|

\
|
c c
n
j x x
n
x
n
x
n
j x
P P ik P P

u
u
u
1
FFT

1
FFT
1
1
.. where the following algorithm applies to each space dimension ...
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;
if nop==3; d=[1 -2 1]/dx^2; end
if nop==5; d=[-1/12 4/3 -5/2 4/3 -1/12]/dx^2; end
df=[1:nx]*0;
for i=1:nop;
df=df+d(i).*cshift1d(f,-n2+(i-1));
end
Pseudospectral methods
and as PS
... and the first derivative using FFTs ...
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;
% FFT and IFFT
ff=fft(f); ff=k.*ff; df=real(ifft(ff));
.. simple and elegant ...
Pseudospectral methods
Dispersion and Stability
) ( dt n kjdx i n
j
e p
e
=
) ( 2 2 ndt kjdx i n
j x
e k p
e
= c
) ( 2
2
2
2
sin
4
ndt kjdx i n
j t
e
dt
dt
p
e
e

= c
2
sin
2 dt
cdt
k
e
=
Pseudospectral methods
Dispersion and Stability

What are the consequences?

a) when dt << 1, sin
-1
(kcdt/2) ~kcdt/2 and w/k=c
-> practically no dispersion
b) the argument of asin must be smaller than one.





2
sin
2 dt
cdt
k
e
= )
2
( sin
2
1
kcdt
dt

= e
636 . 0 / 2 /
1
2
max
~ s
s
t dx cdt
cdt k
Pseudospectral methods
Results @ 10Hz

Example of acoustic 1D wave simulation.
FD3 -point operator
red-analytic; blue-numerical; green-difference

0 200 400 600
-0.5
0
0.5
1
Source time function
0 10 20 30
0
0.5
1
Gauss in space
0.8 0.9 1 1.1 1.2 1.3 1.4 1.5
-0.5
0
0.5
1
Time (sec)
3 point - 2 order; T = 6.6 s, Error = 50.8352%
Pseudospectral methods
Results @ 10Hz

Example of acoustic 1D wave simulation.
FD 5 -point operator
red-analytic; blue-numerical; green-difference

0 200 400 600
-0.5
0
0.5
1
Source time function
0 10 20 30
0
0.5
1
Gauss in space
0.8 0.9 1 1.1 1.2 1.3 1.4 1.5
-0.5
0
0.5
1
Time (sec)
5 point - 2 order; T = 7.8 s, Error = 3.9286%
Pseudospectral methods
Results @ 10Hz

Example of acoustic 1D wave simulation.
Fourier operator
red-analytic; blue-numerical; green-difference

0 200 400 600
-0.5
0
0.5
1
Source time function
0 10 20 30
0
0.5
1
Gauss in space
0.8 0.9 1 1.1 1.2 1.3 1.4 1.5
-1
-0.5
0
0.5
1
Time (sec)
Fourier - 2 order; T = 35 s, Error = 2.72504%
Pseudospectral methods
Results @ 20Hz

Example of acoustic 1D wave simulation.
FD3 -point operator
red-analytic; blue-numerical; green-difference

0 200 400 600
-0.5
0
0.5
1
Source time function
0 10 20 30
0
0.5
1
Gauss in space
0.8 0.9 1 1.1 1.2 1.3 1.4 1.5
-1
-0.5
0
0.5
1
Time (sec)
3 point - 2 order; T = 7.8 s, Error = 156.038%
Pseudospectral methods
Results @ 20Hz

Example of acoustic 1D wave simulation.
FD 5 -point operator
red-analytic; blue-numerical; green-difference

0 200 400 600
-0.5
0
0.5
1
Source time function
0 10 20 30
0
0.5
1
Gauss in space
0.8 0.9 1 1.1 1.2 1.3 1.4 1.5
-0.5
0
0.5
1
Time (sec)
5 point - 2 order; T = 7.8 s, Error = 45.2487%
Pseudospectral methods
Results @ 20Hz

Example of acoustic 1D wave simulation.
Fourier operator
red-analytic; blue-numerical; green-difference

0 200 400 600
-0.5
0
0.5
1
Source time function
0 10 20 30
0
0.5
1
Gauss in space
0.8 0.9 1 1.1 1.2 1.3 1.4 1.5
-1
-0.5
0
0.5
1
Time (sec)
Fourier - 2 order; T = 34 s, Error = 18.0134%
Pseudospectral methods
Computational Speed
Difference (%) between numerical and analytical solution
as a function of propagating frequency
Simulation time
5.4s
7.8s
33.0s
0
20
40
60
80
100
120
140
160
5 Hz 10 Hz 20 Hz
3 point
5 point
Fourier
Pseudospectral methods
Numerics and Greens Functions
The concept of Greens Functions (impulse responses) plays an
important role in the solution of partial differential equations. It is also
useful for numerical solutions. Let us recall the acoustic wave equation
p c p
t
A = c
2 2
with A being the Laplace operator. We now introduce a delta source in
space and time
p c t x p
t
A + = c
2 2
) ( ) ( o o
the formal solution to this equation is
x
c x t
c
t x p
) / (
4
1
) , (
2

=
o
t
(Full proof given in Aki and Richards, Quantitative Seismology, Freeman+Co, 1981, p. 65)
Pseudospectral methods
500 1000 1500
0
1
2
3
4
5
6
7
8
9
10
500 1000 1500
0
1
2
3
4
5
6
7
8
9
10
500 1000 1500
0
1
2
3
4
5
6
7
8
9
10
Numerical Greens functions
3 point operator 5 point operator Fourier Method
F
r
e
q
u
e
n
c
y

i
n
c
r
e
a
s
e
s

I
m
p
u
l
s
e

r
e
s
p
o
n
s
e

(
a
n
a
l
y
t
i
c
a
l
)

c
o
n
c
o
l
v
e
d

w
i
t
h

s
o
u
r
c
e

I
m
p
u
l
s
e

r
e
s
p
o
n
s
e

(
n
u
m
e
r
i
c
a
l

c
o
n
v
o
l
v
e
d

w
i
t
h

s
o
u
r
c
e

Pseudospectral methods
Pseudospectral Methods - Summary
The Fourier Method can be considered as the limit of the finite-difference
method as the length of the operator tends to the number of points
along a particular dimension.

The space derivatives are calculated in the wavenumber domain by
multiplication of the spectrum with ik. The inverse Fourier transform
results in an exact space derivative up to the Nyquist frequency.

The use of Fourier transform imposes some constraints on the
smoothness of the functions to be differentiated. Discontinuities lead
to Gibbs phenomenon.

As the Fourier transform requires periodicity this technique is particular
useful where the physical problems are periodical (e.g. angular
derivatives in cylindrical problems).

Pseudospectral methods play a minor role in seismology today but the
principal of spectral accuracy plays an important role in spectral
element methods

You might also like