Public API

This page lists exported symbols of CTFlows.Systems.


From CTFlows.Systems

CTFlows.Systems [Module]

CTFlows.SystemsModule
Systems

System types and contracts for CTFlows.

This module defines the AbstractSystem type and its required methods:

  • get_ip_rhs: returns the in-place right-hand side function for integration
  • get_oop_rhs: returns the out-of-place right-hand side function for integration
  • get_ip_rhs_augmented: returns the augmented in-place right-hand side for Hamiltonian systems
  • dimensions: returns dimensional information (state, costate, control, variable)

AbstractHVFRHS [Abstract Type]

CTFlows.Systems.AbstractHVFRHSType
AbstractHVFRHS{T<:Traits.AbstractMutabilityTrait} <: AbstractRHS{T}

Abstract base type for HamiltonianVectorField RHS functors.

Provides a common supertype for all Hamiltonian vector field functors, enabling generic display methods that access the .hvf field.

Type Parameters

  • T <: Traits.AbstractMutabilityTrait: The mutability trait (InPlace or OutOfPlace).

AbstractHamRHS [Abstract Type]

CTFlows.Systems.AbstractHamRHSType
abstract type AbstractHamRHS{T<:CTBase.Traits.AbstractMutabilityTrait} <: CTFlows.Systems.AbstractRHS{T<:CTBase.Traits.AbstractMutabilityTrait}

Abstract supertype for Hamiltonian right-hand side (RHS) functors.

RHS functors compute the derivatives for Hamiltonian systems according to Hamilton's equations. The type parameter encodes the mutability trait (in-place vs out-of-place) for compile-time dispatch.

Type Parameters

  • T <: AbstractMutabilityTrait: Mutability trait (InPlace or OutOfPlace).

Interface Requirements

All subtypes must implement a callable interface:

  • In-place: (f::SubType)(du, u, λ, t) for mutating output
  • Out-of-place: (f::SubType)(u, λ, t) -> du for allocating output

Notes

See also: CTFlows.Systems.AbstractRHS, CTFlows.Systems.HamIpRHS, CTFlows.Systems.HamOoPRHS.

AbstractHamiltonianSystem [Abstract Type]

CTFlows.Systems.AbstractHamiltonianSystemType
abstract type AbstractSystem{TD, VD, CTBase.Traits.HamiltonianDynamics}

Alias for Hamiltonian systems.

Matches any AbstractSystem with HamiltonianDynamics as the dynamics parameter. The AD capability is encoded as a plain trait (ad_trait) on the concrete type, not as a type parameter of this alias.

Type Parameters

  • TD <: TimeDependence: Time dependence trait (Autonomous or NonAutonomous)
  • VD <: VariableDependence: Variable dependence trait (Fixed or NonFixed)

Example

julia> using CTFlows.Systems

julia> HamiltonianSystem <: Systems.AbstractHamiltonianSystem
true

See also: CTFlows.Systems.AbstractSystem, CTFlows.Systems.AbstractStateSystem.

AbstractIPHVFRHS [Abstract Type]

AbstractIPHamRHS [Abstract Type]

CTFlows.Systems.AbstractIPHamRHSType
abstract type AbstractIPHamRHS <: CTFlows.Systems.AbstractHamRHS{CTBase.Traits.InPlace}

Abstract supertype for in-place Hamiltonian RHS functors.

Subtypes of this abstract type implement in-place computation of Hamiltonian derivatives, mutating the output vector du rather than allocating a new one.

Notes

See also: CTFlows.Systems.AbstractHamRHS, CTFlows.Systems.AbstractOoPHamRHS.

AbstractIPRHS [Abstract Type]

CTFlows.Systems.AbstractIPRHSType
AbstractIPRHS <: AbstractRHS{Traits.InPlace}

Abstract supertype for in-place RHS functors.

These functors have the signature (du, u, λ, t) -> nothing and modify du in place.

AbstractOoPHVFRHS [Abstract Type]

CTFlows.Systems.AbstractOoPHVFRHSType
AbstractOoPHVFRHS <: AbstractHVFRHS{Traits.OutOfPlace}

Abstract base type for out-of-place HamiltonianVectorField RHS functors.

