Public API

This page lists exported symbols of CTFlows.Configs.


From CTFlows.Configs

CTFlows.Configs [Module]

CTFlows.ConfigsModule
Configs

Configuration types for integration problems in CTFlows.

This module provides the configuration type hierarchy that specifies integration scenarios including:

  • Integration mode: point-to-point vs trajectory
  • Dynamics type: state-only vs Hamiltonian (state + costate)
  • Time dependence: autonomous vs non-autonomous
  • Variable dependence: fixed vs non-fixed (for optimal control)

Configuration types encode these choices as type parameters for compile-time dispatch.

Main Types

Accessors

See also: CTFlows.Flows.build_flow, CTFlows.Trajectories.build_trajectory.

AbstractAugmentedHamiltonianConfig [Abstract Type]

CTFlows.Configs.AbstractAugmentedHamiltonianConfigType
abstract type AbstractConfigWithMaC{X0, M, CTBase.Traits.AugmentedHamiltonianDynamics} <: CTFlows.Configs.AbstractConfig{X0}

Type alias for augmented Hamiltonian configurations, which include state, costate, and augmented variable initial conditions.

Type Parameters

  • X0: Type of the initial condition (typically a vector concatenating state, costate, and augmented variable).
  • M: Type of the mutability trait (InPlace or OutOfPlace).

Notes

See also: CTFlows.Configs.AbstractHamiltonianConfig, CTBase.Traits.AugmentedHamiltonianDynamics, CTFlows.Systems.HamiltonianSystem.

AbstractConfig [Abstract Type]

CTFlows.Configs.AbstractConfigType
abstract type AbstractConfig{X0}

Abstract configuration type for integration problems.

Marker type for dispatch on configuration objects. Concrete subtypes define specific integration scenarios (e.g., point-to-point, trajectory, costate).

The type parameters encode:

  • X0: Type of the initial condition (scalar Number or vector AbstractVector)
  • Mode: Integration mode (EndPointMode or TrajectoryMode)
  • Dyn: Dynamics type (StateDynamics or HamiltonianDynamics)

This enables compile-time dispatch on mode and content without runtime type tests.

Interface Requirements

All subtypes must implement:

  • tspan(config): Return the time span as a tuple (t0, tf).

Example

julia> using CTFlows.Configs

julia> StateEndPointConfig <: Configs.AbstractConfig
true

julia> StateEndPointConfig <: Configs.AbstractEndPointConfig
true

julia> StateEndPointConfig <: Configs.AbstractStateConfig
true

See also: CTFlows.Configs.AbstractEndPointConfig, CTFlows.Configs.AbstractTrajectoryConfig, CTFlows.Configs.AbstractStateConfig, CTFlows.Configs.AbstractHamiltonianConfig.

AbstractConfigWithMaC [Abstract Type]

CTFlows.Configs.AbstractConfigWithMaCType
abstract type AbstractConfigWithMaC{X0, Mode<:CTBase.Traits.AbstractModeTrait, Dyn<:CTBase.Traits.AbstractDynamicsTrait} <: CTFlows.Configs.AbstractConfig{X0}

Abstract configuration type with mode and content traits.

Extends AbstractConfig with additional type parameters for compile-time dispatch on integration mode (point vs trajectory) and content type (state, Hamiltonian, augmented Hamiltonian).

Type Parameters

  • X0: Type of the initial condition (scalar Number or vector AbstractVector)
  • Mode <: AbstractModeTrait: Integration mode trait (EndPointMode or TrajectoryMode)
  • Dyn <: AbstractDynamicsTrait: Dynamics trait (StateDynamics, HamiltonianDynamics, or AugmentedHamiltonianDynamics)

Interface Requirements

All subtypes must implement:

  • tspan(config): Return the time span as a tuple (t0, tf).

Example

julia> using CTFlows.Configs

julia> StateEndPointConfig <: Configs.AbstractConfigWithMaC
true

julia> HamiltonianEndPointConfig <: Configs.AbstractConfigWithMaC
true

