Skip to content

Public API

This page lists exported symbols of CTFlows.Integrators.


From CTFlows.Integrators

CTFlows.Integrators [Module]

CTFlows.Integrators Module
julia
Integrators

Domain↔solver glue and re-export layer for ODE integration in CTFlows.

The generic ODE-integrator strategy surface (the AbstractIntegrator type, the SciML backend, the AbstractIntegrationResult interface, CommonSolve.solve, merge, and the option accessors) lives in CTSolvers.Integrators. This submodule re-exports the part of that surface consumed inside CTFlows so that existing Integrators.<symbol> call sites keep resolving, and it owns the two domain-specific glue functions that must stay in CTFlows because they are typed on CTFlows' own Systems/Configs/Traits:

Their concrete methods are provided by the CTFlowsSciMLIntegrator package extension (loaded with SciMLBase); the stubs here throw CTBase.Exceptions.ExtensionError until it is active.

build_options [Function]

CTFlows.Integrators.build_options Function
julia
build_options(
    integrator::CTSolvers.Integrators.AbstractIntegrator,
    config
) -> Dict{Symbol, Any}

Select the integrator's cached solver options for a given configuration.

This CTFlows-side glue dispatches on the Configs config type to return the appropriate pre-computed option bundle held by the integrator (see CTSolvers.Integrators.options_point / CTSolvers.Integrators.options_trajectory). The concrete methods are provided by the CTFlowsSciMLIntegrator extension; this stub throws CTBase.Exceptions.ExtensionError until it is loaded.

Arguments

  • integrator::CTSolvers.Integrators.AbstractIntegrator: The integrator strategy.

  • config: The integration configuration (a CTFlows.Configs.AbstractConfig or nothing).

Returns

  • Dict{Symbol,Any}: The resolved solver options for the configuration.

Throws

  • CTBase.Exceptions.ExtensionError: If the CTFlowsSciMLIntegrator extension is not loaded.

See also: build_problem, CTSolvers.Integrators.options_trajectory.

julia
build_options(
    integ::CTSolvers.Integrators.SciML,
    config::CTFlows.Configs.AbstractEndPointConfig
) -> Dict{Symbol, Any}

Return pre-computed solver options for point integration configs.

For point configs (e.g., StateEndPointConfig, HamiltonianEndPointConfig), options like dense, save_everystep, and save_start are set to false to minimize memory since only the final state is needed.

Arguments

  • integ::SciML: The SciML integrator with pre-computed option caches.

  • config::Configs.AbstractEndPointConfig: The point configuration.

Returns

  • Dict{Symbol,Any}: Pre-computed options optimized for point integration.

See also: CTFlows.Integrators.build_options, CTFlows.Configs.AbstractEndPointConfig.

julia
build_options(
    integ::CTSolvers.Integrators.SciML,
    config::CTFlows.Configs.AbstractTrajectoryConfig
) -> Dict{Symbol, Any}

Return pre-computed solver options for trajectory integration configs.

For trajectory configs (e.g., StateTrajectoryConfig, HamiltonianTrajectoryConfig), options like dense, save_everystep, and save_start are set to true to enable full trajectory storage and interpolation.

Arguments

  • integ::SciML: The SciML integrator with pre-computed option caches.

  • config::Configs.AbstractTrajectoryConfig: The trajectory configuration.

Returns

  • Dict{Symbol,Any}: Pre-computed options optimized for trajectory integration.

See also: CTFlows.Integrators.build_options, CTFlows.Configs.AbstractTrajectoryConfig.

julia
build_options(
    integ::CTSolvers.Integrators.SciML,
    config::Nothing
) -> Dict{Symbol, Any}

Return pre-computed solver options for the fallback case (nothing).

Defaults to trajectory options when no configuration is provided.

Arguments

  • integ::SciML: The SciML integrator with pre-computed option caches.

  • config::Nothing: No configuration provided (fallback).

