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

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

Fields

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

Example

julia> using CTModels

julia> u_traj = t -> [sin(t)]
julia> cms = CTModels.ControlModelSolution("u", ["u₁"], u_traj)
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_complete

CTModels.OCP.__is_completeFunction
__is_complete(ocp::CTModels.OCP.PreModel) -> Bool

Return true if the PreModel can be built into a Model.

__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

__is_control_set

CTModels.OCP.__is_control_setFunction
__is_control_set(ocp::CTModels.OCP.Model) -> Bool

Return true since the control field is always structurally set in a built Model (i.e. it is never nothing).

Note: this does not imply a positive control dimension. The model may hold an EmptyControlModel when the user did not call control!, in which case control_dimension(ocp) == 0.

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

Return true if a non-empty control has been set in the PreModel.

__is_definition_set

CTModels.OCP.__is_definition_setFunction
__is_definition_set(ocp::CTModels.OCP.Model) -> Bool

Return true since definition is always set in a built Model.

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

Return true if definition has been set in the PreModel.

__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.Model) -> Bool

Return true since dynamics is always set in a built Model.

__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

CTModels.OCP.__is_objective_setFunction
__is_objective_set(ocp::CTModels.OCP.Model) -> Bool

Return true since objective is always set in a built Model.

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

Return true if objective has been set in the PreModel.

__is_set

__is_state_set

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

Return true since state is always set in a built Model.

__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.Model) -> Bool

Return true since times are always set in a built Model.

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

Return true if times have been set in the PreModel.

__is_variable_empty

__is_variable_set

CTModels.OCP.__is_variable_setFunction
__is_variable_set(ocp::CTModels.OCP.Model) -> Bool

Return true since variable is always set in a built Model.

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

Return true if a non-empty variable has been set in the PreModel.