See also: CTFlows.Configs.AbstractConfig, CTFlows.Configs.AbstractEndPointConfig, CTFlows.Configs.AbstractTrajectoryConfig, CTFlows.Configs.AbstractStateConfig, CTFlows.Configs.AbstractHamiltonianConfig, CTFlows.Configs.AbstractAugmentedHamiltonianConfig.

AbstractEndPointConfig [Abstract Type]

CTFlows.Configs.AbstractEndPointConfigType
abstract type AbstractConfigWithMaC{X0, CTBase.Traits.EndPointMode, C} <: CTFlows.Configs.AbstractConfig{X0}

Alias for point integration mode configurations.

Matches any AbstractConfig with EndPointMode as the mode parameter.

AbstractHamiltonianConfig [Abstract Type]

CTFlows.Configs.AbstractHamiltonianConfigType
abstract type AbstractConfigWithMaC{X0, M, CTBase.Traits.HamiltonianDynamics} <: CTFlows.Configs.AbstractConfig{X0}

Alias for Hamiltonian content configurations.

Matches any AbstractConfig with HamiltonianDynamics as the dynamics parameter.

AbstractStateConfig [Abstract Type]

CTFlows.Configs.AbstractStateConfigType
abstract type AbstractConfigWithMaC{X0, M, CTBase.Traits.StateDynamics} <: CTFlows.Configs.AbstractConfig{X0}

Alias for state content configurations.

Matches any AbstractConfig with StateDynamics as the dynamics parameter.

AbstractTrajectoryConfig [Abstract Type]

CTFlows.Configs.AbstractTrajectoryConfigType
abstract type AbstractConfigWithMaC{X0, CTBase.Traits.TrajectoryMode, C} <: CTFlows.Configs.AbstractConfig{X0}

Alias for trajectory integration mode configurations.

Matches any AbstractConfig with TrajectoryMode as the mode parameter.

AugmentedHamiltonianEndPointConfig [Struct]

CTFlows.Configs.AugmentedHamiltonianEndPointConfigType
struct AugmentedHamiltonianEndPointConfig{T0<:Real, X0, P0, PV0, TF<:Real} <: CTFlows.Configs.AbstractConfigWithMaC{X0, CTBase.Traits.EndPointMode, CTBase.Traits.AugmentedHamiltonianDynamics}

Configuration for an augmented Hamiltonian point-to-point integration problem.

Defines the initial and final time points along with the initial state, costate, and variable costate for integration from a single initial condition to a specific final time in the augmented Hamiltonian framework.

Fields

  • t0::T0: Initial time
  • x0::X0: Initial state vector
  • p0::P0: Initial costate vector
  • pv0::PV0: Initial variable costate vector (typically zeros)
  • tf::TF: Final time

Example

julia> using CTFlows.Configs

julia> config = AugmentedHamiltonianEndPointConfig(0.0, [1.0, 0.0], [0.5, 0.3], [0.0, 0.0], 1.0)
AugmentedHamiltonianEndPointConfig
  t0: 0.0
  x0: [1.0, 0.0]
  p0: [0.5, 0.3]
  pv0: [0.0, 0.0]
  tf: 1.0

See also: CTFlows.Configs.HamiltonianEndPointConfig, CTBase.Traits.AugmentedHamiltonianDynamics.

HamiltonianEndPointConfig [Struct]

CTFlows.Configs.HamiltonianEndPointConfigType
struct HamiltonianEndPointConfig{T0<:Real, X0, P0, TF<:Real} <: CTFlows.Configs.AbstractConfigWithMaC{X0, CTBase.Traits.EndPointMode, CTBase.Traits.HamiltonianDynamics}

Configuration for a Hamiltonian point-to-point integration problem.

Defines the initial and final time points along with the initial state and costate for integration from a single initial condition to a specific final time in the Hamiltonian framework.

Fields

  • t0::T0: Initial time
  • x0::X0: Initial state vector
  • p0::P0: Initial costate vector
  • tf::TF: Final time

Example

julia> using CTFlows.Configs

