Solution

Optimal control solution type

CTBase.OptimalControlSolutionType
mutable struct OptimalControlSolution <: CTBase.AbstractOptimalControlSolution

Type of an optimal control solution.

Fields

  • time_grid::Union{Nothing, StepRangeLen, AbstractVector{<:Real}}: Default: nothing

  • time_name::Union{Nothing, String}: Default: nothing

  • initial_time_name::Union{Nothing, String}: Default: nothing

  • final_time_name::Union{Nothing, String}: Default: nothing

  • control_dimension::Union{Nothing, Integer}: Default: nothing

  • control_components_names::Union{Nothing, Vector{String}}: Default: nothing

  • control_name::Union{Nothing, String}: Default: nothing

  • control::Union{Nothing, Function}: Default: nothing

  • state_dimension::Union{Nothing, Integer}: Default: nothing

  • state_components_names::Union{Nothing, Vector{String}}: Default: nothing

  • state_name::Union{Nothing, String}: Default: nothing

  • state::Union{Nothing, Function}: Default: nothing

  • variable_dimension::Union{Nothing, Integer}: Default: nothing

  • variable_components_names::Union{Nothing, Vector{String}}: Default: nothing

  • variable_name::Union{Nothing, String}: Default: nothing

  • variable::Union{Nothing, Real, AbstractVector{<:Real}}: Default: nothing

  • costate::Union{Nothing, Function}: Default: nothing

  • objective::Union{Nothing, Real}: Default: nothing

  • iterations::Union{Nothing, Int64}: Default: nothing

  • stopping::Union{Nothing, Symbol}: Default: nothing

  • message::Union{Nothing, String}: Default: nothing

  • success::Union{Nothing, Bool}: Default: nothing

  • infos::Dict{Symbol, Any}: Default: Dict{Symbol, Any}()

  • boundary_constraints::Union{Nothing, Real, AbstractVector{<:Real}}: Default: nothing

  • mult_boundary_constraints::Union{Nothing, Real, AbstractVector{<:Real}}: Default: nothing

  • variable_constraints::Union{Nothing, Real, AbstractVector{<:Real}}: Default: nothing

  • mult_variable_constraints::Union{Nothing, Real, AbstractVector{<:Real}}: Default: nothing

  • mult_variable_box_lower::Union{Nothing, Real, AbstractVector{<:Real}}: Default: nothing

  • mult_variable_box_upper::Union{Nothing, Real, AbstractVector{<:Real}}: Default: nothing

  • control_constraints::Union{Nothing, Function}: Default: nothing

  • mult_control_constraints::Union{Nothing, Function}: Default: nothing

  • state_constraints::Union{Nothing, Function}: Default: nothing

  • mult_state_constraints::Union{Nothing, Function}: Default: nothing

  • mixed_constraints::Union{Nothing, Function}: Default: nothing

  • mult_mixed_constraints::Union{Nothing, Function}: Default: nothing

  • mult_state_box_lower::Union{Nothing, Function}: Default: nothing

  • mult_state_box_upper::Union{Nothing, Function}: Default: nothing

  • mult_control_box_lower::Union{Nothing, Function}: Default: nothing

  • mult_control_box_upper::Union{Nothing, Function}: Default: nothing

source

Getters

CTBase.boundary_constraintsMethod
boundary_constraints(
    sol::OptimalControlSolution
) -> Union{Real, AbstractVector{<:Real}}

Return the boundary constraints of the optimal control solution or nothing.

source
CTBase.controlMethod
control(sol::OptimalControlSolution) -> Function

Return the control (function of time) of the optimal control solution or nothing.

julia> t0 = time_grid(sol)[1]
julia> u  = control(sol)
julia> u0 = u(t0) # control at initial time
source
CTBase.control_components_namesMethod
control_components_names(sol::OptimalControlSolution)

Return the names of the components of the control of the optimal control solution or nothing.

source
CTBase.control_constraintsMethod
control_constraints(sol::OptimalControlSolution) -> Function

Return the control constraints of the optimal control solution or nothing.

source
CTBase.control_dimensionMethod
control_dimension(sol::OptimalControlSolution) -> Integer