AbstractOoPHamRHS [Abstract Type]

CTFlows.Systems.AbstractOoPHamRHSType
abstract type AbstractOoPHamRHS <: CTFlows.Systems.AbstractHamRHS{CTBase.Traits.OutOfPlace}

Abstract supertype for out-of-place Hamiltonian RHS functors.

Subtypes of this abstract type implement out-of-place computation of Hamiltonian derivatives, allocating and returning a new output vector.

Notes

See also: CTFlows.Systems.AbstractHamRHS, CTFlows.Systems.AbstractIPHamRHS.

AbstractOoPRHS [Abstract Type]

CTFlows.Systems.AbstractOoPRHSType
AbstractOoPRHS <: AbstractRHS{Traits.OutOfPlace}

Abstract supertype for out-of-place RHS functors.

These functors have the signature (u, λ, t) -> du and return a new array without modifying the input.

AbstractRHS [Abstract Type]

CTFlows.Systems.AbstractRHSType
AbstractRHS{T<:Traits.AbstractMutabilityTrait}

Abstract supertype for all RHS functors.

Parameterized by the interface mutability trait:

  • Traits.InPlace: in-place interface (du, u, λ, t) -> nothing
  • Traits.OutOfPlace: out-of-place interface (u, λ, t) -> du

AbstractStateSystem [Abstract Type]

CTFlows.Systems.AbstractStateSystemType
abstract type AbstractSystem{TD, VD, CTBase.Traits.StateDynamics}

Alias for state systems (non-Hamiltonian).

Matches any AbstractSystem with StateDynamics as the dynamics parameter.

Type Parameters

  • TD <: TimeDependence: Time dependence trait (Autonomous or NonAutonomous)
  • VD <: VariableDependence: Variable dependence trait (Fixed or NonFixed)

Example

julia> using CTFlows.Systems

julia> VectorFieldSystem <: Systems.AbstractStateSystem
true

See also: CTFlows.Systems.AbstractSystem, CTFlows.Systems.AbstractHamiltonianSystem.

AbstractSystem [Abstract Type]

CTFlows.Systems.AbstractSystemType
abstract type AbstractSystem{TD<:CTBase.Traits.TimeDependence, VD<:CTBase.Traits.VariableDependence, D<:CTBase.Traits.AbstractDynamicsTrait}

Abstract type for all systems in CTFlows.

An AbstractSystem represents a fully assembled object that can be integrated. It embeds its own rhs, dimensional metadata, and solution-building logic.

Contract

All subtypes must implement:

  • rhs(system::AbstractSystem): Returns a function (du, u, p, t) -> nothing that fills du in place.

Example

using CTFlows.Systems
using CTFlows.Common

# Define a concrete system
struct MySystem <: Systems.AbstractSystem{Traits.Autonomous, Traits.Fixed, Traits.StateDynamics}
    data::Vector{Float64}
end

# Implement required contract method
function Systems.rhs(sys::MySystem)
    return (du, u, p, t) -> du .= sys.data .* u
end

See also: CTFlows.Systems.rhs, CTBase.Traits.time_dependence, CTBase.Traits.variable_dependence.

HamiltonianSystem [Struct]

CTFlows.Systems.HamiltonianSystemType
struct HamiltonianSystem{F<:Function, TD<:CTBase.Traits.TimeDependence, VD<:CTBase.Traits.VariableDependence, BACKEND<:CTBase.Differentiation.AbstractADBackend} <: CTFlows.Systems.AbstractSystem{TD<:CTBase.Traits.TimeDependence, VD<:CTBase.Traits.VariableDependence, CTBase.Traits.HamiltonianDynamics}

Concrete AbstractHamiltonianSystem wrapping a scalar Hamiltonian function with an AD backend.

The system does not store pre-computed RHS closures. Instead, closures are built lazily by build_rhs and build_oop_rhs based on the actual initial condition types, ensuring correct handling of scalar, vector (including length-1), and matrix inputs with consistent output shapes.

Type Parameters

  • F: concrete type of the wrapped Hamiltonian function.
  • TD <: TimeDependence: Autonomous or NonAutonomous.
  • VD <: VariableDependence: Fixed or NonFixed.
  • BACKEND <: AbstractADBackend: concrete AD backend type.