Returns

  • Dict{Symbol,Any}: Pre-computed options for trajectory integration (fallback).

See also: CTFlows.Integrators.build_options.

build_problem [Function]

CTFlows.Integrators.build_problem Function
julia
build_problem(
    system::CTFlows.Systems.AbstractSystem,
    config::CTFlows.Configs.AbstractConfig,
    integrator::CTSolvers.Integrators.AbstractIntegrator;
    kwargs...
)

Build the ODE problem representation from a system and a configuration.

This is the CTFlows-side glue between the domain layer (Systems/Configs) and the generic integrator strategy: it constructs the SciML ODEProblem that CommonSolve.solve then integrates. The concrete methods are provided by the CTFlowsSciMLIntegrator extension; this stub throws CTBase.Exceptions.ExtensionError until it is loaded.

Arguments

  • system::CTFlows.Systems.AbstractSystem: The system providing the right-hand side.

  • config::CTFlows.Configs.AbstractConfig: The integration configuration (time span, initial condition, dynamics kind).

  • integrator::CTSolvers.Integrators.AbstractIntegrator: The integrator strategy.

  • variable: The variable parameter value (required for NonFixed systems).

Returns

  • A SciML ODEProblem (type provided by the extension).

Throws

  • CTBase.Exceptions.ExtensionError: If the CTFlowsSciMLIntegrator extension is not loaded.

See also: build_options, CTSolvers.Integrators.SciML.

julia
build_problem(
    system::CTFlows.Systems.AbstractSystem,
    config::CTFlows.Configs.AbstractConfig,
    ::CTSolvers.Integrators.SciML;
    variable
)

Build an ODEProblem from a system and a non-augmented configuration.

Dispatches between in-place and out-of-place RHS based on the mutability of the initial condition:

  • If ismutable(u0) is true, uses Systems.get_ip_rhs(system, config) with signature (du, u, p, t) -> nothing.

  • If ismutable(u0) is false (e.g., StaticArrays.SVector), uses Systems.get_oop_rhs(system, config) with signature (u, p, t) -> du.

Covers both state systems (AbstractStateSystem) and non-augmented Hamiltonian systems (AbstractHamiltonianSystem with AbstractHamiltonianConfig).

Arguments

  • system::Systems.AbstractSystem: The system to build an ODE problem for.

  • config::Configs.AbstractConfig: The configuration containing initial condition and time span.

  • ::Integrators.SciML: The SciML integrator strategy.

  • variable: Variable parameter for non-fixed systems.

Returns

  • SciMLBase.ODEProblem: The ODE problem ready for integration.

Throws

  • CTBase.Exceptions.PreconditionError: If the system dynamics trait is incompatible with the config type.

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

julia
build_problem(
    system::CTFlows.Systems.AbstractSystem,
    config::CTFlows.Configs.AbstractAugmentedHamiltonianConfig,
    ::CTSolvers.Integrators.SciML;
    variable
)

Build an ODEProblem for augmented Hamiltonian systems.

Uses the augmented RHS that computes state, costate, and variable costate derivatives. Always uses the in-place path since pv0 = zeros(...) guarantees mutability.

Arguments

  • system::Systems.AbstractSystem: The Hamiltonian system.

  • config::Configs.AbstractAugmentedHamiltonianConfig: The augmented Hamiltonian configuration.

  • ::Integrators.SciML: The SciML integrator strategy.

  • variable: Variable parameter for the augmented system.

Returns

  • SciMLBase.ODEProblem: The ODE problem with augmented RHS.

Throws

  • CTBase.Exceptions.PreconditionError: If the system dynamics trait is incompatible with the config type.

Notes

  • Only in-place path is implemented; pv0 = zeros(...) guarantees mutability by construction.

  • TODO: Add out-of-place path for SVector support in the future.

See also: CTFlows.Systems.get_ip_rhs_augmented, CTFlows.Configs.AbstractAugmentedHamiltonianConfig.