julia> config = HamiltonianEndPointConfig(0.0, [1.0, 0.0], [0.5, 0.3], 1.0)
HamiltonianEndPointConfig
  t0: 0.0
  x0: [1.0, 0.0]
  p0: [0.5, 0.3]
  tf: 1.0

See also: CTFlows.Configs.HamiltonianTrajectoryConfig, CTFlows.Configs.StateEndPointConfig.

HamiltonianTrajectoryConfig [Struct]

CTFlows.Configs.HamiltonianTrajectoryConfigType
struct HamiltonianTrajectoryConfig{TS<:(Tuple{var"#s11", var"#s9"} where {var"#s11"<:Real, var"#s9"<:Real}), X0, P0} <: CTFlows.Configs.AbstractConfigWithMaC{X0, CTBase.Traits.TrajectoryMode, CTBase.Traits.HamiltonianDynamics}

Configuration for a Hamiltonian trajectory integration problem.

Defines a time span and initial state and costate for integration over a continuous time interval in the Hamiltonian framework, useful for generating full Hamiltonian trajectories.

Fields

  • tspan::TS: Time span as a tuple (t0, tf)
  • x0::X0: Initial state vector
  • p0::P0: Initial costate vector

Example

julia> using CTFlows.Configs

julia> config = HamiltonianTrajectoryConfig((0.0, 1.0), [1.0, 0.0], [0.5, 0.3])
HamiltonianTrajectoryConfig
  tspan: (0.0, 1.0)
  x0: [1.0, 0.0]
  p0: [0.5, 0.3]

See also: CTFlows.Configs.HamiltonianEndPointConfig, CTFlows.Configs.StateTrajectoryConfig.

StateEndPointConfig [Struct]

CTFlows.Configs.StateEndPointConfigType
struct StateEndPointConfig{T0<:Real, X0, TF<:Real} <: CTFlows.Configs.AbstractConfigWithMaC{X0, CTBase.Traits.EndPointMode, CTBase.Traits.StateDynamics}

Configuration for a point-to-point integration problem.

Defines the initial and final time points along with the initial state for integration from a single initial condition to a specific final time.

Fields

  • t0::T0: Initial time
  • x0::X0: Initial state vector
  • tf::TF: Final time

Example

julia> using CTFlows.Configs

julia> config = StateEndPointConfig(0.0, [1.0, 0.0], 1.0)
StateEndPointConfig
  t0: 0.0
  x0: [1.0, 0.0]
  tf: 1.0

See also: CTFlows.Configs.StateTrajectoryConfig

StateTrajectoryConfig [Struct]

CTFlows.Configs.StateTrajectoryConfigType
struct StateTrajectoryConfig{TS<:(Tuple{var"#s8", var"#s7"} where {var"#s8"<:Real, var"#s7"<:Real}), X0} <: CTFlows.Configs.AbstractConfigWithMaC{X0, CTBase.Traits.TrajectoryMode, CTBase.Traits.StateDynamics}

Configuration for a trajectory integration problem.

Defines a time span and initial state for integration over a continuous time interval, useful for generating full trajectories.

Fields

  • tspan::TS: Time span as a tuple (t0, tf)
  • x0::X0: Initial state vector

Example

julia> using CTFlows.Configs

julia> config = StateTrajectoryConfig((0.0, 1.0), [1.0, 0.0])
StateTrajectoryConfig
  tspan: (0.0, 1.0)
  x0: [1.0, 0.0]

See also: CTFlows.Configs.StateEndPointConfig

dynamics_trait [Function]

CTFlows.Configs.dynamics_traitFunction
dynamics_trait(
    _::CTFlows.Configs.AbstractConfigWithMaC{X0, Mode, Dyn}
) -> Any

Return the dynamics trait type of a configuration.

Extracts the Dyn type parameter from the configuration's parametric type, enabling trait-based dispatch on the integration dynamics (state, Hamiltonian, augmented Hamiltonian).

Arguments

  • ::AbstractConfigWithMaC{X0, Mode, Dyn}: Any concrete configuration subtype.

Returns

  • Type{Dyn}: The dynamics trait type (e.g., StateDynamics, HamiltonianDynamics, or AugmentedHamiltonianDynamics).

Example