Fields

  • h::Hamiltonian{F, TD, VD}: the underlying scalar Hamiltonian function.
  • backend::BACKEND: the AD backend for gradient computation.

Example

julia> using CTFlows.Systems, CTFlows.Common, CTBase.Data

julia> h = Hamiltonian((t, x, p, v) -> 0.5 * sum(x.^2) + sum(p.^2); autonomous=true, variable=false)
Hamiltonian{var"#1", Autonomous, Fixed}

julia> sys = HamiltonianSystem(h, AutoForwardDiff())
HamiltonianSystem
  time_dependence: Autonomous
  variable_dependence: Fixed
  hamiltonian: Hamiltonian{var"#1", Autonomous, Fixed}
  backend: AutoForwardDiff()

See also: CTBase.Data.Hamiltonian, CTFlows.Systems.AbstractHamiltonianSystem, CTBase.Traits.AbstractADTrait, CTFlows.Systems.build_rhs, CTFlows.Systems.build_oop_rhs.

HamiltonianVectorFieldSystem [Struct]

CTFlows.Systems.HamiltonianVectorFieldSystemType
struct HamiltonianVectorFieldSystem{F<:Function, TD<:CTBase.Traits.TimeDependence, VD<:CTBase.Traits.VariableDependence, MD<:CTBase.Traits.AbstractMutabilityTrait} <: CTFlows.Systems.AbstractSystem{TD<:CTBase.Traits.TimeDependence, VD<:CTBase.Traits.VariableDependence, CTBase.Traits.HamiltonianDynamics}

Concrete AbstractHamiltonianSystem wrapping a HamiltonianVectorField.

The system does not store pre-computed RHS closures. Instead, closures are built lazily by build_rhs and build_oop_rhs based on the actual initial condition types, ensuring correct handling of scalar, vector (including length-1), and matrix inputs with consistent output shapes.

Type Parameters

  • F: concrete type of the wrapped HamiltonianVectorField function.
  • TD <: TimeDependence: Autonomous or NonAutonomous.
  • VD <: VariableDependence: Fixed or NonFixed.
  • MD <: AbstractMutabilityTrait: InPlace or OutOfPlace.

Fields

  • hvf::HamiltonianVectorField{F, TD, VD, MD}: the underlying Hamiltonian vector field.

Example

julia> using CTFlows.Systems, CTFlows.Common

julia> hvf = HamiltonianVectorField((x, p) -> (x, -p); autonomous=true, variable=false)
HamiltonianVectorField
  time_dependence: Autonomous
  variable_dependence: Fixed
  mutability: OutOfPlace
  function: var"#1"

julia> sys = HamiltonianVectorFieldSystem(hvf)
HamiltonianVectorFieldSystem
  time_dependence: Autonomous
  variable_dependence: Fixed
  mutability: OutOfPlace
  hamiltonian_vector_field: HamiltonianVectorField{var"#1", Autonomous, Fixed, OutOfPlace}

See also: CTBase.Data.HamiltonianVectorField, CTFlows.Systems.AbstractHamiltonianSystem, TimeDependence, CTBase.Traits.VariableDependence, CTFlows.Systems.build_rhs, CTFlows.Systems.build_oop_rhs.

VectorFieldSystem [Struct]

CTFlows.Systems.VectorFieldSystemType
struct VectorFieldSystem{F<:Function, TD<:CTBase.Traits.TimeDependence, VD<:CTBase.Traits.VariableDependence, MD<:CTBase.Traits.AbstractMutabilityTrait, RHS<:CTFlows.Systems.AbstractIPRHS, OOPROHS<:CTFlows.Systems.AbstractOoPRHS, FINRHS} <: CTFlows.Systems.AbstractSystem{TD<:CTBase.Traits.TimeDependence, VD<:CTBase.Traits.VariableDependence, CTBase.Traits.StateDynamics}

Concrete AbstractSystem wrapping a VectorField. The variable for NonFixed vector fields is not stored here; it is passed at flow-call time via the variable kwarg and threaded through ODEProblem's p slot wrapped in a Common.ODEParameters struct.

