Public API
This page lists exported symbols of CTBase.Traits.
From CTBase.Traits
CTBase.Traits [Module]
CTBase.Traits Module
TraitsCompile-time trait types and trait-based dispatch utilities.
Traits are abstract or empty concrete types used as type parameters or returned by accessor functions. Behaviour is selected by dispatch at compile time, with no runtime cost.
Organization
abstract.jl: Root abstract type
AbstractTraitand family abstractionstime_dependence.jl: Time-dependence traits and the opt-in contract
variable_dependence.jl: Variable-dependence traits and the opt-in contract
control_dependence.jl: Control-dependence traits and the opt-in contract
feedback.jl: Feedback traits (
OpenLoopFeedback,ClosedLoopFeedback,DynClosedLoopFeedback)constraint_kind.jl: Constraint-kind traits (
StateConstraintKind,ControlConstraintKind,MixedConstraintKind)mutability.jl: Mutability traits and the opt-in contract
mode.jl: Integration-mode traits (
EndPointMode,TrajectoryMode)dynamics.jl: Dynamics-type traits (
StateDynamics,HamiltonianDynamics,AugmentedHamiltonianDynamics)ad.jl: Automatic-differentiation traits (
WithAD,WithoutAD)variable_costate.jl: Variable-costate traits (
SupportsVariableCostate,NoVariableCostate)helpers.jl: Internal utility (
_caller_function_name)
Public API
Trait families
Time dependence:
TimeDependence,Autonomous,NonAutonomousVariable dependence:
VariableDependence,Fixed,NonFixedControl dependence:
ControlDependence,ControlFree,WithControlFeedback:
AbstractFeedback,OpenLoopFeedback,ClosedLoopFeedback,DynClosedLoopFeedbackConstraint kind:
AbstractConstraintKind,StateConstraintKind,ControlConstraintKind,MixedConstraintKindMutability:
InPlace,OutOfPlaceIntegration mode:
EndPointMode,TrajectoryModeDynamics:
StateDynamics,HamiltonianDynamics,AugmentedHamiltonianDynamicsAutomatic differentiation:
WithAD,WithoutADVariable costate:
SupportsVariableCostate,NoVariableCostate
Trait contracts — two templates
Trait families follow one of two contracts. The choice is dictated by a single question: does a safe default value exist?
1. Strict opt-in (no safe default). Time-dependence, variable-dependence, control-dependence, and mutability. Guessing a value silently would be a correctness bug (an object is either autonomous or not), so there is no default: a type must opt in by implementing two methods — has_<family>_trait returning true, and an accessor (time_dependence, variable_dependence, control_dependence, mutability) returning the trait type. The fallbacks throw loudly (CTBase.Exceptions.IncorrectArgument / CTBase.Exceptions.NotImplemented) via the shared helpers _throw_missing_trait / _throw_trait_not_implemented. Boolean predicates (is_autonomous, is_variable, is_control_free, is_inplace, …) are derived generically.
2. Default-valued capability (safe default exists). Automatic differentiation (ad_trait(::Any) = WithoutAD) and variable-costate (variable_costate_trait(::Any) = NoVariableCostate). These are capabilities: a conservative "no" is always safe, so the extractor returns a default for any object and concrete types override it. No has_<family>_trait guard, no derived predicates.
The remaining families (EndPointMode, StateDynamics) are used as type parameters only (read from a concrete type's parameters, e.g. AbstractSystem{TD,VD,D}) and use neither contract.
AbstractADTrait [Abstract Type]
CTBase.Traits.AbstractADTrait Type
abstract type AbstractADTrait <: CTBase.Traits.AbstractTraitAbstract base type for automatic differentiation capability traits.
AD traits encode whether a system supports automatic differentiation for gradient computation. This distinction enables compile-time dispatch for cache preparation, derivative computation, and other AD-related operations.
Common use cases include:
Hamiltonian systems: distinguishing between scalar Hamiltonians with AD backends and pre-computed Hamiltonian vector fields
General optimization: marking systems that can compute gradients via AD vs. those with manual derivative implementations
Cache preparation: enabling static dispatch for AD-specific cache initialization
Example
julia> using CTBase.Traits
julia> WithAD() isa Traits.AbstractADTrait
true
julia> WithoutAD() isa Traits.AbstractADTrait
trueNotes
AD traits are used as type parameters in system types to enable static dispatch
WithADindicates the system carries differentiable functions and an AD backendWithoutADindicates the system uses pre-computed derivatives or manual implementationsThe specific meaning depends on the system type and context
See also: CTBase.Traits.WithAD, CTBase.Traits.WithoutAD, CTBase.Core.AbstractCache.
AbstractConstraintKind [Abstract Type]
CTBase.Traits.AbstractConstraintKind Type
abstract type AbstractConstraintKind <: CTBase.Traits.AbstractTraitAbstract base type for constraint-kind traits.
Constraint-kind traits encode, at the type level, which primal variables a path constraint g(...) depends on. They distinguish between pure state constraints, pure control constraints, and mixed state–control constraints.
Trait Pattern
This trait follows the type-parameter-only contract (like CTBase.Traits.AbstractFeedback): the trait value is read from a type parameter of the concrete data type (e.g. PathConstraint{F,K,TD,VD}) by the constraint_kind accessor. No has_constraint_kind_trait guard is provided; calling constraint_kind on a type that does not implement it yields a standard MethodError.
See also: CTBase.Traits.StateConstraintKind, CTBase.Traits.ControlConstraintKind, CTBase.Traits.MixedConstraintKind, CTBase.Traits.constraint_kind.
AbstractDynamicsTrait [Abstract Type]
CTBase.Traits.AbstractDynamicsTrait Type
abstract type AbstractDynamicsTrait <: CTBase.Traits.AbstractTraitAbstract base type for dynamics traits (State vs Hamiltonian).
Dynamics traits encode the dynamics type in configuration types, distinguishing between state-only configurations (no costate) and Hamiltonian configurations (state + costate).
Example
julia> using CTBase.Traits
julia> StateDynamics <: Traits.AbstractDynamicsTrait
true
julia> HamiltonianDynamics <: Traits.AbstractDynamicsTrait
trueNotes
State dynamics indicates configurations with only state variables (no costate)
Hamiltonian dynamics indicates configurations with both state and costate variables
See also: CTBase.Traits.StateDynamics, CTBase.Traits.HamiltonianDynamics.
AbstractFeedback [Abstract Type]
CTBase.Traits.AbstractFeedback Type
abstract type AbstractFeedback <: CTBase.Traits.AbstractTraitAbstract base type for feedback traits.
Feedback traits encode, at the type level, the kind of control law used to close the loop in an optimal control flow. They distinguish between open-loop control (time-only dependence), closed-loop control (state dependence), and dynamic closed-loop control (state and costate dependence).
Trait Pattern
This trait follows the type-parameter-only contract (like CTBase.Traits.AbstractDynamicsTrait): the trait value is read from a type parameter of the concrete data type (e.g. ControlLaw{F,FB,TD,VD}) by the feedback accessor. No has_feedback_trait guard is provided; calling feedback on a type that does not implement it yields a standard MethodError.
See also: CTBase.Traits.OpenLoopFeedback, CTBase.Traits.ClosedLoopFeedback, CTBase.Traits.DynClosedLoopFeedback, CTBase.Traits.feedback.
AbstractModeTrait [Abstract Type]
CTBase.Traits.AbstractModeTrait Type
abstract type AbstractModeTrait <: CTBase.Traits.AbstractTraitAbstract base type for mode traits (Point vs Trajectory).
Mode traits encode the integration mode in configuration types, distinguishing between point-to-point integration (single endpoint evaluation) and trajectory integration (full time evolution).
Example
julia> using CTBase.Traits
julia> EndPointMode <: Traits.AbstractModeTrait
true
julia> TrajectoryMode <: Traits.AbstractModeTrait
trueNotes
Point mode indicates integration from a single initial condition to a specific final time
Trajectory mode indicates integration over a continuous time interval
See also: CTBase.Traits.EndPointMode, CTBase.Traits.TrajectoryMode.
AbstractMutabilityTrait [Abstract Type]
CTBase.Traits.AbstractMutabilityTrait Type
abstract type AbstractMutabilityTrait <: CTBase.Traits.AbstractTraitAbstract trait for mutability characteristics of function evaluation.
Distinguishes between in-place functions (which modify a pre-allocated buffer) and out-of-place functions (which allocate and return new results).
Subtypes must implement:
InPlace: For functions that write to a mutable bufferOutOfPlace: For functions that return newly allocated results
Example
julia> using CTBase.Traits
julia> InPlace() isa AbstractMutabilityTrait
true
julia> OutOfPlace() isa AbstractMutabilityTrait
trueSee also: CTBase.Traits.InPlace, CTBase.Traits.OutOfPlace.
AbstractTrait [Abstract Type]
CTBase.Traits.AbstractTrait Type
abstract type AbstractTraitAbstract base type for all trait markers.
Traits are empty marker types used as type parameters to encode properties at compile time. Unlike tags (which mark extension implementations), traits encode semantic properties of an object (e.g., integration mode, dynamics type, mutability). All concrete trait types are empty structs with no fields, making them zero-cost at runtime.
Interface Requirements
Concrete trait subtypes should:
Be empty structs with no fields (pure markers)
Subtype an intermediate abstract trait category (e.g.,
AbstractModeTrait)Be used as type parameters or returned by accessor functions
Example
julia> using CTBase.Traits
julia> EndPointMode <: Traits.AbstractTrait
true
julia> EndPointMode <: Traits.AbstractModeTrait
trueNotes
Traits are distinct from tags: tags mark extension implementations (e.g.,
SciMLTag), while traits encode configuration semantics (e.g.,EndPointMode)All trait types have zero runtime overhead (empty structs)
The trait pattern enables static dispatch on configuration properties
See also: CTBase.Traits.VariableDependence, CTBase.Traits.AbstractModeTrait, CTBase.Traits.AbstractDynamicsTrait, CTBase.Traits.AbstractMutabilityTrait.
AbstractVariableCostateCapability [Abstract Type]
CTBase.Traits.AbstractVariableCostateCapability Type
abstract type AbstractVariableCostateCapability <: CTBase.Traits.AbstractTraitAbstract base type for variable costate capability traits.
Variable costate capability traits encode whether a system or flow can integrate augmented variables (e.g., parameters, controls) and compute their associated costates. This capability is used for trait-based dispatch in augmented integration.
Common use cases include:
Hamiltonian systems: computing the costate of an augmented variable (∂H/∂v integration)
Optimal control: integrating control variables with their adjoint equations
Parameter estimation: treating parameters as dynamic variables with derivatives
Example
julia> using CTBase.Traits
julia> SupportsVariableCostate() isa Traits.AbstractVariableCostateCapability
true
julia> NoVariableCostate() isa Traits.AbstractVariableCostateCapability
trueNotes
SupportsVariableCostateindicates the system can compute derivatives with respect to augmented variablesNoVariableCostateindicates the system cannot compute such derivativesThis trait is used for dispatch to determine whether augmented integration is possible
The specific operations enabled depend on the system type and context
See also: CTBase.Traits.SupportsVariableCostate, CTBase.Traits.NoVariableCostate.
AugmentedHamiltonianDynamics [Struct]
CTBase.Traits.AugmentedHamiltonianDynamics Type
struct AugmentedHamiltonianDynamics <: CTBase.Traits.AbstractDynamicsTraitTrait marker for augmented Hamiltonian dynamics, where the Hamiltonian includes an augmented variable (e.g., a parameter or control variable) in addition to state and costate variables.
Notes
Subtypes
CTBase.Traits.AbstractDynamicsTrait.Used to distinguish augmented Hamiltonian systems from standard Hamiltonian systems in trait-based dispatch.
See also: CTBase.Traits.HamiltonianDynamics, CTBase.Traits.AbstractDynamicsTrait.
Autonomous [Abstract Type]
CTBase.Traits.Autonomous Type
abstract type Autonomous <: CTBase.Traits.TimeDependenceType tag indicating that the dynamics and other functions do not explicitly depend on time. For autonomous systems, the dynamics have the form ẋ = f(x, u) rather than ẋ = f(t, x, u).
See also: CTBase.Traits.TimeDependence, CTBase.Traits.NonAutonomous.
ClosedLoopFeedback [Struct]
CTBase.Traits.ClosedLoopFeedback Type
struct ClosedLoopFeedback <: CTBase.Traits.AbstractFeedbackTrait indicating closed-loop feedback: the control depends on the state (and optionally time and variable), but not on the costate.
A closed-loop control law has the form u(t, x) (or u(t, x, v) for variable problems). The control is a function of the current state, providing static state feedback without costate information.
See also: CTBase.Traits.OpenLoopFeedback, CTBase.Traits.DynClosedLoopFeedback, CTBase.Traits.AbstractFeedback.
ControlConstraintKind [Struct]
CTBase.Traits.ControlConstraintKind Type
struct ControlConstraintKind <: CTBase.Traits.AbstractConstraintKindTrait indicating a pure control path constraint: g depends on the control (and optionally time and variable), but not on the state.
A control constraint has the form g(u) (or g(t, u), g(u, v), g(t, u, v)).
See also: CTBase.Traits.StateConstraintKind, CTBase.Traits.MixedConstraintKind, CTBase.Traits.AbstractConstraintKind.
ControlDependence [Abstract Type]
CTBase.Traits.ControlDependence Type
abstract type ControlDependence <: CTBase.Traits.AbstractTraitAbstract supertype for control-dependence traits.
Encodes, at the type level, whether an optimal control problem (or any object that opts into the trait) carries a control input.
Trait Pattern
Objects that have a control-dependence trait must implement two methods:
has_control_dependence_trait(obj::MyType) = true: Indicates the type has this traitcontrol_dependence(obj::MyType): Returns the specific trait value (ControlFreeorWithControl)
Once these are implemented, the object automatically gains:
is_control_free(obj): Returns true ifcontrol_dependence(obj)isControlFreehas_control(obj): Returns true ifcontrol_dependence(obj)isWithControl
If has_control_dependence_trait is not implemented or returns false, calling is_control_free, has_control, or control_dependence will throw an error indicating the object does not support control-dependence queries.
See also: CTBase.Traits.ControlFree, CTBase.Traits.WithControl.
ControlFree [Struct]
CTBase.Traits.ControlFree Type
struct ControlFree <: CTBase.Traits.ControlDependenceTrait indicating the problem has no control input (control-free).
A control-free optimal control problem has dynamics ẋ = f(t, x, v) with no control argument; the trajectory is determined by the state (and costate) equations alone, without a control law.
See also: CTBase.Traits.WithControl, CTBase.Traits.ControlDependence.
DynClosedLoopFeedback [Struct]
CTBase.Traits.DynClosedLoopFeedback Type
struct DynClosedLoopFeedback <: CTBase.Traits.AbstractFeedbackTrait indicating dynamic closed-loop feedback: the control depends on both the state and the costate (and optionally time and variable).
A dynamic closed-loop control law has the form u(t, x, p) (or u(t, x, p, v) for variable problems). The control is a function of the full Hamiltonian state, providing dynamic feedback that uses costate information — typically derived from the pseudo-Hamiltonian maximisation condition.
See also: CTBase.Traits.OpenLoopFeedback, CTBase.Traits.ClosedLoopFeedback, CTBase.Traits.AbstractFeedback.
EndPointMode [Struct]
CTBase.Traits.EndPointMode Type
struct EndPointMode <: CTBase.Traits.AbstractModeTraitTrait for point integration mode (single endpoint evaluation).
Used as a type parameter in AbstractConfig to indicate point integration, which computes the solution at a specific final time from a single initial condition.
Example
julia> using CTBase.Traits
julia> pt = EndPointMode()
EndPointMode()
julia> pt isa Traits.AbstractModeTrait
trueNotes
Point mode configurations store
t0andtfas separate fieldsThis mode is suitable for boundary value problems and shooting methods
The
tspanaccessor returns(c.t0, c.tf)for point configurations
See also: CTBase.Traits.TrajectoryMode, CTBase.Traits.AbstractModeTrait.
Fixed [Struct]
CTBase.Traits.Fixed Type
struct Fixed <: CTBase.Traits.VariableDependenceTrait indicating the system or function has no variable parameters.
Indicates that the system operates with fixed parameters only, without additional variable arguments that can be treated as dynamic variables during integration.
Common use cases include:
Functions with fixed parameters only
Systems with constant parameters that are not integrated
Configurations where all parameters are known at compile time
See also: CTBase.Traits.NonFixed, CTBase.Traits.VariableDependence.
HamiltonianDynamics [Struct]
CTBase.Traits.HamiltonianDynamics Type
struct HamiltonianDynamics <: CTBase.Traits.AbstractDynamicsTraitTrait for Hamiltonian dynamics (state + costate).
Used as a type parameter in AbstractConfig to indicate Hamiltonian configurations, which contain both state variables and associated costate (adjoint) variables.
Example
julia> using CTBase.Traits
julia> ham = HamiltonianDynamics()
HamiltonianDynamics()
julia> ham isa Traits.AbstractDynamicsTrait
trueNotes
Hamiltonian configurations store both
x0(initial state) andp0(initial costate)The
initial_conditionaccessor returnsvcat(x0, p0)for Hamiltonian configurationsThis mode is suitable for optimal control problems with Pontryagin's maximum principle
See also: CTBase.Traits.StateDynamics, CTBase.Traits.AbstractDynamicsTrait.
InPlace [Struct]
CTBase.Traits.InPlace Type
struct InPlace <: CTBase.Traits.AbstractMutabilityTraitTrait for in-place function evaluation.
Indicates that a function modifies a pre-allocated buffer passed as an argument, rather than allocating and returning a new result. This pattern is used for performance-critical code where avoiding allocations is important.
Example
julia> using CTBase.Traits
julia> ip = InPlace()
InPlace()
julia> ip isa AbstractMutabilityTrait
trueSee also: CTBase.Traits.AbstractMutabilityTrait, CTBase.Traits.OutOfPlace.
MixedConstraintKind [Struct]
CTBase.Traits.MixedConstraintKind Type
struct MixedConstraintKind <: CTBase.Traits.AbstractConstraintKindTrait indicating a mixed state–control path constraint: g depends on both the state and the control (and optionally time and variable).
A mixed constraint has the form g(x, u) (or g(t, x, u), g(x, u, v), g(t, x, u, v)).
See also: CTBase.Traits.StateConstraintKind, CTBase.Traits.ControlConstraintKind, CTBase.Traits.AbstractConstraintKind.
NoVariableCostate [Struct]
CTBase.Traits.NoVariableCostate Type
struct NoVariableCostate <: CTBase.Traits.AbstractVariableCostateCapabilityTrait for systems/flows that do not support augmented variable integration.
Indicates that the system or flow cannot compute derivatives with respect to augmented variables or integrate their associated costates. This is the default for most systems, including those with pre-computed derivatives or fixed parameters.
Common use cases include:
Hamiltonian systems: pre-computed Hamiltonian vector fields without AD
Fixed systems: systems with parameters that are not treated as dynamic variables
General systems: any system where augmented variable integration is not applicable
Example
julia> using CTBase.Traits
julia> nvc = NoVariableCostate()
NoVariableCostate()
julia> nvc isa Traits.AbstractVariableCostateCapability
trueNotes
Default return value from
variable_costate_traitfor most systems and flowsSystems without AD support or with fixed variable dependence typically return this
Attempting augmented integration operations on such systems will throw an error
The specific constraints depend on the system type
See also: CTBase.Traits.AbstractVariableCostateCapability, CTBase.Traits.SupportsVariableCostate, CTBase.Traits.variable_costate_trait.
NonAutonomous [Abstract Type]
CTBase.Traits.NonAutonomous Type
abstract type NonAutonomous <: CTBase.Traits.TimeDependenceType tag indicating that the dynamics and other functions explicitly depend on time. For non-autonomous systems, the dynamics have the form ẋ = f(t, x, u).
See also: CTBase.Traits.TimeDependence, CTBase.Traits.Autonomous.
NonFixed [Struct]
CTBase.Traits.NonFixed Type
struct NonFixed <: CTBase.Traits.VariableDependenceTrait indicating the system or function depends on variable parameters.
Indicates that the system operates with additional variable parameters that can be treated as dynamic variables during integration or optimization. These variables may be integrated alongside state variables or used for sensitivity analysis.
Common use cases include:
Functions with an extra variable argument
vSystems with parameters that vary during integration
Configurations where parameters are treated as control variables
Sensitivity analysis and parameter estimation
See also: CTBase.Traits.Fixed, CTBase.Traits.VariableDependence.
OpenLoopFeedback [Struct]
CTBase.Traits.OpenLoopFeedback Type
struct OpenLoopFeedback <: CTBase.Traits.AbstractFeedbackTrait indicating open-loop feedback: the control depends only on time (and optionally the variable), not on the state or costate.
An open-loop control law has the form u(t) (or u(t, v) for variable problems). The trajectory is determined entirely by the pre-specified control function, without feedback from the current state.
See also: CTBase.Traits.ClosedLoopFeedback, CTBase.Traits.DynClosedLoopFeedback, CTBase.Traits.AbstractFeedback.
OutOfPlace [Struct]
CTBase.Traits.OutOfPlace Type
struct OutOfPlace <: CTBase.Traits.AbstractMutabilityTraitTrait for out-of-place function evaluation.
Indicates that a function allocates and returns a new result, rather than modifying a pre-allocated buffer. This is the default pattern in Julia and is suitable for most use cases.
Example
julia> using CTBase.Traits
julia> oop = OutOfPlace()
OutOfPlace()
julia> oop isa AbstractMutabilityTrait
trueSee also: CTBase.Traits.AbstractMutabilityTrait, CTBase.Traits.InPlace.
StateConstraintKind [Struct]
CTBase.Traits.StateConstraintKind Type
struct StateConstraintKind <: CTBase.Traits.AbstractConstraintKindTrait indicating a pure state path constraint: g depends on the state (and optionally time and variable), but not on the control.
A state constraint has the form g(x) (or g(t, x), g(x, v), g(t, x, v)).
See also: CTBase.Traits.ControlConstraintKind, CTBase.Traits.MixedConstraintKind, CTBase.Traits.AbstractConstraintKind.
StateDynamics [Struct]
CTBase.Traits.StateDynamics Type
struct StateDynamics <: CTBase.Traits.AbstractDynamicsTraitTrait for state dynamics (no costate).
Used as a type parameter in AbstractConfig to indicate state-only configurations, which contain only state variables without associated costate variables.
Example
julia> using CTBase.Traits
julia> st = StateDynamics()
StateDynamics()
julia> st isa Traits.AbstractDynamicsTrait
trueNotes
State configurations store only
x0(initial state)The
initial_costateaccessor throws aPreconditionErrorfor state configurationsThis mode is suitable for standard ODE integration without adjoint variables
See also: CTBase.Traits.HamiltonianDynamics, CTBase.Traits.AbstractDynamicsTrait.
SupportsVariableCostate [Struct]
CTBase.Traits.SupportsVariableCostate Type
struct SupportsVariableCostate <: CTBase.Traits.AbstractVariableCostateCapabilityTrait for systems/flows that support augmented variable integration.
Indicates that the system or flow can compute derivatives with respect to augmented variables (e.g., parameters, controls) and integrate their associated costates. This typically requires automatic differentiation support and variable dependence.
Common use cases include:
Hamiltonian systems: computing ∂H/∂v via AD from a scalar Hamiltonian
Optimal control: integrating control variables with their adjoint equations
General systems: any system where augmented variables need derivative computation
Example
julia> using CTBase.Traits
julia> svc = SupportsVariableCostate()
SupportsVariableCostate()
julia> svc isa Traits.AbstractVariableCostateCapability
trueNotes
Used as a return value from
variable_costate_traitfor systems that support augmented variable integrationTypically requires AD support and variable dependence in the system
This trait enables augmented integration operations in flow calls
The specific implementation depends on the system type and AD backend
See also: CTBase.Traits.AbstractVariableCostateCapability, CTBase.Traits.NoVariableCostate, CTBase.Traits.variable_costate_trait.
TimeDependence [Abstract Type]
CTBase.Traits.TimeDependence Type
abstract type TimeDependenceAbstract base type representing time dependence of an object (e.g. an optimal control problem, a vector field, a Hamiltonian).
Used as a type parameter to distinguish between autonomous and non-autonomous objects at the type level, enabling dispatch and compile-time optimisations.
See also: CTBase.Traits.Autonomous, CTBase.Traits.NonAutonomous.
TrajectoryMode [Struct]
CTBase.Traits.TrajectoryMode Type
struct TrajectoryMode <: CTBase.Traits.AbstractModeTraitTrait for trajectory integration mode (full time evolution).
Used as a type parameter in AbstractConfig to indicate trajectory integration, which computes the full solution trajectory over a continuous time interval.
Example
julia> using CTBase.Traits
julia> traj = TrajectoryMode()
TrajectoryMode()
julia> traj isa Traits.AbstractModeTrait
trueNotes
Trajectory mode configurations store
tspanas a tuple fieldThis mode is suitable for generating full time evolution and visualization
The
tspanaccessor returnsc.tspandirectly for trajectory configurations
See also: CTBase.Traits.EndPointMode, CTBase.Traits.AbstractModeTrait.
VariableDependence [Abstract Type]
CTBase.Traits.VariableDependence Type
abstract type VariableDependence <: CTBase.Traits.AbstractTraitAbstract supertype for variable-dependence traits.
Trait Pattern
Objects that have a variable-dependence trait must implement two methods:
has_variable_dependence_trait(obj::MyType) = true: Indicates the type has this traitvariable_dependence(obj::MyType): Returns the specific trait value (FixedorNonFixed)
Once these are implemented, the object automatically gains:
is_variable(obj): Returns true ifvariable_dependence(obj)isNonFixedis_nonvariable(obj): Returns true ifvariable_dependence(obj)isFixedhas_variable(obj): Alias foris_variable(CTModels compatibility)
If has_variable_dependence_trait is not implemented or returns false, calling is_variable, is_nonvariable, has_variable, or variable_dependence will throw an error indicating the object does not support variable-dependence queries.
WithAD [Struct]
CTBase.Traits.WithAD Type
struct WithAD <: CTBase.Traits.AbstractADTraitTrait for systems with automatic differentiation support.
Indicates that a system carries differentiable functions and an AD backend, enabling automatic computation of derivatives. Such systems typically require cache preparation before operations that need gradients or Jacobians.
Common use cases include:
Hamiltonian systems: scalar Hamiltonians where the vector field is computed via AD
Optimization: objective functions where gradients are computed via AD
General systems: any differentiable function that benefits from automatic gradient computation
Example
julia> using CTBase.Traits
julia> with = WithAD()
WithAD()
julia> with isa Traits.AbstractADTrait
trueNotes
Used as a type parameter in system types to enable AD-based derivative computation
Systems with
WithADtypically require cache preparation via the backend'sprepare_cachemethodThe cache is passed through parameters during integration or evaluation
The specific operations enabled depend on the system type and AD backend
See also: CTBase.Traits.AbstractADTrait, CTBase.Traits.WithoutAD, CTBase.Core.AbstractCache.
WithControl [Struct]
CTBase.Traits.WithControl Type
struct WithControl <: CTBase.Traits.ControlDependenceTrait indicating the problem has a control input.
A problem with control has dynamics ẋ = f(t, x, u, v) depending on a control u; closing the loop (e.g. for a flow) requires a control law u(t, x, p).
See also: CTBase.Traits.ControlFree, CTBase.Traits.ControlDependence.
WithoutAD [Struct]
CTBase.Traits.WithoutAD Type
struct WithoutAD <: CTBase.Traits.AbstractADTraitTrait for systems without automatic differentiation support.
Indicates that a system uses pre-computed derivatives or manual implementations, without requiring AD or cache preparation. This is the traditional mode where derivatives are provided explicitly by the user or computed offline.
Common use cases include:
Hamiltonian systems: pre-computed Hamiltonian vector fields provided manually
Optimization: manually implemented gradient functions
General systems: any system where derivatives are known analytically or computed externally
Example
julia> using CTBase.Traits
julia> without = WithoutAD()
WithoutAD()
julia> without isa Traits.AbstractADTrait
trueNotes
Used as a type parameter in system types for derivative-based systems without AD
No cache preparation is required for
WithoutADsystemsThis is the default mode for systems with pre-computed derivatives
The specific derivative implementations depend on the system type
See also: CTBase.Traits.AbstractADTrait, CTBase.Traits.WithAD.
ad_trait [Function]
CTBase.Traits.ad_trait Function
ad_trait(_) -> Type{CTBase.Traits.WithoutAD}Return the automatic differentiation capability trait of a system or flow.
Arguments
obj: Any object (default implementation returnsWithoutAD).
Returns
Type{<:AbstractADTrait}: The AD capability trait, eitherWithADorWithoutAD.
Notes
Default implementation returns
WithoutADfor all objectsSpecialized implementations on system types return the appropriate trait based on the system's AD support
Used for dispatch in cache preparation, derivative computation, and augmented integration
The specific operations enabled by the trait depend on the system type
See also: CTBase.Traits.AbstractADTrait, CTBase.Traits.WithAD, CTBase.Traits.WithoutAD.
constraint_kind [Function]
CTBase.Traits.constraint_kind Function
Return the constraint-kind trait of x.
Methods are defined on concrete types in Data (e.g. AbstractPathConstraint). The trait value is one of CTBase.Traits.StateConstraintKind, CTBase.Traits.ControlConstraintKind, or CTBase.Traits.MixedConstraintKind.
See also: CTBase.Traits.AbstractConstraintKind, CTBase.Traits.StateConstraintKind, CTBase.Traits.ControlConstraintKind, CTBase.Traits.MixedConstraintKind.
control_dependence [Function]
CTBase.Traits.control_dependence Function
control_dependence(obj)Return the control-dependence trait value for the object.
This fallback method throws an error indicating the method is not implemented. Concrete types that have the trait should implement control_dependence(obj::MyType) to return the specific trait value (ControlFree or WithControl).
Arguments
obj::Any: The object to query.
Throws
CTBase.Exceptions.NotImplemented: Always, indicating the method must be implemented.
See also: CTBase.Traits.ControlDependence, CTBase.Traits.has_control_dependence_trait.
dynamics_trait [Function]
CTBase.Traits.dynamics_trait Function
dynamics_trait(x)Return the dynamics trait of x.
Methods are defined on concrete types in Systems and Configs.
See also: CTBase.Traits.AbstractDynamicsTrait, CTBase.Traits.StateDynamics, CTBase.Traits.HamiltonianDynamics.
feedback [Function]
CTBase.Traits.feedback Function
Return the feedback trait of x.
Methods are defined on concrete types in Data (e.g. AbstractControlLaw). The trait value is one of CTBase.Traits.OpenLoopFeedback, CTBase.Traits.ClosedLoopFeedback, or CTBase.Traits.DynClosedLoopFeedback.
See also: CTBase.Traits.AbstractFeedback, CTBase.Traits.OpenLoopFeedback, CTBase.Traits.ClosedLoopFeedback, CTBase.Traits.DynClosedLoopFeedback.
has_control [Function]
CTBase.Traits.has_control Function
has_control(obj)Return true if the object has a control input.
Checks that the object has the control-dependence trait, then returns true if control_dependence(obj) is WithControl.
Arguments
obj::Any: The object to check.
Returns
Bool: true if the object has a control input.
Throws
CTBase.Exceptions.IncorrectArgument: If the object does not support control-dependence queries.CTBase.Exceptions.NotImplemented: Ifcontrol_dependenceis not implemented for the object type.
See also: CTBase.Traits.ControlDependence, CTBase.Traits.is_control_free.
has_control_dependence_trait [Function]
CTBase.Traits.has_control_dependence_trait Function
has_control_dependence_trait(obj)Check if the object has the control-dependence trait.
This fallback method throws an error indicating the object does not support control-dependence queries. Concrete types that have the trait should implement has_control_dependence_trait(obj::MyType) = true.
The calling function name is automatically detected from the stacktrace for better error messages.
Arguments
obj::Any: The object to check.
Throws
CTBase.Exceptions.IncorrectArgument: Always, indicating the object does not have the trait.
See also: CTBase.Traits.ControlDependence, CTBase.Traits.control_dependence.
has_mutability_trait [Function]
CTBase.Traits.has_mutability_trait Function
has_mutability_trait(obj) -> BoolCheck if the object has the mutability trait.
This fallback method throws an error indicating the object does not support mutability queries. Concrete types that have the trait should implement has_mutability_trait(obj::MyType) = true.
The calling function name is automatically detected from the stacktrace for better error messages.
Arguments
obj::Any: The object to check.
Throws
CTBase.Exceptions.IncorrectArgument: Always, indicating the object does not have the trait.
See also: CTBase.Traits.AbstractMutabilityTrait, CTBase.Traits.mutability.
has_mutability_trait(
_::CTBase.Data.AbstractVectorField
) -> BoolIndicate that AbstractVectorField has the mutability trait.
This implementation declares that all vector fields support mutability queries. Concrete AbstractVectorField instances have their mutability encoded in the type parameter MD.
See also: CTBase.Traits.mutability, CTBase.Data.AbstractVectorField.
has_time_dependence_trait [Function]
CTBase.Traits.has_time_dependence_trait Function
has_time_dependence_trait(obj) -> BoolCheck if the object has the time-dependence trait.
This fallback method throws an error indicating the object does not support time-dependence queries. Concrete types that have the trait should implement has_time_dependence_trait(obj::MyType) = true.
The calling function name is automatically detected from the stacktrace for better error messages.
Arguments
obj::Any: The object to check.
Throws
CTBase.Exceptions.IncorrectArgument: Always, indicating the object does not have the trait.
See also: CTBase.Traits.TimeDependence, CTBase.Traits.time_dependence.
has_time_dependence_trait(
_::CTBase.Data.AbstractVectorField
) -> BoolIndicate that AbstractVectorField has the time-dependence trait.
This implementation declares that all vector fields support time-dependence queries. Concrete AbstractVectorField instances have their time dependence encoded in the type parameter TD.
See also: CTBase.Traits.time_dependence, CTBase.Data.AbstractVectorField.
has_time_dependence_trait(
_::CTBase.Data.AbstractHamiltonian
) -> BoolIndicates that all AbstractHamiltonian types support time-dependence queries.
Returns
true: Always returnstruefor Hamiltonian types.
See also: CTBase.Traits.time_dependence, CTBase.Data.AbstractHamiltonian.
has_time_dependence_trait(
_::CTBase.Data.AbstractControlLaw
) -> BoolIndicates that all AbstractControlLaw types support time-dependence queries.
Returns
true: Always returnstruefor control law types.
See also: CTBase.Traits.time_dependence, CTBase.Data.AbstractControlLaw.
has_time_dependence_trait(
_::CTBase.Data.AbstractPathConstraint
) -> BoolIndicates that all AbstractPathConstraint types support time-dependence queries.
Returns
true: Always returnstruefor path constraint types.
See also: CTBase.Traits.time_dependence, CTBase.Data.AbstractPathConstraint.
has_time_dependence_trait(
_::CTBase.Data.AbstractMultiplier
) -> BoolIndicates that all AbstractMultiplier types support time-dependence queries.
Returns
true: Always returnstruefor multiplier types.
See also: CTBase.Traits.time_dependence, CTBase.Data.AbstractMultiplier.
has_time_dependence_trait(
_::CTBase.Data.AbstractPseudoHamiltonian
) -> BoolIndicates that all AbstractPseudoHamiltonian types support time-dependence queries.
Returns
true: Always returnstruefor pseudo-Hamiltonian types.
See also: CTBase.Traits.time_dependence, CTBase.Data.AbstractPseudoHamiltonian.
has_time_dependence_trait(
_::CTBase.Data.AbstractControlledVectorField
) -> BoolIndicate that all AbstractControlledVectorField types support time-dependence queries.
See also: CTBase.Traits.time_dependence.
has_variable [Function]
CTBase.Traits.has_variable Function
has_variable(obj) -> BoolReturn true if the object depends on variable parameters.
Checks that the object has the variable-dependence trait, then returns true if variable_dependence(obj) is NonFixed.
Arguments
obj::Any: The object to check.
Returns
Bool: true if the object depends on variable parameters.
Throws
CTBase.Exceptions.IncorrectArgument: If the object does not support variable-dependence queries.CTBase.Exceptions.NotImplemented: Ifvariable_dependenceis not implemented for the object type.
See also: CTBase.Traits.is_variable, CTBase.Traits.VariableDependence.
has_variable_dependence_trait [Function]
CTBase.Traits.has_variable_dependence_trait Function
has_variable_dependence_trait(obj) -> BoolCheck if the object has the variable-dependence trait.
This fallback method throws an error indicating the object does not support variable-dependence queries. Concrete types that have the trait should implement has_variable_dependence_trait(obj::MyType) = true.
The calling function name is automatically detected from the stacktrace for better error messages.
Arguments
obj::Any: The object to check.
Throws
CTBase.Exceptions.IncorrectArgument: Always, indicating the object does not have the trait.
See also: CTBase.Traits.VariableDependence, CTBase.Traits.variable_dependence.
has_variable_dependence_trait(
_::CTBase.Data.AbstractVectorField
) -> BoolIndicate that AbstractVectorField has the variable-dependence trait.
This implementation declares that all vector fields support variable-dependence queries. Concrete AbstractVectorField instances have their variable dependence encoded in the type parameter VD.
See also: CTBase.Traits.variable_dependence, CTBase.Data.AbstractVectorField.
has_variable_dependence_trait(
_::CTBase.Data.AbstractHamiltonian
) -> BoolIndicates that all AbstractHamiltonian types support variable-dependence queries.
Returns
true: Always returnstruefor Hamiltonian types.
See also: CTBase.Traits.variable_dependence, CTBase.Data.AbstractHamiltonian.
has_variable_dependence_trait(
_::CTBase.Data.AbstractControlLaw
) -> BoolIndicates that all AbstractControlLaw types support variable-dependence queries.
Returns
true: Always returnstruefor control law types.
See also: CTBase.Traits.variable_dependence, CTBase.Data.AbstractControlLaw.
has_variable_dependence_trait(
_::CTBase.Data.AbstractPathConstraint
) -> BoolIndicates that all AbstractPathConstraint types support variable-dependence queries.
Returns
true: Always returnstruefor path constraint types.
See also: CTBase.Traits.variable_dependence, CTBase.Data.AbstractPathConstraint.
has_variable_dependence_trait(
_::CTBase.Data.AbstractMultiplier
) -> BoolIndicates that all AbstractMultiplier types support variable-dependence queries.
Returns
true: Always returnstruefor multiplier types.
See also: CTBase.Traits.variable_dependence, CTBase.Data.AbstractMultiplier.
has_variable_dependence_trait(
_::CTBase.Data.AbstractPseudoHamiltonian
) -> BoolIndicates that all AbstractPseudoHamiltonian types support variable-dependence queries.
Returns
true: Always returnstruefor pseudo-Hamiltonian types.
See also: CTBase.Traits.variable_dependence, CTBase.Data.AbstractPseudoHamiltonian.
has_variable_dependence_trait(
_::CTBase.Data.AbstractControlledVectorField
) -> BoolIndicate that all AbstractControlledVectorField types support variable-dependence queries.
See also: CTBase.Traits.variable_dependence.
is_autonomous [Function]
CTBase.Traits.is_autonomous Function
is_autonomous(obj) -> BoolReturn true if the object is autonomous (time-independent).
Checks that the object has the time-dependence trait, then returns true if time_dependence(obj) is Autonomous.
Arguments
obj::Any: The object to check.
Returns
Bool: true if the object is autonomous.
Throws
CTBase.Exceptions.IncorrectArgument: If the object does not support time-dependence queries.CTBase.Exceptions.NotImplemented: Iftime_dependenceis not implemented for the object type.
See also: CTBase.Traits.TimeDependence, CTBase.Traits.time_dependence.
is_closed_loop [Function]
CTBase.Traits.is_closed_loop Function
Return true if x has closed-loop feedback.
Methods are defined on concrete types in Data (e.g. AbstractControlLaw).
Returns
Bool:trueif the feedback trait isClosedLoopFeedback,falseotherwise.
See also: CTBase.Traits.ClosedLoopFeedback, CTBase.Traits.feedback.
is_control_constraint [Function]
CTBase.Traits.is_control_constraint Function
Return true if x is a pure control path constraint.
Methods are defined on concrete types in Data (e.g. AbstractPathConstraint).
Returns
Bool:trueif the constraint-kind trait isControlConstraintKind,falseotherwise.
See also: CTBase.Traits.ControlConstraintKind, CTBase.Traits.constraint_kind.
is_control_free [Function]
CTBase.Traits.is_control_free Function
is_control_free(obj)Return true if the object is control-free (has no control input).
Checks that the object has the control-dependence trait, then returns true if control_dependence(obj) is ControlFree.
Arguments
obj::Any: The object to check.
Returns
Bool: true if the object has no control input.
Throws
CTBase.Exceptions.IncorrectArgument: If the object does not support control-dependence queries.CTBase.Exceptions.NotImplemented: Ifcontrol_dependenceis not implemented for the object type.
See also: CTBase.Traits.ControlDependence, CTBase.Traits.has_control.
is_dyn_closed_loop [Function]
CTBase.Traits.is_dyn_closed_loop Function
Return true if x has dynamic closed-loop feedback.
Methods are defined on concrete types in Data (e.g. AbstractControlLaw).
Returns
Bool:trueif the feedback trait isDynClosedLoopFeedback,falseotherwise.
See also: CTBase.Traits.DynClosedLoopFeedback, CTBase.Traits.feedback.
is_inplace [Function]
CTBase.Traits.is_inplace Function
is_inplace(obj) -> BoolReturn true if the object uses in-place function evaluation.
Checks that the object has the mutability trait, then returns true if mutability(obj) is InPlace.
Arguments
obj::Any: The object to check.
Returns
Bool: true if the object uses in-place evaluation.
Throws
CTBase.Exceptions.IncorrectArgument: If the object does not support mutability queries.CTBase.Exceptions.NotImplemented: Ifmutabilityis not implemented for the object type.
See also: CTBase.Traits.AbstractMutabilityTrait, CTBase.Traits.mutability.
is_mixed_constraint [Function]
CTBase.Traits.is_mixed_constraint Function
Return true if x is a mixed state–control path constraint.
Methods are defined on concrete types in Data (e.g. AbstractPathConstraint).
Returns
Bool:trueif the constraint-kind trait isMixedConstraintKind,falseotherwise.
See also: CTBase.Traits.MixedConstraintKind, CTBase.Traits.constraint_kind.
is_nonautonomous [Function]
CTBase.Traits.is_nonautonomous Function
is_nonautonomous(obj) -> BoolReturn true if the object is non-autonomous (time-dependent).
Checks that the object has the time-dependence trait, then returns true if time_dependence(obj) is NonAutonomous.
Arguments
obj::Any: The object to check.
Returns
Bool: true if the object is non-autonomous.
Throws
CTBase.Exceptions.IncorrectArgument: If the object does not support time-dependence queries.CTBase.Exceptions.NotImplemented: Iftime_dependenceis not implemented for the object type.
See also: CTBase.Traits.TimeDependence, CTBase.Traits.time_dependence.
is_nonvariable [Function]
CTBase.Traits.is_nonvariable Function
is_nonvariable(obj) -> BoolReturn true if the object does not depend on variable parameters.
Checks that the object has the variable-dependence trait, then returns true if variable_dependence(obj) is Fixed.
Arguments
obj::Any: The object to check.
Returns
Bool: true if the object does not depend on variable parameters.
Throws
CTBase.Exceptions.IncorrectArgument: If the object does not support variable-dependence queries.CTBase.Exceptions.NotImplemented: Ifvariable_dependenceis not implemented for the object type.
See also: CTBase.Traits.VariableDependence, CTBase.Traits.variable_dependence.
is_open_loop [Function]
CTBase.Traits.is_open_loop Function
Return true if x has open-loop feedback.
Methods are defined on concrete types in Data (e.g. AbstractControlLaw).
Returns
Bool:trueif the feedback trait isOpenLoopFeedback,falseotherwise.
See also: CTBase.Traits.OpenLoopFeedback, CTBase.Traits.feedback.
is_outofplace [Function]
CTBase.Traits.is_outofplace Function
is_outofplace(obj) -> BoolReturn true if the object uses out-of-place function evaluation.
Checks that the object has the mutability trait, then returns true if mutability(obj) is OutOfPlace.
Arguments
obj::Any: The object to check.
Returns
Bool: true if the object uses out-of-place evaluation.
Throws
CTBase.Exceptions.IncorrectArgument: If the object does not support mutability queries.CTBase.Exceptions.NotImplemented: Ifmutabilityis not implemented for the object type.
See also: CTBase.Traits.AbstractMutabilityTrait, CTBase.Traits.mutability.
is_state_constraint [Function]
CTBase.Traits.is_state_constraint Function
Return true if x is a pure state path constraint.
Methods are defined on concrete types in Data (e.g. AbstractPathConstraint).
Returns
Bool:trueif the constraint-kind trait isStateConstraintKind,falseotherwise.
See also: CTBase.Traits.StateConstraintKind, CTBase.Traits.constraint_kind.
is_variable [Function]
CTBase.Traits.is_variable Function
is_variable(obj) -> BoolReturn true if the object depends on variable parameters.
Checks that the object has the variable-dependence trait, then returns true if variable_dependence(obj) is NonFixed.
Arguments
obj::Any: The object to check.
Returns
Bool: true if the object depends on variable parameters.
Throws
CTBase.Exceptions.IncorrectArgument: If the object does not support variable-dependence queries.CTBase.Exceptions.NotImplemented: Ifvariable_dependenceis not implemented for the object type.
See also: CTBase.Traits.VariableDependence, CTBase.Traits.variable_dependence.
mutability [Function]
CTBase.Traits.mutability Function
mutability(
obj
) -> Type{MD} where MD<:CTBase.Traits.AbstractMutabilityTraitReturn the mutability trait value for the object.
This fallback method throws an error indicating the method is not implemented. Concrete types that have the trait should implement mutability(obj::MyType) to return the specific trait value (InPlace or OutOfPlace).
Arguments
obj::Any: The object to query.
Throws
CTBase.Exceptions.NotImplemented: Always, indicating the method must be implemented.
See also: CTBase.Traits.AbstractMutabilityTrait, CTBase.Traits.has_mutability_trait.
mutability(
vf::CTBase.Data.AbstractVectorField{<:CTBase.Traits.TimeDependence, <:CTBase.Traits.VariableDependence, MD<:CTBase.Traits.AbstractMutabilityTrait}
) -> Type{MD} where MD<:CTBase.Traits.AbstractMutabilityTraitExtract the mutability trait from an AbstractVectorField.
Returns
Type{<:AbstractMutabilityTrait}: The mutability trait type (InPlace or OutOfPlace).
Example
using CTBase.Data
using CTBase.Traits
vf = Data.VectorField((dx, x) -> (dx .= -x; nothing))
Traits.mutability(vf) # Returns InPlace
vf2 = Data.VectorField(x -> -x)
Traits.mutability(vf2) # Returns OutOfPlaceSee also: CTBase.Traits.has_mutability_trait, CTBase.Traits.is_inplace.
time_dependence [Function]
CTBase.Traits.time_dependence Function
time_dependence(
obj
) -> Type{TD} where TD<:CTBase.Traits.TimeDependenceReturn the time-dependence trait value for the object.
This fallback method throws an error indicating the method is not implemented. Concrete types that have the trait should implement time_dependence(obj::MyType) to return the specific trait value (Autonomous or NonAutonomous).
Arguments
obj::Any: The object to query.
Throws
CTBase.Exceptions.NotImplemented: Always, indicating the method must be implemented.
See also: CTBase.Traits.TimeDependence, CTBase.Traits.has_time_dependence_trait.
time_dependence(
vf::CTBase.Data.AbstractVectorField{TD<:CTBase.Traits.TimeDependence}
) -> Type{TD} where TD<:CTBase.Traits.TimeDependenceExtract the time dependence trait from an AbstractVectorField.
Returns
Type{<:TimeDependence}: The time dependence trait type (Autonomous or NonAutonomous).
Example
using CTBase.Data
using CTBase.Traits
vf = Data.VectorField(x -> -x; is_autonomous=true)
Traits.time_dependence(vf) # Returns Autonomous
hvf = Data.HamiltonianVectorField((t, x, p) -> (x, -p); is_autonomous=false)
Traits.time_dependence(hvf) # Returns NonAutonomousSee also: CTBase.Traits.has_time_dependence_trait, CTBase.Traits.is_autonomous.
time_dependence(
_::CTBase.Data.AbstractHamiltonian{TD<:CTBase.Traits.TimeDependence}
) -> Type{TD} where TD<:CTBase.Traits.TimeDependenceReturn the time-dependence trait of a Hamiltonian.
Arguments
h::AbstractHamiltonian: The Hamiltonian object.
Returns
TD: The time-dependence type (AutonomousorNonAutonomous).
See also: CTBase.Traits.time_dependence, CTBase.Traits.TimeDependence.
time_dependence(
_::CTBase.Data.AbstractControlLaw{<:Any, TD<:CTBase.Traits.TimeDependence}
) -> Type{TD} where TD<:CTBase.Traits.TimeDependenceReturn the time-dependence trait of a control law.
Arguments
cl::AbstractControlLaw: The control law object.
Returns
TD: The time-dependence type (AutonomousorNonAutonomous).
See also: CTBase.Traits.time_dependence, CTBase.Traits.TimeDependence.
time_dependence(
_::CTBase.Data.AbstractPathConstraint{<:Any, TD<:CTBase.Traits.TimeDependence}
) -> Type{TD} where TD<:CTBase.Traits.TimeDependenceReturn the time-dependence trait of a path constraint.
Arguments
pc::AbstractPathConstraint: The path constraint object.
Returns
TD: The time-dependence type (AutonomousorNonAutonomous).
See also: CTBase.Traits.time_dependence, CTBase.Traits.TimeDependence.
time_dependence(
_::CTBase.Data.AbstractMultiplier{TD<:CTBase.Traits.TimeDependence}
) -> Type{TD} where TD<:CTBase.Traits.TimeDependenceReturn the time-dependence trait of a multiplier.
Arguments
m::AbstractMultiplier: The multiplier object.
Returns
TD: The time-dependence type (AutonomousorNonAutonomous).
See also: CTBase.Traits.time_dependence, CTBase.Traits.TimeDependence.
time_dependence(
_::CTBase.Data.AbstractPseudoHamiltonian{TD<:CTBase.Traits.TimeDependence}
) -> Type{TD} where TD<:CTBase.Traits.TimeDependenceReturn the time-dependence trait of a pseudo-Hamiltonian.
Arguments
h̃::AbstractPseudoHamiltonian: The pseudo-Hamiltonian object.
Returns
TD: The time-dependence type (AutonomousorNonAutonomous).
See also: CTBase.Traits.time_dependence, CTBase.Traits.TimeDependence.
time_dependence(
_::CTBase.Data.AbstractControlledVectorField{TD<:CTBase.Traits.TimeDependence}
) -> Type{TD} where TD<:CTBase.Traits.TimeDependenceReturn the time-dependence trait of a controlled vector field.
See also: CTBase.Traits.time_dependence.
variable_costate_trait [Function]
CTBase.Traits.variable_costate_trait Function
variable_costate_trait(
_
) -> Type{CTBase.Traits.NoVariableCostate}Return the augmented variable integration capability trait of a system or flow.
Arguments
obj: Any object (default implementation returnsNoVariableCostate).
Returns
Type{<:AbstractVariableCostateCapability}: The capability trait, eitherSupportsVariableCostateorNoVariableCostate.
Notes
Default implementation returns
NoVariableCostatefor all objectsSpecialized implementations on system and flow types return the appropriate trait based on the system's capabilities
Used for dispatch to determine if augmented integration operations are possible
The specific operations enabled depend on the system type
See also: CTBase.Traits.SupportsVariableCostate, CTBase.Traits.NoVariableCostate.
variable_dependence [Function]
CTBase.Traits.variable_dependence Function
variable_dependence(
obj
) -> Type{VD} where VD<:CTBase.Traits.VariableDependenceReturn the variable-dependence trait value for the object.
This fallback method throws an error indicating the method is not implemented. Concrete types that have the trait should implement variable_dependence(obj::MyType) to return the specific trait value (Fixed or NonFixed).
Arguments
obj::Any: The object to query.
Throws
CTBase.Exceptions.NotImplemented: Always, indicating the method must be implemented.
See also: CTBase.Traits.VariableDependence, CTBase.Traits.has_variable_dependence_trait.
variable_dependence(
vf::CTBase.Data.AbstractVectorField{<:CTBase.Traits.TimeDependence, VD<:CTBase.Traits.VariableDependence}
) -> Type{VD} where VD<:CTBase.Traits.VariableDependenceExtract the variable dependence trait from an AbstractVectorField.
Returns
Type{<:VariableDependence}: The variable dependence trait type (Fixed or NonFixed).
Example
using CTBase.Data
using CTBase.Traits
vf = Data.VectorField(x -> -x; is_variable=false)
Traits.variable_dependence(vf) # Returns Fixed
hvf = Data.HamiltonianVectorField((x, p, v) -> (x .* v, -p); is_variable=true)
Traits.variable_dependence(hvf) # Returns NonFixedSee also: CTBase.Traits.has_variable_dependence_trait, CTBase.Traits.is_variable.
variable_dependence(
_::CTBase.Data.AbstractHamiltonian{<:CTBase.Traits.TimeDependence, VD<:CTBase.Traits.VariableDependence}
) -> Type{VD} where VD<:CTBase.Traits.VariableDependenceReturn the variable-dependence trait of a Hamiltonian.
Arguments
h::AbstractHamiltonian: The Hamiltonian object.
Returns
VD: The variable-dependence type (FixedorNonFixed).
See also: CTBase.Traits.variable_dependence, CTBase.Traits.VariableDependence.
variable_dependence(
_::CTBase.Data.AbstractControlLaw{<:Any, <:CTBase.Traits.TimeDependence, VD<:CTBase.Traits.VariableDependence}
) -> Type{VD} where VD<:CTBase.Traits.VariableDependenceReturn the variable-dependence trait of a control law.
Arguments
cl::AbstractControlLaw: The control law object.
Returns
VD: The variable-dependence type (FixedorNonFixed).
See also: CTBase.Traits.variable_dependence, CTBase.Traits.VariableDependence.
variable_dependence(
_::CTBase.Data.AbstractPathConstraint{<:Any, <:CTBase.Traits.TimeDependence, VD<:CTBase.Traits.VariableDependence}
) -> Type{VD} where VD<:CTBase.Traits.VariableDependenceReturn the variable-dependence trait of a path constraint.
Arguments
pc::AbstractPathConstraint: The path constraint object.
Returns
VD: The variable-dependence type (FixedorNonFixed).
See also: CTBase.Traits.variable_dependence, CTBase.Traits.VariableDependence.
variable_dependence(
_::CTBase.Data.AbstractMultiplier{<:CTBase.Traits.TimeDependence, VD<:CTBase.Traits.VariableDependence}
) -> Type{VD} where VD<:CTBase.Traits.VariableDependenceReturn the variable-dependence trait of a multiplier.
Arguments
m::AbstractMultiplier: The multiplier object.
Returns
VD: The variable-dependence type (FixedorNonFixed).
See also: CTBase.Traits.variable_dependence, CTBase.Traits.VariableDependence.
variable_dependence(
_::CTBase.Data.AbstractPseudoHamiltonian{<:CTBase.Traits.TimeDependence, VD<:CTBase.Traits.VariableDependence}
) -> Type{VD} where VD<:CTBase.Traits.VariableDependenceReturn the variable-dependence trait of a pseudo-Hamiltonian.
Arguments
h̃::AbstractPseudoHamiltonian: The pseudo-Hamiltonian object.
Returns
VD: The variable-dependence type (FixedorNonFixed).
See also: CTBase.Traits.variable_dependence, CTBase.Traits.VariableDependence.
variable_dependence(
_::CTBase.Data.AbstractControlledVectorField{<:CTBase.Traits.TimeDependence, VD<:CTBase.Traits.VariableDependence}
) -> Type{VD} where VD<:CTBase.Traits.VariableDependenceReturn the variable-dependence trait of a controlled vector field.
See also: CTBase.Traits.variable_dependence.