Private API

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


From CTModels

boundary_constraints_dual

CTModels.boundary_constraints_dualFunction
boundary_constraints_dual(
    model::CTModels.DualModel{<:Union{Nothing, Function}, BC_Dual<:Union{Nothing, AbstractVector{<:Real}}}
) -> Union{Nothing, AbstractVector{<:Real}}

Return the dual vector associated with the boundary constraints.

Arguments

  • model::DualModel: A model including dual variables for boundary constraints.

Returns

A vector of dual values, or nothing if not set.

boundary_constraints_dual(
    sol::CTModels.Solution
) -> Union{Nothing, AbstractVector{<:Real}}

Return the dual of the boundary constraints.

constraints_violation

control_components

CTModels.control_componentsFunction
control_components(ocp::CTModels.Model) -> Vector{String}

Return the names of the components of the control.

control_components(sol::CTModels.Solution) -> Vector{String}

Return the names of the components of the control.

control_constraints_lb_dual

CTModels.control_constraints_lb_dualFunction
control_constraints_lb_dual(
    model::CTModels.DualModel{<:Union{Nothing, Function}, <:Union{Nothing, AbstractVector{<:Real}}, <:Union{Nothing, Function}, <:Union{Nothing, Function}, CC_LB_Dual<:Union{Nothing, Function}}
) -> Union{Nothing, Function}

Return the dual function associated with the lower bounds of control constraints.

Arguments

  • model::DualModel: A model including dual variables for control lower bounds.

Returns

A function mapping time t to a vector of dual values, or nothing if not set.

control_constraints_lb_dual(
    sol::CTModels.Solution
) -> Union{Nothing, Function}

Return the lower bound dual of the control constraints.

control_constraints_ub_dual

CTModels.control_constraints_ub_dualFunction
control_constraints_ub_dual(
    model::CTModels.DualModel{<:Union{Nothing, Function}, <:Union{Nothing, AbstractVector{<:Real}}, <:Union{Nothing, Function}, <:Union{Nothing, Function}, <:Union{Nothing, Function}, CC_UB_Dual<:Union{Nothing, Function}}
) -> Union{Nothing, Function}

Return the dual function associated with the upper bounds of control constraints.

Arguments

  • model::DualModel: A model including dual variables for control upper bounds.

Returns

A function mapping time t to a vector of dual values, or nothing if not set.

control_constraints_ub_dual(
    sol::CTModels.Solution
) -> Union{Nothing, Function}

Return the upper bound dual of the control constraints.

control_dimension

CTModels.control_dimensionFunction
control_dimension(ocp::CTModels.Model) -> Int64

Return the control dimension.

control_dimension(sol::CTModels.Solution) -> Int64

Return the dimension of the control.

control_name

CTModels.control_nameFunction
control_name(ocp::CTModels.Model) -> String

Return the name of the control.

control_name(sol::CTModels.Solution) -> String

Return the name of the control.

costate

CTModels.costateFunction
costate(
    sol::CTModels.Solution{<:CTModels.AbstractTimeGridModel, <:CTModels.AbstractTimesModel, <:CTModels.AbstractStateModel, <:CTModels.AbstractControlModel, <:CTModels.AbstractVariableModel, Co<:Function}
) -> Function

Return the costate as a function of time.

julia> p  = costate(sol)
julia> t0 = time_grid(sol)[1]
julia> p0 = p(t0) # costate at the initial time

dual

CTModels.dualFunction
dual(
    sol::CTModels.Solution,
    model::CTModels.Model,
    label::Symbol
) -> Any

Return the dual variable associated with a constraint identified by its label.

Searches through all constraint types (path, boundary, state, control, and variable constraints) defined in the model and returns the corresponding dual value from the solution.

Arguments

  • sol::Solution: Solution object containing dual variables.
  • model::Model: Model containing constraint definitions.
  • label::Symbol: Symbol corresponding to a constraint label.

Returns

A function of time t for time-dependent constraints, or a scalar/vector for time-invariant duals. If the label is not found, throws an IncorrectArgument exception.

dual_model

CTModels.dual_modelFunction
dual_model(
    sol::CTModels.Solution{<:CTModels.AbstractTimeGridModel, <:CTModels.AbstractTimesModel, <:CTModels.AbstractStateModel, <:CTModels.AbstractControlModel, <:CTModels.AbstractVariableModel, <:Function, <:Real, DM<:CTModels.AbstractDualModel}
) -> CTModels.AbstractDualModel