Fields

  • vf::VectorField{F, TD, VD, MD}: the underlying vector field.
  • rhs::RHS: the pre-computed in-place right-hand side closure with signature (du, u, p, t) -> nothing.
  • rhs_oop::OOPROHS: the pre-computed out-of-place right-hand side closure with signature (u, p, t) -> du.
  • rhs_oop_finalize::FINRHS: the finalize closure for in-place vector fields with immutable initial conditions, or nothing for out-of-place vector fields.

Example

julia> using CTFlows.Systems, CTFlows.Common

julia> vf = VectorField(x -> -x; autonomous=true, variable=false)
VectorField
  time_dependence: Autonomous
  variable_dependence: Fixed
  mutability: OutOfPlace
  function: var"#1"

julia> sys = VectorFieldSystem(vf)
VectorFieldSystem
  time_dependence: Autonomous
  variable_dependence: Fixed
  mutability: OutOfPlace
  vector_field: VectorField{var"#1", Autonomous, Fixed, OutOfPlace}

See also: CTBase.Data.VectorField, TimeDependence, CTBase.Traits.VariableDependence, CTFlows.Common.ODEParameters.

backend [Function]

CTFlows.Systems.backendFunction
backend(
    sys::CTFlows.Systems.HamiltonianSystem
) -> CTBase.Differentiation.AbstractADBackend

Return the automatic differentiation backend from a HamiltonianSystem.

Arguments

  • sys::HamiltonianSystem: The Hamiltonian system.

Returns

  • Differentiation.AbstractADBackend: The AD backend used for gradient computation.

See also: CTFlows.Systems.HamiltonianSystem, CTFlows.Systems.hamiltonian.

build_system [Function]

CTFlows.Systems.build_systemFunction
build_system(
    vf::CTBase.Data.AbstractVectorField
) -> CTFlows.Systems.HamiltonianVectorFieldSystem

Build a VectorFieldSystem from a VectorField.

Constructs a concrete system that wraps the vector field and pre-computes its right-hand side function for integration. The resulting system is ready for use with flow integration pipelines.

Arguments

  • vf::Data.AbstractVectorField: The vector field to wrap into a system.

Returns

  • VectorFieldSystem: A concrete system wrapping the vector field with a pre-computed RHS function.

Example

julia> using CTFlows.Systems, CTFlows.Common

julia> vf = VectorField(x -> -x; autonomous=true, variable=false)
VectorField
  time_dependence: Autonomous
  variable_dependence: Fixed
  function: var"#1"

julia> sys = build_system(vf)
VectorFieldSystem
  time_dependence: Autonomous
  variable_dependence: Fixed
  vector_field: VectorField{var"#1", Autonomous, Fixed}

See also: CTBase.Data.VectorField, CTFlows.Systems.VectorFieldSystem.

build_system(
    hvf::CTBase.Data.AbstractHamiltonianVectorField
) -> CTFlows.Systems.HamiltonianVectorFieldSystem

Build a HamiltonianVectorFieldSystem from a HamiltonianVectorField.

Constructs a concrete Hamiltonian system that wraps the Hamiltonian vector field. RHS closures are built lazily based on actual initial condition types during flow integration.

Arguments

  • hvf::Data.AbstractHamiltonianVectorField: The Hamiltonian vector field to wrap into a system.

Returns

  • HamiltonianVectorFieldSystem: A concrete Hamiltonian system.

Example

julia> using CTFlows.Systems, CTFlows.Common

julia> hvf = HamiltonianVectorField((x, p) -> (x, -p); autonomous=true, variable=false)
HamiltonianVectorField
  time_dependence: Autonomous
  variable_dependence: Fixed
  function: var"#1"

julia> sys = build_system(hvf)
HamiltonianVectorFieldSystem
  time_dependence: Autonomous
  variable_dependence: Fixed
  hamiltonian_vector_field: HamiltonianVectorField{var"#1", Autonomous, Fixed}

See also: CTBase.Data.HamiltonianVectorField, CTFlows.Systems.HamiltonianVectorFieldSystem.

build_system(
    h::CTBase.Data.AbstractHamiltonian,
    backend::CTBase.Differentiation.AbstractADBackend
) -> CTFlows.Systems.HamiltonianSystem

