Reference
PoincareInvariants
— ModulePoincareInvariants
A Julia library for the computation of Poincaré integral invariants.
Fundamentals
PoincareInvariants.compute!
— Functioncompute!(pinv::AbstractPoincareInvariant, points::AbstractMatrix, t::Real=NaN, p=nothing)
computes a Poincaré invariant using setup object pinv
, where points
represents the image of the curve or surface parameterisation evaluated on some set of points, e.g. a grid.
t
is the time at which the invariant is evaluated p
are any user supplied optional arguments. Both t
and p
are passed directly to the differential form.
Plan implementations should define a method compute!(pinv, t::Real, p)
, which acts on the internal points storage pinv.points
.
compute!(pinv::AbstractPoincareInvariant, points::AbstractVector{<:AbstractVector},
times::Union{AbstractVector{<:Real}, Real}=NaN, p=nothing)
computes a Poincaré invariant, using the setup object pinv
, at each time for a set of trajectories given by points
.
points
represents an AbstractVector of trajectories. Each element of points
is a trajectory, which is itself an AbstractVector
of some kind of iterable or vector. times
is either a constant, like NaN
, or a vector of the times at which the trajectories have been evaluated, i.e. the i-th phase space position in each trajectory was evaluated at time times[i]
. p
is an arbitrary optional parameter which is passed to the differential form, like the the time.
PoincareInvariants.FirstPoincareInvariant
— TypeFirstPoincareInvariant{T, D, θT, P} <: AbstractPoincareInvariant{T, D}
FirstPI{T, D, θT, P} <: AbstractPoincareInvariant{T, D}
setup object to compute the first invariant.
PoincareInvariants.FirstPoincareInvariant
— MethodFirstPoincareInvariant{T, D}(θ::θT, N::Integer, plan::P)
constructs a FirstPoincareInvariant
setup object to calculate integral invariants, given a numeric type T
, a phase space dimension D
, a differential form θ
, a number of points N
and a plan
. Note that the number of points may not be exactly N
. The true number used depends on the implementation and is guaranteed to be no smaller than N
and not too much larger.
PoincareInvariants.FirstPoincareInvariant
— MethodFirstPoincareInvariant{T, D}(θ::θT, N::Integer, P::Type=DEFAULT_FIRST_PLAN)
constructs a FirstPoincareInvariant
setup object to calculate integral invariants, given a numeric type T
, a phase space dimension D
, a differential form θ
, a number of points N
and a plan
type P
, to be initialised and used for future computation.
The plan type defaults to DEFAULT_FIRST_PLAN
, which is currently set to FirstFourierPlan
.
PoincareInvariants.FirstPoincareInvariant
— MethodFirstPoincareInvariant{T, D, typeof(canonical_one_form)}(N::Integer, P=DEFAULT_FIRST_PLAN)
CanonicalFirstPI{T, D}(N::Integer, P=DEFAULT_FIRST_PLAN)
creates a setup object to compute the first integral invariant using the canonical one form in phase space of dimension D
with numeric type T
, N
points and plan type P
.
PoincareInvariants.SecondPoincareInvariant
— TypeSecondPoincareInvariant{T, D, ωT, PS, P} <: AbstractPoincareInvariant{T, D}
SecondPI{T, D, ωT, PS, P} <: AbstractPoincareInvariant{T, D}
setup object used to compute the second invariant.
PoincareInvariants.SecondPoincareInvariant
— MethodSecondPoincareInvariant{T, D}(ω, N, plan::P)
constructs a SecondPoincareInvariant
setup object to calculate integral invariants, given a numeric type T
, a phase space dimension D
, a differential form ω
, a point specification N
, usually a number of points, and a plan
.
PoincareInvariants.SecondPoincareInvariant
— MethodSecondPoincareInvariant{T, D}(ω, N, P::Type=DEFAULT_SECOND_PLAN)
constructs a SecondPoincareInvariant
setup object to calculate integral invariants, given a numeric type T
, a phase space dimension D
, a differential form ω
, a point specification N
and a plan
type P
, to be initialised and used for future computation.
The plan type defaults to DEFAULT_SECOND_PLAN
, which is currently set to SecondChebyshevPlan
. Note that the number of points may not be exactly N
. The true number used depends on the implementation and is guaranteed to be no smaller than N
and not too much larger. For the SecondFinDiffPlan
, the grid of points may also be specified as a tuple (Nx, Ny)
, if non-square grids are sought.
PoincareInvariants.SecondPoincareInvariant
— MethodSecondPoincareInvariant{T, D, CanonicalSymplecticMatrix{T}}(N, P=DEFAULT_FIRST_PLAN)
CanonicalSecondPI{T, D}(N, P=DEFAULT_FIRST_PLAN)
creates a setup object to compute the second integral invariant using the canonical two form in phase space of dimension D
with numeric type T
, point specification N
and plan type P
.
Interface
PoincareInvariants.AbstractPoincareInvariant
— TypeAbstractPoincareInvariant{T, D}
represents a Poincare integral invariant in a phase space of dimension D
using numeric type
T` for calculations.
PoincareInvariants.getpoints
— Functiongetpoints(pinv::AbstractPoincareInvariant)
returns points on which to evaluate the phase space line or surface parameterisation so as to compute!
pinv
.
PoincareInvariants.getpointnum
— Functiongetpointnum(pinv::AbstractPoincareInvariant)
returns number of points to sample in phase space to compute!
pinv
.
PoincareInvariants.getpointspec
— Functiongetpointspec(pinv::AbstractPoincareInvariant)
get point specification, which may, for example, be a tuple specifying a grid or a number giving the number of points used to sample in phase space.
PoincareInvariants.getdim
— Functiongetdim(pinv::AbstractPoincareInvariant)
returns dimension of phase space to compute!
pinv
in.
PoincareInvariants.getform
— Functiongetform(pinv::AbstractPoincareInvariant)
get invariant one- or two-form.
PoincareInvariants.getplan
— Functiongetplan(pinv::AbstractPoincareInvariant)
returns the plan that will be used to compute!
pinv
.
Canonical Symplectic Forms
PoincareInvariants.CanonicalSymplecticForms.CanonicalSymplecticMatrix
— TypeCanonicalSymplecticMatrix{T}(n::Integer)
constructs a canonical symplectic matrix of size (n, n)
with eltype T
. n
must be even and positive. See the examples to see the form of the canonical symplectic matrix as defined here.
Examples
julia> CanonicalSymplecticMatrix(4)
4×4 CanonicalSymplecticMatrix{Int64}:
0 0 -1 0
0 0 0 -1
1 0 0 0
0 1 0 0
julia> CanonicalSymplecticMatrix{Int32}(6)
6×6 CanonicalSymplecticMatrix{Int32}:
0 0 0 -1 0 0
0 0 0 0 -1 0
0 0 0 0 0 -1
1 0 0 0 0 0
0 1 0 0 0 0
0 0 1 0 0 0