Example implementing the \(N\)-dimensional nonlinear Schrödinger equation with periodic boundary conditions
\[\frac{\partial u}{\partial t} = -i \Delta u + 2 c i |u|^2 u\]
for fixed parameter \(c\) and \(N=2, 3\). The linear parts of the problem will be discretized using
mpi4py-fft[1]_. For time-stepping, the problem will be solved fully-implicitly, i.e., the nonlinear system containing
the full right-hand side is solved by GMRES method.
Example implementing the \(N\)-dimensional nonlinear Schrödinger equation with periodic boundary conditions
\[\frac{\partial u}{\partial t} = -i \Delta u + 2 c i |u|^2 u\]
for fixed parameter \(c\) and \(N=2, 3\). The linear parts of the problem will be solved using
mpi4py-fft[1]_. Semi-explicit time-stepping is used here to solve the problem in the temporal dimension, i.e., the
Laplacian will be handled implicitly.
Parameters:
nvars (tuple, optional) – Spatial resolution
spectral (bool, optional) – If True, the solution is computed in spectral space.
L (float, optional) – Denotes the period of the function to be approximated for the Fourier transform.
c (float, optional) – Nonlinearity parameter.
comm (MPI.COMM_World) – Communicator for parallelisation.