Build a CTFlows.Systems.HamiltonianSystem from a scalar Hamiltonian function with automatic differentiation.

Constructs a concrete Hamiltonian system that wraps the scalar Hamiltonian function with an AD backend. RHS closures are built lazily based on actual initial condition types during flow integration.

Arguments

  • h::Data.AbstractHamiltonian: The scalar Hamiltonian function to wrap into a system.
  • backend::Differentiation.AbstractADBackend: The automatic differentiation backend (e.g., AutoForwardDiff, AutoZygote).

Returns

  • HamiltonianSystem: A concrete Hamiltonian system with automatic differentiation support.

Example

julia> using CTFlows.Systems, CTFlows.Common, CTBase.Data

julia> h = Hamiltonian((t, x, p, v) -> 0.5 * sum(x.^2) + sum(p.^2); autonomous=true, variable=false)
Hamiltonian{var"#1", Autonomous, Fixed}

julia> sys = build_system(h, AutoForwardDiff())
HamiltonianSystem
  time_dependence: Autonomous
  variable_dependence: Fixed
  hamiltonian: Hamiltonian{var"#1", Autonomous, Fixed}
  backend: AutoForwardDiff()

Notes

  • The AD backend is used to compute Hamiltonian gradients ∂H/∂x and ∂H/∂p automatically during integration.
  • This overload is for scalar Hamiltonian functions where gradients are computed via AD. For explicit vector fields, use CTFlows.Systems.HamiltonianVectorFieldSystem instead.

See also: CTBase.Data.Hamiltonian, CTFlows.Systems.HamiltonianSystem, CTFlows.Systems.HamiltonianVectorFieldSystem, CTBase.Differentiation.AbstractADBackend.

get_ip_rhs [Function]

CTFlows.Systems.get_ip_rhsFunction
get_ip_rhs(
    system::CTFlows.Systems.AbstractSystem,
    config
) -> CTFlows.Systems.AbstractIPRHS

Return the in-place right-hand side function for a system given a configuration.

The returned function must have the signature (du, u, p, t) -> nothing and fill du in place with the derivative at state u, parameters p, and time t.

Eager systems (e.g., VectorFieldSystem) ignore the config and return pre-computed closures. Lazy systems (e.g., HamiltonianSystem) read x0/p0 from the config to build type-specific closures.

Arguments

  • system::AbstractSystem: The system.
  • config: The configuration containing initial conditions and time span.

Returns

  • Function: The in-place RHS closure with signature (du, u, p, t) -> nothing.

Throws

See also: CTFlows.Systems.get_oop_rhs, CTFlows.Systems.get_ip_rhs_augmented.

get_ip_rhs(
    sys::CTFlows.Systems.VectorFieldSystem,
    _
) -> CTFlows.Systems.AbstractIPRHS

Return the in-place right-hand side for a VectorFieldSystem.

Eager implementation: ignores the config and returns the pre-computed closure.

Arguments

  • sys::VectorFieldSystem: The vector field system.
  • _: The configuration (ignored).

Returns

  • Function: The pre-computed in-place closure with signature (du, u, p, t) -> nothing.

See also: CTFlows.Systems.get_oop_rhs, CTFlows.Systems.rhs.

get_ip_rhs(
    sys::CTFlows.Systems.HamiltonianVectorFieldSystem{F, TD, VD, CTBase.Traits.OutOfPlace},
    config::CTFlows.Configs.AbstractHamiltonianConfig
) -> CTFlows.Systems.IPHVFOoPRHS

Return the in-place right-hand side for a HamiltonianVectorFieldSystem.

Lazy implementation: reads x0/p0 from the config to build type-specific closures.

Arguments

  • sys::HamiltonianVectorFieldSystem{..., OutOfPlace, ...}: The out-of-place system.
  • config::Configs.AbstractHamiltonianConfig: The Hamiltonian configuration.

Returns

  • IPHVFOoPRHS: An in-place RHS functor.

See also: CTFlows.Systems.get_oop_rhs.

get_ip_rhs(
    sys::CTFlows.Systems.HamiltonianVectorFieldSystem{F, TD, VD, CTBase.Traits.InPlace},
    config::CTFlows.Configs.AbstractHamiltonianConfig
) -> CTFlows.Systems.IPHVFIpRHS

