Solution
Optimal control solution type
CTBase.OptimalControlSolution
— Typemutable struct OptimalControlSolution <: CTBase.AbstractOptimalControlSolution
Type of an optimal control solution.
Fields
time_grid::Union{Nothing, StepRangeLen, AbstractVector{<:Real}}
: Default: nothingtime_name::Union{Nothing, String}
: Default: nothinginitial_time_name::Union{Nothing, String}
: Default: nothingfinal_time_name::Union{Nothing, String}
: Default: nothingcontrol_dimension::Union{Nothing, Integer}
: Default: nothingcontrol_components_names::Union{Nothing, Vector{String}}
: Default: nothingcontrol_name::Union{Nothing, String}
: Default: nothingcontrol::Union{Nothing, Function}
: Default: nothingstate_dimension::Union{Nothing, Integer}
: Default: nothingstate_components_names::Union{Nothing, Vector{String}}
: Default: nothingstate_name::Union{Nothing, String}
: Default: nothingstate::Union{Nothing, Function}
: Default: nothingvariable_dimension::Union{Nothing, Integer}
: Default: nothingvariable_components_names::Union{Nothing, Vector{String}}
: Default: nothingvariable_name::Union{Nothing, String}
: Default: nothingvariable::Union{Nothing, Real, AbstractVector{<:Real}}
: Default: nothingcostate::Union{Nothing, Function}
: Default: nothingobjective::Union{Nothing, Real}
: Default: nothingiterations::Union{Nothing, Int64}
: Default: nothingstopping::Union{Nothing, Symbol}
: Default: nothingmessage::Union{Nothing, String}
: Default: nothingsuccess::Union{Nothing, Bool}
: Default: nothinginfos::Dict{Symbol, Any}
: Default: Dict{Symbol, Any}()boundary_constraints::Union{Nothing, Real, AbstractVector{<:Real}}
: Default: nothingmult_boundary_constraints::Union{Nothing, Real, AbstractVector{<:Real}}
: Default: nothingvariable_constraints::Union{Nothing, Real, AbstractVector{<:Real}}
: Default: nothingmult_variable_constraints::Union{Nothing, Real, AbstractVector{<:Real}}
: Default: nothingmult_variable_box_lower::Union{Nothing, Real, AbstractVector{<:Real}}
: Default: nothingmult_variable_box_upper::Union{Nothing, Real, AbstractVector{<:Real}}
: Default: nothingcontrol_constraints::Union{Nothing, Function}
: Default: nothingmult_control_constraints::Union{Nothing, Function}
: Default: nothingstate_constraints::Union{Nothing, Function}
: Default: nothingmult_state_constraints::Union{Nothing, Function}
: Default: nothingmixed_constraints::Union{Nothing, Function}
: Default: nothingmult_mixed_constraints::Union{Nothing, Function}
: Default: nothingmult_state_box_lower::Union{Nothing, Function}
: Default: nothingmult_state_box_upper::Union{Nothing, Function}
: Default: nothingmult_control_box_lower::Union{Nothing, Function}
: Default: nothingmult_control_box_upper::Union{Nothing, Function}
: Default: nothing
Getters
CTBase.boundary_constraints
— Methodboundary_constraints(
sol::OptimalControlSolution
) -> Union{Real, AbstractVector{<:Real}}
Return the boundary constraints of the optimal control solution or nothing
.
CTBase.control
— Methodcontrol(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
CTBase.control_components_names
— Methodcontrol_components_names(sol::OptimalControlSolution)
Return the names of the components of the control of the optimal control solution or nothing
.
CTBase.control_constraints
— Methodcontrol_constraints(sol::OptimalControlSolution) -> Function
Return the control constraints of the optimal control solution or nothing
.
CTBase.control_dimension
— Methodcontrol_dimension(sol::OptimalControlSolution) -> Integer
Return the dimension of the control of the optimal control solution or nothing
.
CTBase.control_discretized
— Methodcontrol_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
CTBase.control_name
— Methodcontrol_name(sol::OptimalControlSolution) -> String
Return the name of the control of the optimal control solution or nothing
.
CTBase.costate
— Methodcostate(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)
CTBase.costate_discretized
— Methodcostate_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
CTBase.final_time_name
— Methodfinal_time_name(sol::OptimalControlSolution) -> String
Return the name of final time of the optimal control solution or nothing
.
CTBase.infos
— Methodinfos(sol::OptimalControlSolution) -> Dict{Symbol, Any}
Return a dictionary of additional infos depending on the solver or nothing
.
CTBase.initial_time_name
— Methodinitial_time_name(sol::OptimalControlSolution) -> String
Return the name of the initial time of the optimal control solution or nothing
.
CTBase.iterations
— Methoditerations(sol::OptimalControlSolution) -> Int64
Return the number of iterations (if solved by an iterative method) of the optimal control solution or nothing
.
CTBase.message
— Methodmessage(sol::OptimalControlSolution) -> String
Return the message associated to the stopping criterion of the optimal control solution or nothing
.
CTBase.mixed_constraints
— Methodmixed_constraints(sol::OptimalControlSolution) -> Function
Return the mixed state-control constraints of the optimal control solution or nothing
.
CTBase.mult_boundary_constraints
— Methodmult_boundary_constraints(
sol::OptimalControlSolution
) -> Union{Real, AbstractVector{<:Real}}
Return the multipliers to the boundary constraints of the optimal control solution or nothing
.
CTBase.mult_control_box_lower
— Methodmult_control_box_lower(
sol::OptimalControlSolution
) -> Function
Return the multipliers to the control lower bounds of the optimal control solution or nothing
.
CTBase.mult_control_box_upper
— Methodmult_control_box_upper(
sol::OptimalControlSolution
) -> Function
Return the multipliers to the control upper bounds of the optimal control solution or nothing
.
CTBase.mult_control_constraints
— Methodmult_control_constraints(
sol::OptimalControlSolution
) -> Function
Return the multipliers to the control constraints of the optimal control solution or nothing
.
CTBase.mult_mixed_constraints
— Methodmult_mixed_constraints(
sol::OptimalControlSolution
) -> Function
Return the multipliers to the mixed state-control constraints of the optimal control solution or nothing
.
CTBase.mult_state_box_lower
— Methodmult_state_box_lower(
sol::OptimalControlSolution
) -> Function
Return the multipliers to the state lower bounds of the optimal control solution or nothing
.
CTBase.mult_state_box_upper
— Methodmult_state_box_upper(
sol::OptimalControlSolution
) -> Function
Return the multipliers to the state upper bounds of the optimal control solution or nothing
.
CTBase.mult_state_constraints
— Methodmult_state_constraints(
sol::OptimalControlSolution
) -> Function
Return the multipliers to the state constraints of the optimal control solution or nothing
.
CTBase.mult_variable_box_lower
— Methodmult_variable_box_lower(
sol::OptimalControlSolution
) -> Union{Real, AbstractVector{<:Real}}
Return the multipliers to the variable lower bounds of the optimal control solution or nothing
.
CTBase.mult_variable_box_upper
— Methodmult_variable_box_upper(
sol::OptimalControlSolution
) -> Union{Real, AbstractVector{<:Real}}
Return the multipliers to the variable upper bounds of the optimal control solution or nothing
.
CTBase.mult_variable_constraints
— Methodmult_variable_constraints(
sol::OptimalControlSolution
) -> Union{Real, AbstractVector{<:Real}}
Return the multipliers to the variable constraints of the optimal control solution or nothing
.
CTBase.objective
— Methodobjective(sol::OptimalControlSolution) -> Real
Return the objective value of the optimal control solution or nothing
.
CTBase.state
— Methodstate(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)
CTBase.state_components_names
— Methodstate_components_names(sol::OptimalControlSolution)
Return the names of the components of the state of the optimal control solution or nothing
.
CTBase.state_constraints
— Methodstate_constraints(sol::OptimalControlSolution) -> Function
Return the state constraints of the optimal control solution or nothing
.
CTBase.state_dimension
— Methodstate_dimension(sol::OptimalControlSolution) -> Integer
Return the dimension of the state of the optimal control solution or nothing
.
CTBase.state_discretized
— Methodstate_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
CTBase.state_name
— Methodstate_name(sol::OptimalControlSolution) -> String
Return the name of the state of the optimal control solution or nothing
.
CTBase.stopping
— Methodstopping(sol::OptimalControlSolution) -> Symbol
Return the stopping criterion (a Symbol) of the optimal control solution or nothing
.
CTBase.success
— Methodsuccess(sol::OptimalControlSolution) -> Bool
Return the true if the solver has finished successfully of false if not, or nothing
.
CTBase.time_grid
— Methodtime_grid(
sol::OptimalControlSolution
) -> Union{StepRangeLen, AbstractVector{<:Real}}
Return the time grid of the optimal control solution or nothing
.
CTBase.time_name
— Methodtime_name(sol::OptimalControlSolution) -> String
Return the name of the time component of the optimal control solution or nothing
.
CTBase.variable
— Methodvariable(
sol::OptimalControlSolution
) -> Union{Real, AbstractVector{<:Real}}
Return the variable of the optimal control solution or nothing
.
julia> v = variable(sol)
CTBase.variable_components_names
— Methodvariable_components_names(sol::OptimalControlSolution)
Return the names of the components of the variable of the optimal control solution or nothing
.
CTBase.variable_constraints
— Methodvariable_constraints(
sol::OptimalControlSolution
) -> Union{Real, AbstractVector{<:Real}}
Return the variable constraints of the optimal control solution or nothing
.
CTBase.variable_dimension
— Methodvariable_dimension(sol::OptimalControlSolution) -> Integer
Return the dimension of the variable of the optimal control solution or nothing
.
CTBase.variable_name
— Methodvariable_name(sol::OptimalControlSolution) -> String
Return the name of the variable of the optimal control solution or nothing
.
Constructors and setters
CTBase.OptimalControlSolution
— MethodOptimalControlSolution(
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.
CTBase.OptimalControlSolution
— MethodOptimalControlSolution(
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.
CTBase.boundary_constraints!
— Methodboundary_constraints!(
sol::OptimalControlSolution,
boundary_constraints::Union{Real, AbstractVector{<:Real}}
)
Set the boundary constraints.
CTBase.control_constraints!
— Methodcontrol_constraints!(
sol::OptimalControlSolution,
control_constraints::Function
)
Set the control constraints.
CTBase.costate!
— Methodcostate!(sol::OptimalControlSolution, costate::Function)
Set the costate.
CTBase.infos!
— Methodinfos!(
sol::OptimalControlSolution,
infos::Dict{Symbol, Any}
)
Set the additional infos.
CTBase.iterations!
— Methoditerations!(sol::OptimalControlSolution, iterations::Int64)
Set the number of iterations.
CTBase.message!
— Methodmessage!(sol::OptimalControlSolution, message::String)
Set the message of stopping.
CTBase.mixed_constraints!
— Methodmixed_constraints!(
sol::OptimalControlSolution,
mixed_constraints::Function
)
Set the mixed state/control constraints.
CTBase.mult_boundary_constraints!
— Methodmult_boundary_constraints!(
sol::OptimalControlSolution,
mult_boundary_constraints::Union{Real, AbstractVector{<:Real}}
)
Set the multipliers to the boundary constraints.
CTBase.mult_control_box_lower!
— Methodmult_control_box_lower!(
sol::OptimalControlSolution,
mult_control_box_lower::Function
)
Set the multipliers to the control lower bounds.
CTBase.mult_control_box_upper!
— Methodmult_control_box_upper!(
sol::OptimalControlSolution,
mult_control_box_upper::Function
)
Set the multipliers to the control upper bounds.
CTBase.mult_control_constraints!
— Methodmult_control_constraints!(
sol::OptimalControlSolution,
mult_control_constraints::Function
)
Set the multipliers to the control constraints.
CTBase.mult_mixed_constraints!
— Methodmult_mixed_constraints!(
sol::OptimalControlSolution,
mult_mixed_constraints::Function
)
Set the multipliers to the mixed state/control constraints.
CTBase.mult_state_box_lower!
— Methodmult_state_box_lower!(
sol::OptimalControlSolution,
mult_state_box_lower::Function
)
Set the multipliers to the state lower bounds.
CTBase.mult_state_box_upper!
— Methodmult_state_box_upper!(
sol::OptimalControlSolution,
mult_state_box_upper::Function
)
Set the multipliers to the state upper bounds.
CTBase.mult_state_constraints!
— Methodmult_state_constraints!(
sol::OptimalControlSolution,
mult_state_constraints::Function
)
Set the multipliers to the state constraints.
CTBase.mult_variable_box_lower!
— Methodmult_variable_box_lower!(
sol::OptimalControlSolution,
mult_variable_box_lower::Union{Real, AbstractVector{<:Real}}
)
Set the multipliers to the variable lower bounds.
CTBase.mult_variable_box_upper!
— Methodmult_variable_box_upper!(
sol::OptimalControlSolution,
mult_variable_box_upper::Union{Real, AbstractVector{<:Real}}
)
Set the multipliers to the variable upper bounds.
CTBase.mult_variable_constraints!
— Methodmult_variable_constraints!(
sol::OptimalControlSolution,
mult_variable_constraints::Union{Real, AbstractVector{<:Real}}
)
Set the multipliers to the variable constraints.
CTBase.state_constraints!
— Methodstate_constraints!(
sol::OptimalControlSolution,
state_constraints::Function
)
Set the state constraints.
CTBase.stopping!
— Methodstopping!(sol::OptimalControlSolution, stopping::Symbol)
Set the stopping criterion.
CTBase.success!
— Methodsuccess!(sol::OptimalControlSolution, success::Bool)
Set the success.
CTBase.time_grid!
— Methodtime_grid!(
sol::OptimalControlSolution,
time_grid::Union{StepRangeLen, AbstractVector{<:Real}}
)
Set the time grid.
CTBase.variable_constraints!
— Methodvariable_constraints!(
sol::OptimalControlSolution,
variable_constraints::Union{Real, AbstractVector{<:Real}}
)
Set the variable constraints.