config = Configs.HamiltonianEndPointConfig(0.0, [1.0], [0.5], 1.0)
Configs.dynamics_trait(config) === Traits.HamiltonianDynamics  # true

See also: CTFlows.Configs.AbstractConfigWithMaC, CTBase.Traits.StateDynamics, CTBase.Traits.HamiltonianDynamics, CTBase.Traits.AugmentedHamiltonianDynamics, CTFlows.Configs.mode_trait.

final_time [Function]

CTFlows.Configs.final_timeFunction
final_time(c::CTFlows.Configs.AbstractConfig) -> Real

Return the final time for a configuration (stub method).

This is a stub method on the base AbstractConfig type that throws NotImplemented. Concrete subtypes should implement this method to return their specific final time.

Arguments

  • c::AbstractConfig: The configuration.

Throws

  • Exceptions.NotImplemented: Always thrown for the base abstract type.

See also: CTFlows.Configs.AbstractConfig, CTFlows.Configs.initial_time.

final_time(
    c::CTFlows.Configs.AbstractEndPointConfig
) -> Real

Return the final time for point configurations.

For point configurations, returns the stored tf field directly.

Arguments

  • c::AbstractEndPointConfig: The point configuration.

Returns

  • Real: Final time tf.

See also: CTFlows.Configs.AbstractEndPointConfig, CTFlows.Configs.final_time.

final_time(
    c::CTFlows.Configs.AbstractTrajectoryConfig
) -> Real

Return the final time for trajectory configurations.

For trajectory configurations, returns the second element of the stored tspan field.

Arguments

  • c::AbstractTrajectoryConfig: The trajectory configuration.

Returns

  • Real: Final time tf.

See also: CTFlows.Configs.AbstractTrajectoryConfig, CTFlows.Configs.final_time.

initial_condition [Function]

CTFlows.Configs.initial_conditionFunction
initial_condition(
    c::CTFlows.Configs.AbstractConfig
) -> Vector

Return the initial condition for a configuration (stub method).

This is a stub method on the base AbstractConfig type that throws NotImplemented. Concrete subtypes should implement this method to return their specific initial condition format.

Arguments

  • c::AbstractConfig: The configuration.

Throws

  • Exceptions.NotImplemented: Always thrown for the base abstract type.

See also: CTFlows.Configs.AbstractConfig.

initial_condition(
    c::CTFlows.Configs.AbstractConfigWithMaC{<:Number, M, CTBase.Traits.StateDynamics}
) -> Vector

Return the initial condition as a vector for scalar state configurations.

For scalar initial conditions, wraps the scalar in a length-1 vector to maintain consistent vector-based ODE problem construction.

Arguments

  • c::AbstractStateConfig{<:Number, M}: The state configuration with scalar initial state.

Returns

  • Vector{<:Number}: Length-1 vector containing the scalar initial state.

See also: CTFlows.Configs.AbstractStateConfig, CTFlows.Configs.initial_condition.

initial_condition(
    c::CTFlows.Configs.AbstractStateConfig
) -> Vector

Return the initial condition for state configurations.

For vector initial conditions, returns the state vector directly.

Arguments

  • c::AbstractStateConfig: The state configuration.

Returns

  • The initial state vector.

See also: CTFlows.Configs.AbstractStateConfig.

initial_condition(
    c::CTFlows.Configs.AbstractHamiltonianConfig
) -> Any

Return the initial condition for Hamiltonian configurations.

For Hamiltonian systems, the initial condition is the concatenation of the initial state and initial costate: vcat(x0, p0).

Arguments

  • c::AbstractHamiltonianConfig: The Hamiltonian configuration.

Returns

  • Concatenated vector [x0; p0].

See also: CTFlows.Configs.AbstractHamiltonianConfig, CTFlows.Configs.initial_state, CTFlows.Configs.initial_costate.

initial_condition(
    c::CTFlows.Configs.AugmentedHamiltonianEndPointConfig
) -> Any

Return the initial condition for augmented Hamiltonian configurations.

For augmented Hamiltonian systems, the initial condition is the concatenation of the initial state, initial costate, and initial variable costate: vcat(x0, p0, pv0).

