Documentation for NonlinearSchrodinger.jl's public API.

Contents

Index

API

NonlinearSchrodinger.BoxMethod
function Box(xᵣ::Pair, T; dx, Nₓ, Nₜ, n_periods)

Create a ::Box object with Nₜ transverse nodes, Nₓ longitudinal nodes (or dx grid spacing in the lontidunal direction, only one option can be specified), of size [(xᵣ.first), (xᵣ.second)] in the longitudinal direction and [(-T*n_periods/2), (T*n_periods/2))

source
NonlinearSchrodinger.CalcMethod
function Calc(λ::Array{Complex{TT}}, tₛ, xₛ, seed, box; m=0.0) where TT <: Real

Create a ::Calc object with eigenvalues λ, shifts xₛ and tₛ and seeding solution seed. box::Box is the Box object used for the calculation and m is the elliptic parameter for cnoidal solutions. seed can have the following values:

seed = "0" $\implies \psi_0 = 0$

seed = "exp" $\implies \psi_0 = e^{ix}$

seed = "dn" $\implies \psi_0 = dn(t, m)e^{ix(1-m/2)}$

seed = "cn" $\implies \psi_0 = \sqrt{m}cn(t, m)e^{ix(m - 1/2)}$

f::Dict{Symbol, Float64} is a dictionary of extended NLSE parameters.

See also: Box

source
NonlinearSchrodinger.SimMethod
function Sim(λ, box::Box, ψ₀::Array{Complex{TT}, 1}, T̂; α = 0.0, ϵ=0.0, β=0.0) where TT <: Rea

Create a ::Sim object corresponding to eigenvalue λ (only used for breathers, ignored for arbitrary initial conditions), initial condition ψ₀ and algorithm . α is the Hirota equation parameter and ϵ is the Sasa-Satsuma equation parameter. β controls pruning.

See also: Box

source
NonlinearSchrodinger.compute_IoM!Method
function compute_IoM!(obj)

Computes the integrals of motion of obj.ψ and saves them in respective fields of obj. obj can be a ::Sim or ::Calc object. The fields are:

obj.KE  # Array containing the kinetic energy K(x)
obj.PE  # Array containing the potential energy V(x)
obj.E   # Array containing the energy H(x)
obj.N   # Array containing the norm N(x)
obj.P   # Array containing the momentum P(x)
obj.dE  # Array containing the energy error δE(x)
obj.dN  # Array containing the norm error δN(x)
obj.dP  # Array containing the momentum error δP(x)

Result can be plotted using plot(obj, :IoM)

source
NonlinearSchrodinger.paramsMethod
function params(; kwargs...)

Computes parameters λ, T, Ω given either of λ, T, Ω, a and possibly m for dnoidal seed. Used only for exp and dn seeds.

source
NonlinearSchrodinger.λ_given_fMethod
λ_given_f(f, ν)

Computes λ = v + i ν such that v results in breather to soliton conversion for the extended NLS characterized by the dictionary of parameters f.

source
NonlinearSchrodinger.ψ₀_DTMethod
ψ₀_DT(λ, tₛ, xₛ, X₀, box; seed="exp", f = Dict(:α=> 0.0, :γ => 0.0, :δ=>0.0))

Computes an initial condition using the DT characterized by λ, xₛ, tₛ and seed at x = X₀ for the extended equation characterized by a dictionary of parameters f (currently only α) is supported. box::Box is the simulation box.

See also: Calc, Sim

source
NonlinearSchrodinger.ψ₀_periodicMethod
function ψ₀_periodic(coeff::Array, box::Box, Ω; phase=0)

Computes an initial wavefunction for the box::Box, with fundamental frequency Ω and coefficients $A_{1\ldots n}$ = coeff and an overall phase $e^{i \phi t}$ where $\phi$ = phase. i.e. $\psi_0$ is of the form:

$\psi(x=0, t) = e^{i \phi t} (A_0 + 2 \sum_{1}^{n} A_m \cos(m \Omega t))$

where:

$A_0 = \sqrt{1 - 2 \sum_{m=1}^n |A_m|^2}$

source