Private API

This page lists non-exported (internal) symbols of CTModels.OCP.


From CTModels.OCP

AbstractConstraintsModel

CTModels.OCP.AbstractConstraintsModelType
abstract type AbstractConstraintsModel

Abstract base type for constraint models in optimal control problems.

Subtypes store all constraint information including path constraints, boundary constraints, and box constraints on state, control, and variables.

See also: ConstraintsModel.

AbstractControlModel

CTModels.OCP.AbstractControlModelType
abstract type AbstractControlModel

Abstract base type for control variable models in optimal control problems.

Subtypes describe the control space structure including dimension, naming, and optionally the control trajectory itself.

See also: ControlModel, ControlModelSolution.

AbstractObjectiveModel

CTModels.OCP.AbstractObjectiveModelType
abstract type AbstractObjectiveModel

Abstract base type for objective function models in optimal control problems.

Subtypes represent different forms of the cost functional: Mayer (terminal cost), Lagrange (integral cost), or Bolza (both).

See also: MayerObjectiveModel, LagrangeObjectiveModel, BolzaObjectiveModel.

AbstractStateModel

CTModels.OCP.AbstractStateModelType
abstract type AbstractStateModel

Abstract base type for state variable models in optimal control problems.

Subtypes describe the state space structure including dimension, naming, and optionally the state trajectory itself.

See also: StateModel, StateModelSolution.

AbstractTimesModel

CTModels.OCP.AbstractTimesModelType
abstract type AbstractTimesModel

Abstract base type for combined initial and final time models.

See also: TimesModel.

AbstractVariableModel

CTModels.OCP.AbstractVariableModelType
abstract type AbstractVariableModel

Abstract base type for optimisation variable models in optimal control problems.

Optimisation variables are decision variables that do not depend on time, such as free final time or unknown parameters.

See also: VariableModel, EmptyVariableModel, VariableModelSolution.

ControlModelSolution

CTModels.OCP.ControlModelSolutionType
struct ControlModelSolution{TS<:Function} <: CTModels.OCP.AbstractControlModel

Represents the control trajectory in a solution.

Fields

  • name::String: Name of the control variable (e.g., "u").
  • components::Vector{String}: Names of individual control components (e.g., ["u₁", "u₂"]).
  • value::TS: A function t -> u(t) returning the control vector at time t.
  • interpolation::Symbol: Interpolation type (:constant for piecewise constant, :linear for piecewise linear).

Example

julia> using CTModels

julia> u_traj = t -> [sin(t)]
julia> cms = CTModels.ControlModelSolution("u", ["u₁"], u_traj, :constant)
julia> cms.value(π/2)
1-element Vector{Float64}:
 1.0

StateModelSolution

CTModels.OCP.StateModelSolutionType
struct StateModelSolution{TS<:Function} <: CTModels.OCP.AbstractStateModel

State model for a solved optimal control problem, including the state trajectory.

Fields

  • name::String: Display name for the state variable.
  • components::Vector{String}: Names of individual state components.
  • value::TS: A function t -> x(t) returning the state vector at time t.

Example

julia> using CTModels

julia> x_traj = t -> [cos(t), sin(t)]
julia> sms = CTModels.StateModelSolution("x", ["x₁", "x₂"], x_traj)
julia> sms.value(0.0)
2-element Vector{Float64}:
 1.0
 0.0

TimeDependence

CTModels.OCP.TimeDependenceType
abstract type TimeDependence

Abstract base type representing time dependence of an optimal control problem.

Used as a type parameter to distinguish between autonomous and non-autonomous systems at the type level, enabling dispatch and compile-time optimisations.

See also: Autonomous, NonAutonomous.

VariableModelSolution

CTModels.OCP.VariableModelSolutionType
struct VariableModelSolution{TS<:Union{Real, AbstractVector{<:Real}}} <: CTModels.OCP.AbstractVariableModel

Variable model for a solved optimal control problem, including the variable value.

Fields

  • name::String: Display name for the variable.
  • components::Vector{String}: Names of individual variable components.
  • value::TS: The optimisation variable value (scalar or vector).

Example

julia> using CTModels

julia> vms = CTModels.VariableModelSolution("v", ["tf"], 2.5)
julia> vms.value
2.5

__is_autonomous_set

CTModels.OCP.__is_autonomous_setFunction
__is_autonomous_set(ocp::CTModels.OCP.PreModel) -> Bool

Return true if the autonomous flag has been set in the PreModel.

__is_consistent

CTModels.OCP.__is_consistentFunction
__is_consistent(ocp::CTModels.OCP.PreModel) -> Bool

Return true if all the required fields are set in the PreModel.

__is_control_empty

CTModels.OCP.__is_control_emptyFunction
__is_control_empty(c) -> Bool

Return true if c is an EmptyControlModel.

__is_control_empty(ocp::CTModels.OCP.PreModel) -> Bool

Return true if the control field of the PreModel is an EmptyControlModel.

__is_definition_empty

__is_dynamics_complete

CTModels.OCP.__is_dynamics_completeFunction
__is_dynamics_complete(ocp::CTModels.OCP.PreModel) -> Bool

Return true if dynamics cover all state components in the PreModel.

For component-wise dynamics, checks that all state indices are covered.

__is_dynamics_set

CTModels.OCP.__is_dynamics_setFunction
__is_dynamics_set(ocp::CTModels.OCP.PreModel) -> Bool

Return true if dynamics have been set in the PreModel.

__is_empty

CTModels.OCP.__is_emptyFunction
__is_empty(ocp::CTModels.OCP.PreModel) -> Bool

Return true if nothing has been set.

__is_objective_set

__is_set

__is_state_set

CTModels.OCP.__is_state_setFunction
__is_state_set(ocp::CTModels.OCP.PreModel) -> Bool

Return true if state has been set in the PreModel.

__is_times_set

CTModels.OCP.__is_times_setFunction
__is_times_set(ocp::CTModels.OCP.PreModel) -> Bool

Return true if times have been set in the PreModel.

__is_variable_empty

CTModels.OCP.__is_variable_emptyFunction
__is_variable_empty(v) -> Bool

Return true if v is an EmptyVariableModel.

__is_variable_empty(ocp::CTModels.OCP.PreModel) -> Bool

Return true if the variable field of the PreModel is an EmptyVariableModel.