Private API
This page lists non-exported (internal) symbols of CTModels.OCP.
From CTModels.OCP
AbstractConstraintsModel
CTModels.OCP.AbstractConstraintsModel — Type
abstract type AbstractConstraintsModelAbstract 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.AbstractControlModel — Type
abstract type AbstractControlModelAbstract 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.AbstractObjectiveModel — Type
abstract type AbstractObjectiveModelAbstract 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.AbstractStateModel — Type
abstract type AbstractStateModelAbstract 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.AbstractTimesModel — Type
abstract type AbstractTimesModelAbstract base type for combined initial and final time models.
See also: TimesModel.
AbstractVariableModel
CTModels.OCP.AbstractVariableModel — Type
abstract type AbstractVariableModelAbstract 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.ControlModelSolution — Type
struct ControlModelSolution{TS<:Function} <: CTModels.OCP.AbstractControlModelControl 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 functiont -> u(t)returning the control vector at timet.
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.0StateModelSolution
CTModels.OCP.StateModelSolution — Type
struct StateModelSolution{TS<:Function} <: CTModels.OCP.AbstractStateModelState 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 functiont -> x(t)returning the state vector at timet.
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.0TimeDependence
CTModels.OCP.TimeDependence — Type
abstract type TimeDependenceAbstract 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.VariableModelSolution — Type
struct VariableModelSolution{TS<:Union{Real, AbstractVector{<:Real}}} <: CTModels.OCP.AbstractVariableModelVariable 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_set — Function
__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_complete — Function
__is_complete(ocp::CTModels.OCP.PreModel) -> Bool
Return true if the PreModel can be built into a Model.
__is_consistent
CTModels.OCP.__is_consistent — Function
__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_empty — Function
__is_control_empty(c) -> Bool
Return true if c is an EmptyControlModel.
__is_control_set
CTModels.OCP.__is_control_set — Function
__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_set — Function
__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_complete — Function
__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_set — Function
__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_empty — Function
__is_empty(ocp::CTModels.OCP.PreModel) -> Bool
Return true if nothing has been set.
__is_objective_set
CTModels.OCP.__is_objective_set — Function
__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
CTModels.OCP.__is_set — Function
__is_set(x) -> Bool
Return true if x is not nothing.
__is_state_set
CTModels.OCP.__is_state_set — Function
__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_set — Function
__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
CTModels.OCP.__is_variable_empty — Function
__is_variable_empty(v) -> Bool
Return true if v is an EmptyVariableModel.
__is_variable_set
CTModels.OCP.__is_variable_set — Function
__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.