An Introduction To The Split Step Fourier Method Using MATLAB
An Introduction To The Split Step Fourier Method Using MATLAB
net/publication/281441538
CITATIONS READS
10 40,171
1 author:
Pablo Suarez
Delaware State University
13 PUBLICATIONS 139 CITATIONS
SEE PROFILE
All content following this page was uploaded by Pablo Suarez on 02 September 2015.
Abstract
The Split Step Fourier Method provides an excellent methodology
for learning and teaching how to solve time dependent partial differ-
ential equations. This method is ubiquitously used in engineering and
physics applications. In this article, we present the simplicity of this
method by solving the Linear and Nonlinear Schrödinger Equation
and with the aid of MATLAB, we demonstrate a straight forward im-
plementation. Extension to other type of problems are also discussed
with the corresponding codes. This article illustrates a very powerful
numerical technique that can be implemented quite easily.
1 Introduction
The Split Step Fourier Method(SSFM) is a part of the the family of pseudo-
spectral methods used to solve time dependent nonliner partial differential
equation. The approach followed by SSFM follows the old age strategy of
divide and conquer. The nonlinear PDE is divided into related sub-problems
of the original equation. The method is easy to understand and with the use
of MATLAB the implementation is straight forward.
In this article, we shall illustrate the implementation of the Fourier Split
Method using MATLAB. We shall discuss the numerical solution of a variety
of examples. We begin with the one dimesional linear Schrödinger Equation,
the nonliner Schrd̈oinger equation, systems of the Schrodinger and the 2D
Schrödinger equation. For a more detailed discussion on the origins and
development of the method, the reader may wish to refer to books listed in
1
the references such as [7], [8] and [9]. We shall also assume that the reader
has a basic knowledge of MATLAB programming, although the reader may
also wish to consult a standard text on MATLAB such as [10].
∂u
= iLu + iN u, −∞ < x < ∞, (2)
∂t
where
1 ∂2
L=− and N = −V (x). (3)
2 ∂x2
Consider a small interval of time, say [τ, τ + ∆t]. Now assume that u(τ, x) is
known and assume that L is negligible, that is uxx ≈ 0. Then (1) reduces to
∂u
i = Nu (4)
∂t
2
This approximation leads to an ordinary differential equation (ODE) in time.
The solution to this ODE is known and the solution at time t = τ + ∆t is
given by
u(x, τ + ∆t) = exp (i∆tN ) u(x, τ ). (5)
Next, we redo the problem but neglect the contribution of N . For this case
the PDE is linear with no variable coefficients,
∂u
= iLu. (6)
∂t
This equation will be solved in the interval [τ, τ + ∆t] and use u(x, τ + ∆t)
as the initial condition. An analytical solution to this equation can be by
taking the Fourier Transform
2
∂ û ∂ u
= iF(Lu) = iF = −ik 2 û. (7)
∂t ∂x2
In this work we use the following Fourier and Inverse Fourier Transform
definitions
Z ∞
ĥ(k) = F(h) = h(x)e−2πikx dx (8)
Z−∞
∞
h(x) = F(ĥ) = ĥ(k)e2πikx dk (9)
−∞
The partial derivatives are now gone and the equation becomes an ODE. The
analytical solution can be computed and value of û(x, τ + ∆t) is given by
The essence of the split method is to think of advancing in time and applying
L and N one at a time to complete each time step.
3
3 Implementation
In this section we discuss the algorithm of SSFM, the MATLAB implemeta-
tion of it and show some numerical experiments.
u(n) ← u0
k ← 2π
L
(−N/2 : 1 : N/2 − 1)
← 1 to M
for n
u(n+1/2) ← exp (i∆tV (x)) u(n)
û(n+1/2) ← F(u(n+1/2) )
do û(n+1) ← exp(−i∆tk 2 )û(n+1/2)
u(n+1) ← F −1 (û(n+1) )
(n)
u ← u(n+1)
return (un )
4
Algorithm 3.2: SSFM(u0 , un , M )
u(n) ← u0
for j ← 1 to M
u(n) ← F −1 exp (−ik 2 ∆t) · F exp (i∆tV (x)) u(n)
return (un )
5
0.7 −3
x 10
Exact Solution 4.5
Numerical Solution
0.6 4
3.5
0.5
3
0.4
u(x, t ) 2.5
E rro r
0.3 2
1.5
0.2
0.1
0.5
0 0
−10 −8 −6 −4 −2 0 2 4 6 8 10 −10 −8 −6 −4 −2 0 2 4 6 8 10
x x
MaxE rror
−4
10
−5
10
0 1 2 3 4 5 6 7 8 9 10
t
The linear part for this case has not changed and can be handled again
by taking Fourier Transform. If L is a differential operator with constant
coefficient only then we have
u(x, τ + ∆t) = F −1 exp i∆tL̂ · F (exp (i∆tN ) u(x, τ )) (20)
The code used in section 3 is modified and can be seen in the appendix.
7
(a) Numerical Solution (b) Exact Solution
8
where H is the Hilbert Transform definde as
1 ∞ f (y)
Z
H{f }(x) = dy
π −∞ y − x
6 Conclusions
In this article we presented the SSFM for solving linear and nonlinear Schrödinger
equation. Algorithms and MATLAB implementation were presented for
SSFM for both these equations. The algorithm showed the simplicity of
the method for both cases and thanks to MATLAB the implementation was
shown to be direct. Numerical examples were also shown to show the effi-
ciency of the method. We hope that this article can serve as stepping stone
for introductiong SSFM to undergraduates in a scientific computing course
or as a self study tutorial for advanced undergraduates/beginning graduate
conducting research.
9
References
[1] K-C Ang. Introducing the boundary element method with Matlab. Inter-
national Journal of Mathematical Education in Science and Technology,
39(4):505–519, 2008.
[3] J Boyd. Chebyshev and Fourier Spectral Methods. Dover, New York,
2001.
[4] Y W Kwon and H Bang. The Finite Element Method using Matlab. CRC
Press, New York, 1st edition, 1996.
[5] G M Muslu and H A Erbay. Higher-order split-step fourier schemes for the
generalized nonlinear schrödinger equation. Mathematics and Computers
in simulation, 67:581–595, 2005.
[7] T R Taha and X Xu. Parallel Split-Step Fourier Methods for the coupled
nonlinear Schrö dinger type equations. The Journal of Supercomputing,
5:5–23, 2005.
[8] JAC Weideman and B M Herbst. Split-step methods for the solution of
the nonlinear Schrödinger equation. SIAM Journal on Numerical Analy-
sis, 23:485–507, 1986.
10
Appendix
In this appendix we present the codes used in this paper. All of the codes
required the standard MATLAB package and it has been tested to work with
the student version as well.
end
11
NLSE SSFM Implementation
N = 512; % Number of Fourier modes
dt = .001; % Time step
tfinal = 10; % Final time
M = round(tfinal./dt); % Total number of time steps
J = 100; % Steps between output
L = 50; % Space period
h = L/N; % Space step
n =( -N/2:1:N/2-1)’; % Indices
x = n*h; % Grid points
u = exp(1i*x).*sech(x);%Intial condition
k = 2*n*pi/L; % Wavenumbers.
end
12
2D LSE SSFM Implementation
N =
256; % Number of Fourier modes
dt =
.0001; % Time step
tfinal =
6; % Final time
M =
round(tfinal/dt); % Total number of time steps
L =
10; % Space period
h =
L/N; % Space step
n =
[-N/2:1:N/2-1]’; % Indices
x =
n*h; % Grid points along x
y =
n*h; % Grid points along y
[X,Y] =
meshgrid(x,y);
u0 =
(exp(-X.^2/2 - Y.^2/2).*(-2 + 4*X.^2).*...
(-12*Y + 8*Y.^3))/(8*sqrt(6*pi));
u = u0; % Initial condition
k = 2*n*pi/L; % Wavenumbers.
[Ex,Ey] = meshgrid(e,e); % Wavenumbers along both directions.
end
13
B-O Equation SSFM Implementation
N = 256; % Number of Fourier modes
dt = .001; % Time step
tfinal = 6; % Final time
M = round(tfinal/dt); % Total number of time steps
L = 200; % Space period
h = L/N; % Space step
n = [-N/2:1:N/2-1]’; % Indices
x = n*h; % Grid points
kk = 1/(2*sqrt(13));
cc = .2;
u = 4*cc./(1 + cc^2*x.^2); % Compute IC
k = 2*n*pi/L; % Wavenumbers.
end
14