Arguments

  • c::AugmentedHamiltonianEndPointConfig: The augmented Hamiltonian configuration.

Returns

  • Concatenated vector [x0; p0; pv0].

See also: CTFlows.Configs.AugmentedHamiltonianEndPointConfig, CTFlows.Configs.initial_state, CTFlows.Configs.initial_costate, CTFlows.Configs.initial_variable_costate.

initial_costate [Function]

CTFlows.Configs.initial_costateFunction
initial_costate(c::CTFlows.Configs.AbstractConfig)

Return the initial costate for a configuration (stub method).

This is a stub method on the base AbstractConfig type that throws NotImplemented. Concrete subtypes should implement this method to return their specific initial costate (if applicable).

Arguments

  • c::AbstractConfig: The configuration.

Throws

  • Exceptions.NotImplemented: Always thrown for the base abstract type.

See also: CTFlows.Configs.AbstractConfig.

initial_costate(c::CTFlows.Configs.AbstractStateConfig)

Return the initial costate for state configurations (error stub).

State configurations do not have a costate field. This method throws a PreconditionError to enforce the contract that initial_costate is only defined for Hamiltonian configurations.

Arguments

  • c::AbstractStateConfig: The state configuration.

Throws

  • Exceptions.PreconditionError: Always thrown for state configurations.

See also: CTFlows.Configs.AbstractStateConfig, CTFlows.Configs.AbstractHamiltonianConfig, CTFlows.Configs.initial_costate.

initial_costate(
    c::CTFlows.Configs.AbstractHamiltonianConfig
) -> Any

Return the initial costate for Hamiltonian configurations.

Extracts the initial costate field from the Hamiltonian configuration.

Arguments

  • c::AbstractHamiltonianConfig: The Hamiltonian configuration.

Returns

  • The initial costate vector.

See also: CTFlows.Configs.AbstractHamiltonianConfig.

initial_costate(
    c::CTFlows.Configs.AugmentedHamiltonianEndPointConfig
) -> Any

Return the initial costate for augmented Hamiltonian configurations.

Extracts the initial costate field from the augmented Hamiltonian configuration.

Arguments

  • c::AugmentedHamiltonianEndPointConfig: The augmented Hamiltonian configuration.

Returns

  • The initial costate vector.

See also: CTFlows.Configs.AugmentedHamiltonianEndPointConfig.

initial_state [Function]

CTFlows.Configs.initial_stateFunction
initial_state(c::CTFlows.Configs.AbstractConfig) -> Any

Return the initial state for a configuration (stub method).

This is a stub method on the base AbstractConfig type that throws NotImplemented. Concrete subtypes should implement this method to return their specific initial state.

Arguments

  • c::AbstractConfig: The configuration.

Throws

  • Exceptions.NotImplemented: Always thrown for the base abstract type.

See also: CTFlows.Configs.AbstractConfig.

initial_state(
    c::CTFlows.Configs.AbstractConfigWithMaC
) -> Any

Return the initial state from a configuration.

Extracts the initial state field from the configuration.

Arguments

  • c::AbstractConfigWithMaC: The configuration with mode and content traits.

Returns

  • The initial state vector.

See also: CTFlows.Configs.AbstractConfigWithMaC.

initial_time [Function]

CTFlows.Configs.initial_timeFunction
initial_time(c::CTFlows.Configs.AbstractConfig) -> Real

Return the initial time for a configuration (stub method).

This is a stub method on the base AbstractConfig type that throws NotImplemented. Concrete subtypes should implement this method to return their specific initial time.

Arguments

  • c::AbstractConfig: The configuration.

Throws

  • Exceptions.NotImplemented: Always thrown for the base abstract type.

See also: CTFlows.Configs.AbstractConfig, CTFlows.Configs.final_time.

initial_time(
    c::CTFlows.Configs.AbstractEndPointConfig
) -> Real

Return the initial time for point configurations.

For point configurations, returns the stored t0 field directly.

Arguments

  • c::AbstractEndPointConfig: The point configuration.

