Public API
This page lists exported symbols of CTFlows.Configs.
From CTFlows.Configs
CTFlows.Configs [Module]
CTFlows.Configs Module
ConfigsConfiguration 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
CTFlows.Configs.AbstractConfig: Base configuration typeCTFlows.Configs.AbstractConfigWithMaC: Configuration with mode and content traitsCTFlows.Configs.StateEndPointConfig: Point-to-point state integrationCTFlows.Configs.StateTrajectoryConfig: Trajectory state integrationCTFlows.Configs.HamiltonianEndPointConfig: Point-to-point Hamiltonian integrationCTFlows.Configs.HamiltonianTrajectoryConfig: Trajectory Hamiltonian integrationCTFlows.Configs.AugmentedHamiltonianEndPointConfig: Augmented Hamiltonian for variable costate
Accessors
CTFlows.Configs.tspan: Time span(t0, tf)CTFlows.Configs.initial_state: Initial stateCTFlows.Configs.initial_costate: Initial costate (Hamiltonian configs)CTFlows.Configs.initial_variable_costate: Initial variable costate (augmented configs)CTFlows.Configs.mode_trait: Integration mode traitCTBase.Traits.dynamics_trait: Dynamics trait
See also: CTFlows.Flows.build_flow, CTFlows.Trajectories.build_trajectory.
AbstractAugmentedHamiltonianConfig [Abstract Type]
CTFlows.Configs.AbstractAugmentedHamiltonianConfig Type
abstract type AbstractConfigWithMaC{X0, M<:CTBase.Traits.AbstractModeTrait, 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 (InPlaceorOutOfPlace).
Notes
Augmented Hamiltonian configurations are used for systems where the Hamiltonian depends on an additional variable (e.g., a control parameter or optimization variable).
The initial condition typically has the form
vcat(x0, p0, pv0)wherex0is the initial state,p0is the initial costate, andpv0is the initial augmented variable.Subtypes
CTFlows.Configs.AbstractConfigWithMaCwithCTBase.Traits.AugmentedHamiltonianDynamics.Used in conjunction with
CTFlows.Systems.HamiltonianSystemfor automatic differentiation-based Hamiltonian integration.
See also: CTFlows.Configs.AbstractHamiltonianConfig, CTBase.Traits.AugmentedHamiltonianDynamics, CTFlows.Systems.HamiltonianSystem.
AbstractConfig [Abstract Type]
CTFlows.Configs.AbstractConfig Type
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 (scalarNumberor vectorAbstractVector)Mode: Integration mode (EndPointModeorTrajectoryMode)Dyn: Dynamics type (StateDynamicsorHamiltonianDynamics)
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> Configs.StateEndPointConfig <: Configs.AbstractConfig
true
julia> Configs.StateEndPointConfig <: Configs.AbstractEndPointConfig
true
julia> Configs.StateEndPointConfig <: Configs.AbstractStateConfig
trueSee also: CTFlows.Configs.AbstractEndPointConfig, CTFlows.Configs.AbstractTrajectoryConfig, CTFlows.Configs.AbstractStateConfig, CTFlows.Configs.AbstractHamiltonianConfig.
AbstractConfigWithMaC [Abstract Type]
CTFlows.Configs.AbstractConfigWithMaC Type
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 (scalarNumberor vectorAbstractVector)Mode <: AbstractModeTrait: Integration mode trait (EndPointModeorTrajectoryMode)Dyn <: AbstractDynamicsTrait: Dynamics trait (StateDynamics,HamiltonianDynamics, orAugmentedHamiltonianDynamics)
Interface Requirements
All subtypes must implement:
tspan(config): Return the time span as a tuple(t0, tf).
Example
julia> using CTFlows: Configs
julia> Configs.StateEndPointConfig <: Configs.AbstractConfigWithMaC
true
julia> Configs.HamiltonianEndPointConfig <: Configs.AbstractConfigWithMaC
trueSee also: CTFlows.Configs.AbstractConfig, CTFlows.Configs.AbstractEndPointConfig, CTFlows.Configs.AbstractTrajectoryConfig, CTFlows.Configs.AbstractStateConfig, CTFlows.Configs.AbstractHamiltonianConfig, CTFlows.Configs.AbstractAugmentedHamiltonianConfig.
AbstractEndPointConfig [Abstract Type]
CTFlows.Configs.AbstractEndPointConfig Type
abstract type AbstractConfigWithMaC{X0, CTBase.Traits.EndPointMode, C<:CTBase.Traits.AbstractDynamicsTrait} <: CTFlows.Configs.AbstractConfig{X0}Alias for point integration mode configurations.
Matches any AbstractConfig with EndPointMode as the mode parameter.
AbstractGrid [Abstract Type]
CTFlows.Configs.AbstractGrid Type
abstract type AbstractGridAbstract supertype of the output grids generated from the time span of a trajectory call (f((t0, tf), x0, …; grid=spec)). A generated grid has exactly n distinct times, the bounds and the switching times of a multi-phase flow included; it only shapes the output (the integration is that of the span). CTFlows.Configs.AutomaticGrid is the default grid of a call that sets none.
See also: CTFlows.Configs.UniformGrid, CTFlows.Configs.AdaptiveGrid.
AbstractHamiltonianConfig [Abstract Type]
CTFlows.Configs.AbstractHamiltonianConfig Type
abstract type AbstractConfigWithMaC{X0, M<:CTBase.Traits.AbstractModeTrait, 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.AbstractStateConfig Type
abstract type AbstractConfigWithMaC{X0, M<:CTBase.Traits.AbstractModeTrait, 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.AbstractTrajectoryConfig Type
abstract type AbstractConfigWithMaC{X0, CTBase.Traits.TrajectoryMode, C<:CTBase.Traits.AbstractDynamicsTrait} <: CTFlows.Configs.AbstractConfig{X0}Alias for trajectory integration mode configurations.
Matches any AbstractConfig with TrajectoryMode as the mode parameter.
AdaptiveGrid [Struct]
CTFlows.Configs.AdaptiveGrid Type
struct AdaptiveGrid <: CTFlows.Configs.AbstractGridAdaptive output grid of n times, denser where the plotted curves (state, costate and control, each scaled by its range) bend: the times equidistribute the density ρ ∝ ‖y''‖^{1/2}, which minimizes the error of the polyline drawn through them, mixed with a uniform share uniform. On a multi-phase flow, the intervals are shared between the phases in proportion to their mass.
Fields
n::Int: Number of distinct times, at least 2.uniform::Float64: Share of the uniform density, in[0, 1](default0.1).
Throws
CTBase.Exceptions.IncorrectArgument: Ifn < 2oruniform ∉ [0, 1].
See also: CTFlows.Configs.UniformGrid.
AugmentedHamiltonianEndPointConfig [Struct]
CTFlows.Configs.AugmentedHamiltonianEndPointConfig Type
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 timex0::X0: Initial state vectorp0::P0: Initial costate vectorpv0::PV0: Initial variable costate vector (typically zeros)tf::TF: Final time
Example
julia> using CTFlows: Configs
julia> config = Configs.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.0See also: CTFlows.Configs.HamiltonianEndPointConfig, CTBase.Traits.AugmentedHamiltonianDynamics.
AutomaticGrid [Struct]
CTFlows.Configs.AutomaticGrid Type
struct AutomaticGrid <: CTFlows.Configs.AbstractGridOutput grid applied by default to a trajectory call that sets no output grid (grid not provided, issue #446): the adaptive grid grid is generated only when the integration is dense and yields fewer than grid.n times, so that the result has grid.n times; otherwise the result is left as the solver returned it.
It is resolved by the top-level trajectory calls and never by the internal ones (the inner flow of a decorator, a phase of a multi-phase flow), whose result is regridded once, at the end. grid=nothing opts out.
Fields
grid::AdaptiveGrid: The grid generated when the solver returns fewer thangrid.ntimes (defaultAdaptiveGrid(250), the size of the solutions of the direct methods).
See also: CTFlows.Configs.AdaptiveGrid.
HamiltonianEndPointConfig [Struct]
CTFlows.Configs.HamiltonianEndPointConfig Type
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 timex0::X0: Initial state vectorp0::P0: Initial costate vectortf::TF: Final time
Example
julia> using CTFlows: Configs
julia> config = Configs.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.0See also: CTFlows.Configs.HamiltonianTrajectoryConfig, CTFlows.Configs.StateEndPointConfig.
HamiltonianTrajectoryConfig [Struct]
CTFlows.Configs.HamiltonianTrajectoryConfig Type
struct HamiltonianTrajectoryConfig{TS<:(Tuple{var"#s16", var"#s8"} where {var"#s16"<:Real, var"#s8"<:Real}), X0, P0, G<:Union{Nothing, CTFlows.Configs.AbstractGrid, AbstractVector}} <: 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 vectorp0::P0: Initial costate vectorgrid::G: Output grid of the call: times (seeCTFlows.Configs.TimeSpec), a generated grid (CTFlows.Configs.AbstractGrid), ornothing
Example
julia> using CTFlows: Configs
julia> config = Configs.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.StateEndPointConfig Type
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 timex0::X0: Initial state vectortf::TF: Final time
Example
julia> using CTFlows: Configs
julia> config = Configs.StateEndPointConfig(0.0, [1.0, 0.0], 1.0)
StateEndPointConfig
t0: 0.0
x0: [1.0, 0.0]
tf: 1.0See also: CTFlows.Configs.StateTrajectoryConfig
StateTrajectoryConfig [Struct]
CTFlows.Configs.StateTrajectoryConfig Type
struct StateTrajectoryConfig{TS<:(Tuple{var"#s4", var"#s3"} where {var"#s4"<:Real, var"#s3"<:Real}), X0, G<:Union{Nothing, CTFlows.Configs.AbstractGrid, AbstractVector}} <: 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 vectorgrid::G: Output grid of the call: times (seeCTFlows.Configs.TimeSpec), a generated grid (CTFlows.Configs.AbstractGrid), ornothing
Example
julia> using CTFlows: Configs
julia> config = Configs.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
TimeSpec [Struct]
CTFlows.Configs.TimeSpec Type
Time specification accepted by a trajectory call (and by the trajectory configurations):
a 2-tuple
(t0, tf)is the time span; the output grid is chosen automatically: the integrator'ssaveat, or else the default grid of a top-level call (CTFlows.Configs.AutomaticGrid:AdaptiveGrid(250)when the solver returns fewer than 250 times), or the solver steps withgrid=nothing;a vector (or range) of times, or a tuple of at least three times, imposes the output grid
(t0, t1, …, tf): the integration runs from its first to its last time and the trajectory is returned on exactly these times. The grid takes precedence over the integrator'ssaveat, and only affects the output: the integration and the dense interpolant are the same as for the span(t0, tf).
A grid must be strictly monotone (increasing for a forward integration, decreasing for a backward one).
See also: CTFlows.Configs.StateTrajectoryConfig, CTFlows.Configs.HamiltonianTrajectoryConfig, CTFlows.Configs.output_grid.
UniformGrid [Struct]
CTFlows.Configs.UniformGrid Type
struct UniformGrid <: CTFlows.Configs.AbstractGridUniform output grid of n times (grid=n is a shortcut for grid=UniformGrid(n)). On a multi-phase flow, the n - 1 intervals are shared between the phases in proportion to their duration.
Fields
n::Int: Number of distinct times, at least 2.
Throws
CTBase.Exceptions.IncorrectArgument: Ifn < 2.
See also: CTFlows.Configs.AdaptiveGrid.
final_time [Function]
CTFlows.Configs.final_time Function
final_time(c::CTFlows.Configs.AbstractConfig) -> RealReturn 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
) -> RealReturn 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
) -> RealReturn 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_condition Function
initial_condition(
c::CTFlows.Configs.AbstractConfig
) -> VectorReturn 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.AbstractModeTrait, CTBase.Traits.StateDynamics}
) -> VectorReturn 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
) -> VectorReturn 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
) -> AnyReturn 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
) -> AnyReturn 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_costate Function
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
) -> AnyReturn 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
) -> AnyReturn 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_state Function
initial_state(c::CTFlows.Configs.AbstractConfig) -> AnyReturn 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
) -> AnyReturn 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_time Function
initial_time(c::CTFlows.Configs.AbstractConfig) -> RealReturn 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
) -> RealReturn 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
) -> RealReturn 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_costate Function
initial_variable_costate(
c::CTFlows.Configs.AbstractConfig
) -> AnyReturn 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
) -> AnyReturn 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_trait Function
mode_trait(
_::CTFlows.Configs.AbstractConfigWithMaC{X0, Mode<:CTBase.Traits.AbstractModeTrait, Dyn<:CTBase.Traits.AbstractDynamicsTrait}
) -> Type{Mode} where Mode<:CTBase.Traits.AbstractModeTraitReturn 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.,EndPointModeorTrajectoryMode).
Example
config = Configs.HamiltonianEndPointConfig(0.0, [1.0], [0.5], 1.0)
Configs.mode_trait(config) === Traits.EndPointMode # trueSee also: CTFlows.Configs.AbstractConfigWithMaC, CTBase.Traits.EndPointMode, CTBase.Traits.TrajectoryMode, CTBase.Traits.dynamics_trait.
output_grid [Function]
CTFlows.Configs.output_grid Function
output_grid(_::CTFlows.Configs.AbstractConfig) -> AnyReturn the output time grid imposed at the call, or nothing (point configurations, and trajectory configurations built from a time span).
See also: CTFlows.Configs.TimeSpec.
output_grid(
c::CTFlows.Configs.AbstractTrajectoryConfig
) -> AnyReturn the output time grid imposed at the call, or nothing for a time span.
tspan [Function]
CTFlows.Configs.tspan Function
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.