OptimalControl.jl
The OptimalControl.jl package is part of the control-toolbox ecosystem.
Index
For the developers, here are the private methods.
Available methods
using OptimalControl
available_methods()
(:direct, :adnlp, :ipopt)
(:direct, :adnlp, :madnlp)
Documentation
OptimalControl.OptimalControl
— ModuleOptimalControl
module.
Lists all the imported modules and packages:
Base
CTBase
CTDirect
CTFlows
Core
DocStringExtensions
List of all the exported names:
*
Autonomous
Fixed
Flow
Hamiltonian
HamiltonianLift
HamiltonianVectorField
@Lie
Lie
Lift
Model
NonAutonomous
NonFixed
OptimalControlModel
OptimalControlSolution
ParsingError
Poisson
VectorField
__OCPModel
available_methods
constraint
constraint!
control
control!
costate
ct_repl
ct_repl_update_model
@def
direct_transcription
dynamics!
export_ocp_solution
import_ocp_solution
infos
iterations
load
message
objective
objective!
remove_constraint!
save
set_initial_guess
solve
state
state!
stopping
time!
time_grid
variable
variable!
∂ₜ
⋅
CommonSolve.solve
— Methodsolve(
ocp::OptimalControlModel,
description::Symbol...;
kwargs...
) -> Bool
Solve the the optimal control problem ocp
by the method given by the (optional) description.
The (optional) description
You can pass a partial description. If you give a partial description, then, if several complete descriptions contains the partial one, then, the method with the highest priority is chosen. The higher in the list, the higher is the priority. To get the list of available methods, call available_methods()
.
Keyword arguments: you can pass any other option by a pair keyword=value
according to the chosen method.
Examples
julia> sol = solve(ocp)
julia> sol = solve(ocp, :direct)
julia> sol = solve(ocp, :direct, :ipopt)
julia> sol = solve(ocp, :direct, :ipopt, display=false)
julia> sol = solve(ocp, :direct, :ipopt, display=false, init=sol)
julia> sol = solve(ocp, init=(state=[-0.5, 0.2],))
julia> sol = solve(ocp, init=(state=[-0.5, 0.2], control=0.5))
julia> sol = solve(ocp, init=(state=[-0.5, 0.2], control=0.5, variable=[1, 2]))
julia> sol = solve(ocp, init=(state=[-0.5, 0.2], control=t->6-12*t))
julia> sol = solve(ocp, init=(state=t->[-1+t, t*(t-1)], control=0.5))
julia> sol = solve(ocp, init=(state=t->[-1+t, t*(t-1)], control=t->6-12*t))
OptimalControl.available_methods
— Methodavailable_methods(
) -> Tuple{Vararg{Tuple{Symbol, Symbol, Symbol}}}
Return the list of available methods to solve the optimal control problem.