Return the dual model containing all constraint multipliers.

final_time_name

CTModels.final_time_nameFunction
final_time_name(model::CTModels.TimesModel) -> String

Get the name of the final time from the times model.

final_time_name(ocp::CTModels.Model) -> String

Return the name of the final time.

final_time_name(sol::CTModels.Solution) -> String

Return the name of the final time.

infos

CTModels.infosFunction
infos(sol::CTModels.Solution) -> Dict{Symbol, Any}

Return a dictionary of additional infos depending on the solver or nothing.

initial_time_name

CTModels.initial_time_nameFunction
initial_time_name(model::CTModels.TimesModel) -> String

Get the name of the initial time from the times model.

initial_time_name(ocp::CTModels.Model) -> String

Return the name of the initial time.

initial_time_name(sol::CTModels.Solution) -> String

Return the name of the initial time.

iterations

CTModels.iterationsFunction
iterations(sol::CTModels.Solution) -> Int64

Return the number of iterations (if solved by an iterative method).

message

CTModels.messageFunction
message(sol::CTModels.Solution) -> String

Return the message associated to the status criterion.

model

CTModels.modelFunction
model(
    sol::CTModels.Solution{<:CTModels.AbstractTimeGridModel, <:CTModels.AbstractTimesModel, <:CTModels.AbstractStateModel, <:CTModels.AbstractControlModel, <:CTModels.AbstractVariableModel, <:Function, <:Real, <:CTModels.AbstractDualModel, <:CTModels.AbstractSolverInfos, TM<:CTModels.AbstractModel}
) -> CTModels.AbstractModel

Return the optimal control problem model associated with the solution.

objective

CTModels.objectiveFunction
objective(
    ocp::CTModels.Model{<:CTModels.TimeDependence, <:CTModels.AbstractTimesModel, <:CTModels.AbstractStateModel, <:CTModels.AbstractControlModel, <:CTModels.AbstractVariableModel, <:Function, O<:CTModels.AbstractObjectiveModel}
) -> CTModels.AbstractObjectiveModel

Return the objective struct.

objective(
    sol::CTModels.Solution{<:CTModels.AbstractTimeGridModel, <:CTModels.AbstractTimesModel, <:CTModels.AbstractStateModel, <:CTModels.AbstractControlModel, <:CTModels.AbstractVariableModel, <:Function, O<:Real}
) -> Real

Return the objective value.

path_constraints_dual

CTModels.path_constraints_dualFunction
path_constraints_dual(
    model::CTModels.DualModel{PC_Dual<:Union{Nothing, Function}}
) -> Union{Nothing, Function}

Return the dual function associated with the nonlinear path constraints.

Arguments

  • model::DualModel: A model including dual variables for path constraints.

Returns

A function mapping time t to the vector of dual values, or nothing if not set.

path_constraints_dual(
    sol::CTModels.Solution
) -> Union{Nothing, Function}

Return the dual of the path constraints.

state_components

CTModels.state_componentsFunction
state_components(ocp::CTModels.Model) -> Vector{String}

Return the names of the components of the state.

state_components(sol::CTModels.Solution) -> Vector{String}

Return the names of the components of the state.

state_constraints_lb_dual

CTModels.state_constraints_lb_dualFunction
state_constraints_lb_dual(
    model::CTModels.DualModel{<:Union{Nothing, Function}, <:Union{Nothing, AbstractVector{<:Real}}, SC_LB_Dual<:Union{Nothing, Function}}
) -> Union{Nothing, Function}

Return the dual function associated with the lower bounds of state constraints.

Arguments

  • model::DualModel: A model including dual variables for state lower bounds.

Returns

A function mapping time t to a vector of dual values, or nothing if not set.

state_constraints_lb_dual(
    sol::CTModels.Solution
) -> Union{Nothing, Function}

Return the lower bound dual of the state constraints.

state_constraints_ub_dual

CTModels.state_constraints_ub_dualFunction
state_constraints_ub_dual(
    model::CTModels.DualModel{<:Union{Nothing, Function}, <:Union{Nothing, AbstractVector{<:Real}}, <:Union{Nothing, Function}, SC_UB_Dual<:Union{Nothing, Function}}
) -> Union{Nothing, Function}