Return the dimension of the control of the optimal control solution or nothing.

source
CTBase.control_discretizedMethod
control_discretized(sol::OptimalControlSolution) -> Any

Return the control values at times time_grid(sol) of the optimal control solution or nothing.

julia> u  = control_discretized(sol)
julia> u0 = u[1] # control at initial time
source
CTBase.control_nameMethod
control_name(sol::OptimalControlSolution) -> String

Return the name of the control of the optimal control solution or nothing.

source
CTBase.costateMethod
costate(sol::OptimalControlSolution) -> Function

Return the costate of the optimal control solution or nothing.

julia> t0 = time_grid(sol)[1]
julia> p  = costate(sol)
julia> p0 = p(t0)
source
CTBase.costate_discretizedMethod
costate_discretized(sol::OptimalControlSolution) -> Any

Return the costate values at times time_grid(sol) of the optimal control solution or nothing.

julia> p  = costate_discretized(sol)
julia> p0 = p[1] # costate at initial time
source
CTBase.final_time_nameMethod
final_time_name(sol::OptimalControlSolution) -> String

Return the name of final time of the optimal control solution or nothing.

source
CTBase.infosMethod
infos(sol::OptimalControlSolution) -> Dict{Symbol, Any}

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

source
CTBase.initial_time_nameMethod
initial_time_name(sol::OptimalControlSolution) -> String

Return the name of the initial time of the optimal control solution or nothing.

source
CTBase.iterationsMethod
iterations(sol::OptimalControlSolution) -> Int64

Return the number of iterations (if solved by an iterative method) of the optimal control solution or nothing.

source
CTBase.messageMethod
message(sol::OptimalControlSolution) -> String

Return the message associated to the stopping criterion of the optimal control solution or nothing.

source
CTBase.mixed_constraintsMethod
mixed_constraints(sol::OptimalControlSolution) -> Function

Return the mixed state-control constraints of the optimal control solution or nothing.

source
CTBase.mult_boundary_constraintsMethod
mult_boundary_constraints(
    sol::OptimalControlSolution
) -> Union{Real, AbstractVector{<:Real}}

Return the multipliers to the boundary constraints of the optimal control solution or nothing.

source
CTBase.mult_control_box_lowerMethod
mult_control_box_lower(
    sol::OptimalControlSolution
) -> Function

Return the multipliers to the control lower bounds of the optimal control solution or nothing.

source
CTBase.mult_control_box_upperMethod
mult_control_box_upper(
    sol::OptimalControlSolution
) -> Function

Return the multipliers to the control upper bounds of the optimal control solution or nothing.

source
CTBase.mult_control_constraintsMethod
mult_control_constraints(
    sol::OptimalControlSolution
) -> Function

Return the multipliers to the control constraints of the optimal control solution or nothing.

source
CTBase.mult_mixed_constraintsMethod
mult_mixed_constraints(
    sol::OptimalControlSolution
) -> Function

Return the multipliers to the mixed state-control constraints of the optimal control solution or nothing.

source
CTBase.mult_state_box_lowerMethod
mult_state_box_lower(
    sol::OptimalControlSolution
) -> Function

Return the multipliers to the state lower bounds of the optimal control solution or nothing.

source
CTBase.mult_state_box_upperMethod
mult_state_box_upper(
    sol::OptimalControlSolution
) -> Function

Return the multipliers to the state upper bounds of the optimal control solution or nothing.

source
CTBase.mult_state_constraintsMethod
mult_state_constraints(
    sol::OptimalControlSolution
) -> Function

Return the multipliers to the state constraints of the optimal control solution or nothing.

source
CTBase.mult_variable_box_lowerMethod
mult_variable_box_lower(
    sol::OptimalControlSolution
) -> Union{Real, AbstractVector{<:Real}}

Return the multipliers to the variable lower bounds of the optimal control solution or nothing.

source
CTBase.mult_variable_box_upperMethod
mult_variable_box_upper(
    sol::OptimalControlSolution
) -> Union{Real, AbstractVector{<:Real}}

Return the multipliers to the variable upper bounds of the optimal control solution or nothing.