Return the in-place right-hand side for a HamiltonianVectorFieldSystem.

Lazy implementation: reads x0/p0 from the config to build type-specific closures.

Arguments

  • sys::HamiltonianVectorFieldSystem{..., InPlace, ...}: The in-place system.
  • config::Configs.AbstractHamiltonianConfig: The Hamiltonian configuration.

Returns

  • IPHVFIpRHS: An in-place RHS functor.

See also: CTFlows.Systems.get_oop_rhs.

get_ip_rhs(
    sys::CTFlows.Systems.HamiltonianSystem,
    config::CTFlows.Configs.AbstractHamiltonianConfig
) -> CTFlows.Systems.HamIpRHS

Return the in-place right-hand side for a HamiltonianSystem.

Lazy implementation: reads x0/p0 from the config to build type-specific closures.

Arguments

  • sys::HamiltonianSystem: The Hamiltonian system.
  • config::Configs.AbstractHamiltonianConfig: The Hamiltonian configuration.

Returns

  • HamIpRHS: An in-place RHS functor with embedded AD cache.

See also: CTFlows.Systems.get_oop_rhs.

get_ip_rhs(
    sys::CTFlowsSciMLFlows.SciMLFunctionSystem,
    _
) -> CTFlows.Systems.AbstractIPRHS

Return the in-place right-hand side for a SciMLFunctionSystem.

Eager implementation: ignores the config and returns the pre-computed closure.

Arguments

  • sys::SciMLFunctionSystem: The system.
  • _: The configuration (ignored).

Returns

  • Systems.AbstractIPRHS: The pre-computed in-place closure with signature (du, u, λ, t) -> nothing.

See also: CTFlowsSciMLFlows.SciMLFunctionSystem, CTFlows.Systems.get_oop_rhs.

get_ip_rhs_augmented [Function]

CTFlows.Systems.get_ip_rhs_augmentedFunction
get_ip_rhs_augmented(
    system::CTFlows.Systems.AbstractHamiltonianSystem,
    config
) -> CTFlows.Systems.IPHVFOoPAugRHS

Return the augmented in-place right-hand side function for a Hamiltonian system.

The returned function computes state, costate, and variable costate derivatives. Only applicable to Hamiltonian systems with variable costate support.

Arguments

  • system::AbstractHamiltonianSystem: The Hamiltonian system.
  • config: The augmented Hamiltonian configuration containing x0, p0, and pv0.

Returns

  • Function: The augmented in-place RHS closure with signature (du, u, p, t) -> nothing.

Throws

See also: CTFlows.Systems.get_ip_rhs, CTFlows.Systems.get_oop_rhs.

get_ip_rhs_augmented(
    sys::CTFlows.Systems.HamiltonianVectorFieldSystem{F, TD, VD, CTBase.Traits.OutOfPlace},
    config::CTFlows.Configs.AbstractAugmentedHamiltonianConfig
) -> CTFlows.Systems.IPHVFOoPAugRHS

Return the augmented in-place right-hand side for a HamiltonianVectorFieldSystem.

Lazy implementation: reads x0/p0/pv0 from the config to build the augmented closure.

Arguments

  • sys::HamiltonianVectorFieldSystem{..., OutOfPlace, ...}: The out-of-place system.
  • config::Configs.AbstractAugmentedHamiltonianConfig: The augmented Hamiltonian configuration.

Returns

  • IPHVFOoPAugRHS: An augmented in-place RHS functor.

See also: CTFlows.Systems.get_ip_rhs, CTFlows.Systems.get_oop_rhs.

get_ip_rhs_augmented(
    sys::CTFlows.Systems.HamiltonianVectorFieldSystem{F, TD, VD, CTBase.Traits.InPlace},
    config::CTFlows.Configs.AbstractAugmentedHamiltonianConfig
) -> CTFlows.Systems.IPHVFIpAugRHS

Return the augmented in-place right-hand side for a HamiltonianVectorFieldSystem.

Lazy implementation: reads x0/p0/pv0 from the config to build the augmented closure.