Returns

  • Real: Initial time t0.

See also: CTFlows.Configs.AbstractEndPointConfig, CTFlows.Configs.initial_time.

initial_time(
    c::CTFlows.Configs.AbstractTrajectoryConfig
) -> Real

Return the initial time for trajectory configurations.

For trajectory configurations, returns the first element of the stored tspan field.

Arguments

  • c::AbstractTrajectoryConfig: The trajectory configuration.

Returns

  • Real: Initial time t0.

See also: CTFlows.Configs.AbstractTrajectoryConfig, CTFlows.Configs.initial_time.

initial_variable_costate [Function]

CTFlows.Configs.initial_variable_costateFunction
initial_variable_costate(
    c::CTFlows.Configs.AbstractConfig
) -> Any

Return the initial variable costate for a configuration (stub method).

This is a stub method on the base AbstractConfig type that throws NotImplemented. Concrete subtypes should implement this method to return their specific initial variable costate (if applicable).

Arguments

  • c::AbstractConfig: The configuration.

Throws

  • Exceptions.NotImplemented: Always thrown for the base abstract type.

See also: CTFlows.Configs.AbstractConfig.

initial_variable_costate(
    c::CTFlows.Configs.AugmentedHamiltonianEndPointConfig
) -> Any

Return the initial variable costate for augmented Hamiltonian configurations.

Extracts the initial variable costate field from the augmented Hamiltonian configuration.

Arguments

  • c::AugmentedHamiltonianEndPointConfig: The augmented Hamiltonian configuration.

Returns

  • The initial variable costate vector.

See also: CTFlows.Configs.AugmentedHamiltonianEndPointConfig.

mode_trait [Function]

CTFlows.Configs.mode_traitFunction
mode_trait(
    _::CTFlows.Configs.AbstractConfigWithMaC{X0, Mode, Dyn}
) -> Any

Return the mode trait type of a configuration.

Extracts the Mode type parameter from the configuration's parametric type, enabling trait-based dispatch on the integration mode (point vs trajectory).

Arguments

  • ::AbstractConfigWithMaC{X0, Mode, Content}: Any concrete configuration subtype.

Returns

  • Type{Mode}: The mode trait type (e.g., EndPointMode or TrajectoryMode).

Example

config = Configs.HamiltonianEndPointConfig(0.0, [1.0], [0.5], 1.0)
Configs.mode_trait(config) === Traits.EndPointMode  # true

See also: CTFlows.Configs.AbstractConfigWithMaC, CTBase.Traits.EndPointMode, CTBase.Traits.TrajectoryMode, CTFlows.Configs.dynamics_trait.

tspan [Function]

CTFlows.Configs.tspanFunction
tspan(
    c::CTFlows.Configs.AbstractConfig
) -> Tuple{Real, Real}

Return the time span for a configuration (stub method).

This is a stub method on the base AbstractConfig type that throws NotImplemented. Concrete subtypes should implement this method to return their specific time span format.

Arguments

  • c::AbstractConfig: The configuration.

Throws

  • Exceptions.NotImplemented: Always thrown for the base abstract type.

See also: CTFlows.Configs.AbstractConfig.

tspan(
    c::CTFlows.Configs.AbstractEndPointConfig
) -> Tuple{Real, Real}

Return the time span as a tuple for point configurations.

For point configurations, extracts the initial and final times from the t0 and tf fields.

Arguments

  • c::AbstractEndPointConfig: The point configuration.

Returns

  • Tuple{Real, Real}: Time span as (t0, tf).

See also: CTFlows.Configs.AbstractEndPointConfig, CTFlows.Configs.tspan.

tspan(
    c::CTFlows.Configs.AbstractTrajectoryConfig
) -> Tuple{Real, Real}

Return the time span for trajectory configurations.

For trajectory configurations, returns the stored tspan field directly.

Arguments

  • c::AbstractTrajectoryConfig: The trajectory configuration.

Returns

  • Tuple{Real, Real}: Time span as (t0, tf).

See also: CTFlows.Configs.AbstractTrajectoryConfig, CTFlows.Configs.tspan.