source
CTBase.mult_variable_constraintsMethod
mult_variable_constraints(
    sol::OptimalControlSolution
) -> Union{Real, AbstractVector{<:Real}}

Return the multipliers to the variable constraints of the optimal control solution or nothing.

source
CTBase.objectiveMethod
objective(sol::OptimalControlSolution) -> Real

Return the objective value of the optimal control solution or nothing.

source
CTBase.stateMethod
state(sol::OptimalControlSolution) -> Function

Return the state (function of time) of the optimal control solution or nothing.

julia> t0 = time_grid(sol)[1]
julia> x  = state(sol)
julia> x0 = x(t0)
source
CTBase.state_components_namesMethod
state_components_names(sol::OptimalControlSolution)

Return the names of the components of the state of the optimal control solution or nothing.

source
CTBase.state_constraintsMethod
state_constraints(sol::OptimalControlSolution) -> Function

Return the state constraints of the optimal control solution or nothing.

source
CTBase.state_dimensionMethod
state_dimension(sol::OptimalControlSolution) -> Integer

Return the dimension of the state of the optimal control solution or nothing.

source
CTBase.state_discretizedMethod
state_discretized(sol::OptimalControlSolution) -> Any

Return the state values at times time_grid(sol) of the optimal control solution or nothing.

julia> x  = state_discretized(sol)
julia> x0 = x[1] # state at initial time
source
CTBase.state_nameMethod
state_name(sol::OptimalControlSolution) -> String

Return the name of the state of the optimal control solution or nothing.

source
CTBase.stoppingMethod
stopping(sol::OptimalControlSolution) -> Symbol

Return the stopping criterion (a Symbol) of the optimal control solution or nothing.

source
CTBase.successMethod
success(sol::OptimalControlSolution) -> Bool

Return the true if the solver has finished successfully of false if not, or nothing.

source
CTBase.time_gridMethod
time_grid(
    sol::OptimalControlSolution
) -> Union{StepRangeLen, AbstractVector{<:Real}}

Return the time grid of the optimal control solution or nothing.

source
CTBase.time_nameMethod
time_name(sol::OptimalControlSolution) -> String

Return the name of the time component of the optimal control solution or nothing.

source
CTBase.variableMethod
variable(
    sol::OptimalControlSolution
) -> Union{Real, AbstractVector{<:Real}}

Return the variable of the optimal control solution or nothing.

julia> v  = variable(sol)
source
CTBase.variable_components_namesMethod
variable_components_names(sol::OptimalControlSolution)

Return the names of the components of the variable of the optimal control solution or nothing.

source
CTBase.variable_constraintsMethod
variable_constraints(
    sol::OptimalControlSolution
) -> Union{Real, AbstractVector{<:Real}}

Return the variable constraints of the optimal control solution or nothing.

source
CTBase.variable_dimensionMethod
variable_dimension(sol::OptimalControlSolution) -> Integer

Return the dimension of the variable of the optimal control solution or nothing.

source
CTBase.variable_nameMethod
variable_name(sol::OptimalControlSolution) -> String

Return the name of the variable of the optimal control solution or nothing.

source

Constructors and setters

CTBase.OptimalControlSolutionMethod
OptimalControlSolution(
    ocp::OptimalControlModel{<:TimeDependence, Fixed};
    state,
    control,
    objective,
    costate,
    time_grid,
    iterations,
    stopping,
    message,
    success,
    infos,
    boundary_constraints,
    mult_boundary_constraints,
    control_constraints,
    mult_control_constraints,
    state_constraints,
    mult_state_constraints,
    mixed_constraints,
    mult_mixed_constraints,
    mult_state_box_lower,
    mult_state_box_upper,
    mult_control_box_lower,
    mult_control_box_upper
)

Constructor from an optimal control problem for a Fixed ocp.