Return the dual function associated with the upper bounds of state constraints.

Arguments

  • model::DualModel: A model including dual variables for state upper bounds.

Returns

A function mapping time t to a vector of dual values, or nothing if not set.

state_constraints_ub_dual(
    sol::CTModels.Solution
) -> Union{Nothing, Function}

Return the upper bound dual of the state constraints.

state_dimension

CTModels.state_dimensionFunction
state_dimension(ocp::CTModels.PreModel) -> Int64

Return the state dimension of the PreModel.

Throws CTBase.UnauthorizedCall if state has not been set.

state_dimension(ocp::CTModels.Model) -> Int64

Return the state dimension.

state_dimension(sol::CTModels.Solution) -> Int64

Return the dimension of the state.

state_name

CTModels.state_nameFunction
state_name(ocp::CTModels.Model) -> String

Return the name of the state.

state_name(sol::CTModels.Solution) -> String

Return the name of the state.

status

CTModels.statusFunction
status(sol::CTModels.Solution) -> Symbol

Return the status criterion (a Symbol).

successful

CTModels.successfulFunction
successful(sol::CTModels.Solution) -> Bool

Return the successful status.

time_grid

CTModels.time_gridFunction
time_grid(
    sol::CTModels.Solution{<:CTModels.TimeGridModel{T<:Union{StepRangeLen, AbstractVector{<:Real}}}}
) -> Union{StepRangeLen, AbstractVector{<:Real}}

Return the time grid.

time_name

CTModels.time_nameFunction
time_name(model::CTModels.TimesModel) -> String

Get the name of the time variable from the times model.

time_name(ocp::CTModels.Model) -> String

Return the name of the time.

time_name(sol::CTModels.Solution) -> String

Return the name of the time component.

variable_components

CTModels.variable_componentsFunction
variable_components(ocp::CTModels.Model) -> Vector{String}

Return the names of the components of the variable.

variable_components(
    sol::CTModels.Solution
) -> Vector{String}

Return the names of the components of the variable.

variable_constraints_lb_dual

CTModels.variable_constraints_lb_dualFunction
variable_constraints_lb_dual(
    model::CTModels.DualModel{<:Union{Nothing, Function}, <:Union{Nothing, AbstractVector{<:Real}}, <:Union{Nothing, Function}, <:Union{Nothing, Function}, <:Union{Nothing, Function}, <:Union{Nothing, Function}, VC_LB_Dual<:Union{Nothing, AbstractVector{<:Real}}}
) -> Union{Nothing, AbstractVector{<:Real}}

Return the dual vector associated with the lower bounds of variable constraints.

Arguments

  • model::DualModel: A model including dual variables for variable lower bounds.

Returns

A vector of dual values, or nothing if not set.

variable_constraints_lb_dual(
    sol::CTModels.Solution
) -> Union{Nothing, AbstractVector{<:Real}}

Return the lower bound dual of the variable constraints.

variable_constraints_ub_dual

CTModels.variable_constraints_ub_dualFunction
variable_constraints_ub_dual(
    model::CTModels.DualModel{<:Union{Nothing, Function}, <:Union{Nothing, AbstractVector{<:Real}}, <:Union{Nothing, Function}, <:Union{Nothing, Function}, <:Union{Nothing, Function}, <:Union{Nothing, Function}, <:Union{Nothing, AbstractVector{<:Real}}, VC_UB_Dual<:Union{Nothing, AbstractVector{<:Real}}}
) -> Union{Nothing, AbstractVector{<:Real}}

Return the dual vector associated with the upper bounds of variable constraints.

Arguments

  • model::DualModel: A model including dual variables for variable upper bounds.

Returns

A vector of dual values, or nothing if not set.

variable_constraints_ub_dual(
    sol::CTModels.Solution
) -> Union{Nothing, AbstractVector{<:Real}}

Return the upper bound dual of the variable constraints.

variable_dimension

CTModels.variable_dimensionFunction
variable_dimension(ocp::CTModels.Model) -> Int64

Return the variable dimension.

variable_dimension(sol::CTModels.Solution) -> Int64

Return the dimension of the variable.

variable_name

CTModels.variable_nameFunction
variable_name(ocp::CTModels.Model) -> String

Return the name of the variable.

variable_name(sol::CTModels.Solution) -> String

Return the name of the variable.