Arguments

  • sys::HamiltonianVectorFieldSystem{..., InPlace, ...}: The in-place system.
  • config::Configs.AbstractAugmentedHamiltonianConfig: The augmented Hamiltonian configuration.

Returns

  • IPHVFIpAugRHS: An augmented in-place RHS functor.

See also: CTFlows.Systems.get_ip_rhs, CTFlows.Systems.get_oop_rhs.

get_ip_rhs_augmented(
    sys::CTFlows.Systems.HamiltonianSystem,
    config::CTFlows.Configs.AbstractAugmentedHamiltonianConfig
) -> CTFlows.Systems.HamIpAugRHS

Return the augmented in-place right-hand side for a HamiltonianSystem.

Lazy implementation: reads x0/p0/pv0 from the config to build the augmented closure.

Arguments

  • sys::HamiltonianSystem: The Hamiltonian system.
  • config::Configs.AbstractAugmentedHamiltonianConfig: The augmented Hamiltonian configuration.

Returns

  • HamIpAugRHS: An augmented in-place RHS functor with embedded AD cache.

See also: CTFlows.Systems.get_ip_rhs, CTFlows.Systems.get_oop_rhs.

get_oop_rhs [Function]

CTFlows.Systems.get_oop_rhsFunction
get_oop_rhs(
    system::CTFlows.Systems.AbstractSystem,
    config
) -> CTFlows.Systems.HamOoPRHS

Return the out-of-place right-hand side function for a system given a configuration.

The returned function must have the signature (u, p, t) -> du and return the derivative at state u, parameters p, and time t without modifying u.

Eager systems ignore the config and return pre-computed closures. Lazy systems read x0/p0 from the config to build type-specific closures.

Arguments

  • system::AbstractSystem: The system.
  • config: The configuration containing initial conditions and time span.

Returns

  • Function: The out-of-place RHS closure with signature (u, p, t) -> du.

Throws

See also: CTFlows.Systems.get_ip_rhs, CTFlows.Systems.get_ip_rhs_augmented.

get_oop_rhs(
    sys::CTFlows.Systems.VectorFieldSystem{F, TD, VD, CTBase.Traits.OutOfPlace, RHS, OOPROHS, Nothing},
    _
) -> Any

Return the out-of-place right-hand side for a VectorFieldSystem.

Eager implementation: ignores the config and returns the pre-computed closure. For InPlace systems, returns rhs_oop_finalize (the finalize path) since get_oop_rhs is only called when !ismutable(u0).

Arguments

  • sys::VectorFieldSystem{..., OutOfPlace, ...}: The out-of-place system.
  • _: The configuration (ignored).

Returns

  • Function: The pre-computed out-of-place closure with signature (u, p, t) -> du.

See also: CTFlows.Systems.get_ip_rhs.

get_oop_rhs(
    sys::CTFlows.Systems.VectorFieldSystem{F, TD, VD, CTBase.Traits.InPlace, RHS, OOPROHS, FINRHS},
    _
) -> Any

Return the out-of-place right-hand side for an InPlace VectorFieldSystem.

Eager implementation: ignores the config and returns the finalize closure. This method is called when !ismutable(u0), so we always return rhs_oop_finalize.

Arguments

  • sys::VectorFieldSystem{..., InPlace, ...}: The in-place system.
  • _: The configuration (ignored).

Returns

  • Function: The finalize closure with signature (u, p, t) -> du.

Notes

  • Emits a performance warning since this path is suboptimal for immutable arrays.

See also: CTFlows.Systems.get_ip_rhs.

get_oop_rhs(
    sys::CTFlows.Systems.HamiltonianVectorFieldSystem{F, TD, VD, CTBase.Traits.OutOfPlace},
    config::CTFlows.Configs.AbstractHamiltonianConfig
) -> CTFlows.Systems.OoPHVFOoPRHS

Return the out-of-place right-hand side for a HamiltonianVectorFieldSystem.

Lazy implementation: reads x0/p0 from the config to build type-specific closures.

Arguments

  • sys::HamiltonianVectorFieldSystem{..., OutOfPlace, ...}: The out-of-place system.
  • config::Configs.AbstractHamiltonianConfig: The Hamiltonian configuration.