source
CTBase.OptimalControlSolutionMethod
OptimalControlSolution(
    ocp::OptimalControlModel{<:TimeDependence, NonFixed};
    state,
    control,
    objective,
    variable,
    costate,
    time_grid,
    iterations,
    stopping,
    message,
    success,
    infos,
    boundary_constraints,
    mult_boundary_constraints,
    variable_constraints,
    mult_variable_constraints,
    mult_variable_box_lower,
    mult_variable_box_upper,
    control_constraints,
    mult_control_constraints,
    state_constraints,
    mult_state_constraints,
    mixed_constraints,
    mult_mixed_constraints,
    mult_state_box_lower,
    mult_state_box_upper,
    mult_control_box_lower,
    mult_control_box_upper
)

Constructor from an optimal control problem for a NonFixed ocp.

source
CTBase.boundary_constraints!Method
boundary_constraints!(
    sol::OptimalControlSolution,
    boundary_constraints::Union{Real, AbstractVector{<:Real}}
)

Set the boundary constraints.

source
CTBase.costate!Method
costate!(sol::OptimalControlSolution, costate::Function)

Set the costate.

source
CTBase.infos!Method
infos!(
    sol::OptimalControlSolution,
    infos::Dict{Symbol, Any}
)

Set the additional infos.

source
CTBase.iterations!Method
iterations!(sol::OptimalControlSolution, iterations::Int64)

Set the number of iterations.

source
CTBase.message!Method
message!(sol::OptimalControlSolution, message::String)

Set the message of stopping.

source
CTBase.mixed_constraints!Method
mixed_constraints!(
    sol::OptimalControlSolution,
    mixed_constraints::Function
)

Set the mixed state/control constraints.

source
CTBase.mult_boundary_constraints!Method
mult_boundary_constraints!(
    sol::OptimalControlSolution,
    mult_boundary_constraints::Union{Real, AbstractVector{<:Real}}
)

Set the multipliers to the boundary constraints.

source
CTBase.mult_control_box_lower!Method
mult_control_box_lower!(
    sol::OptimalControlSolution,
    mult_control_box_lower::Function
)

Set the multipliers to the control lower bounds.

source
CTBase.mult_control_box_upper!Method
mult_control_box_upper!(
    sol::OptimalControlSolution,
    mult_control_box_upper::Function
)

Set the multipliers to the control upper bounds.

source
CTBase.mult_mixed_constraints!Method
mult_mixed_constraints!(
    sol::OptimalControlSolution,
    mult_mixed_constraints::Function
)

Set the multipliers to the mixed state/control constraints.

source
CTBase.mult_state_box_lower!Method
mult_state_box_lower!(
    sol::OptimalControlSolution,
    mult_state_box_lower::Function
)

Set the multipliers to the state lower bounds.

source
CTBase.mult_state_box_upper!Method
mult_state_box_upper!(
    sol::OptimalControlSolution,
    mult_state_box_upper::Function
)

Set the multipliers to the state upper bounds.

source
CTBase.mult_state_constraints!Method
mult_state_constraints!(
    sol::OptimalControlSolution,
    mult_state_constraints::Function
)

Set the multipliers to the state constraints.

source
CTBase.mult_variable_box_lower!Method
mult_variable_box_lower!(
    sol::OptimalControlSolution,
    mult_variable_box_lower::Union{Real, AbstractVector{<:Real}}
)

Set the multipliers to the variable lower bounds.

source
CTBase.mult_variable_box_upper!Method
mult_variable_box_upper!(
    sol::OptimalControlSolution,
    mult_variable_box_upper::Union{Real, AbstractVector{<:Real}}
)

Set the multipliers to the variable upper bounds.

source
CTBase.mult_variable_constraints!Method
mult_variable_constraints!(
    sol::OptimalControlSolution,
    mult_variable_constraints::Union{Real, AbstractVector{<:Real}}
)

Set the multipliers to the variable constraints.

source
CTBase.stopping!Method
stopping!(sol::OptimalControlSolution, stopping::Symbol)

Set the stopping criterion.

source
CTBase.time_grid!Method
time_grid!(
    sol::OptimalControlSolution,
    time_grid::Union{StepRangeLen, AbstractVector{<:Real}}
)

Set the time grid.

source
CTBase.variable_constraints!Method
variable_constraints!(
    sol::OptimalControlSolution,
    variable_constraints::Union{Real, AbstractVector{<:Real}}
)

Set the variable constraints.

source