Returns

  • OoPHVFOoPRHS: An out-of-place RHS functor.

See also: CTFlows.Systems.get_ip_rhs.

get_oop_rhs(
    sys::CTFlows.Systems.HamiltonianVectorFieldSystem{F, TD, VD, CTBase.Traits.InPlace},
    config::CTFlows.Configs.AbstractHamiltonianConfig
) -> Union{CTFlows.Systems.OoPHVFIpFinalizeRHS, CTFlows.Systems.OoPHVFIpRHS}

Return the out-of-place right-hand side for a HamiltonianVectorFieldSystem.

Lazy implementation: reads x0/p0 from the config to build type-specific closures. For immutable initial conditions, returns the finalize closure.

Arguments

  • sys::HamiltonianVectorFieldSystem{..., InPlace, ...}: The in-place system.
  • config::Configs.AbstractHamiltonianConfig: The Hamiltonian configuration.

Returns

  • OoPHVFIpRHS or OoPHVFIpFinalizeRHS: An out-of-place RHS functor.

Notes

  • Emits a performance warning when called with immutable initial conditions.

See also: CTFlows.Systems.get_ip_rhs.

get_oop_rhs(
    sys::CTFlows.Systems.HamiltonianSystem,
    config::CTFlows.Configs.AbstractHamiltonianConfig
) -> CTFlows.Systems.HamOoPRHS

Return the out-of-place right-hand side for a HamiltonianSystem.

Lazy implementation: reads x0/p0 from the config to build type-specific closures.

Arguments

  • sys::HamiltonianSystem: The Hamiltonian system.
  • config::Configs.AbstractHamiltonianConfig: The Hamiltonian configuration.

Returns

  • HamOoPRHS: An out-of-place RHS functor with embedded AD cache.

See also: CTFlows.Systems.get_ip_rhs.

get_oop_rhs(
    sys::CTFlowsSciMLFlows.SciMLFunctionSystem{F, RHS, OOPROHS, Nothing},
    _
) -> Any

Return the out-of-place right-hand side for an out-of-place SciMLFunctionSystem.

Eager implementation: ignores the config and returns the pre-computed closure.

Arguments

  • sys::SciMLFunctionSystem{..., Nothing}: The out-of-place system.
  • _: The configuration (ignored).

Returns

  • Systems.AbstractOoPRHS: The pre-computed out-of-place closure with signature (u, λ, t) -> du.

See also: CTFlowsSciMLFlows.SciMLFunctionSystem, CTFlows.Systems.get_ip_rhs.

get_oop_rhs(
    sys::CTFlowsSciMLFlows.SciMLFunctionSystem{F, RHS, OOPROHS, FINRHS},
    _
) -> Any

Return the out-of-place right-hand side for an in-place SciMLFunctionSystem.

Eager implementation: ignores the config and returns the finalize closure. This method is called when !ismutable(u0), so always returns rhs_oop_finalize_fn.

Arguments

  • sys::SciMLFunctionSystem{..., FINRHS}: The in-place system.
  • _: The configuration (ignored).

Returns

  • Systems.AbstractOoPRHS: The finalize closure with signature (u, λ, t) -> du.

Notes

  • Emits a performance warning since this path is suboptimal for immutable arrays.

See also: CTFlowsSciMLFlows.SciMLFunctionSystem, CTFlows.Systems.get_ip_rhs.

hamiltonian [Function]

CTFlows.Systems.hamiltonianFunction
hamiltonian(
    sys::CTFlows.Systems.HamiltonianSystem
) -> CTBase.Data.Hamiltonian{F, TD, VD} where {F<:Function, TD<:CTBase.Traits.TimeDependence, VD<:CTBase.Traits.VariableDependence}

Return the Hamiltonian function from a HamiltonianSystem.

Arguments

  • sys::HamiltonianSystem: The Hamiltonian system.

Returns

  • Data.Hamiltonian: The Hamiltonian function wrapped by the system.

See also: CTFlows.Systems.HamiltonianSystem, CTFlows.Systems.backend.

hamiltonian_vector_field [Function]

Missing docstring.

Missing docstring for CTFlows.Systems.hamiltonian_vector_field. Check Documenter's build log for details.