OptimalControl.jl

The OptimalControl.jl package is part of the control-toolbox ecosystem.

flowchart TD O(<a href='https://control-toolbox.org/OptimalControl.jl/stable/'>OptimalControl</a>) --> B(<a href='https://control-toolbox.org/OptimalControl.jl/stable/api-ctbase.html'>CTBase</a>) O --> D(<a href='https://control-toolbox.org/OptimalControl.jl/stable/api-ctdirect.html'>CTDirect</a>) O --> F(<a href='https://control-toolbox.org/OptimalControl.jl/stable/api-ctflows.html'>CTFlows</a>) F --> B D --> B style O fill:#FBF275

Index

For the developers, here are the private methods.

Available methods

using OptimalControl
available_methods()
(:direct, :adnlp, :ipopt)
(:direct, :adnlp, :madnlp)

Documentation

OptimalControl.OptimalControlModule
source
CommonSolve.solveMethod
solve(
    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))
source
OptimalControl.available_methodsMethod
available_methods(

) -> Tuple{Vararg{Tuple{Symbol, Symbol, Symbol}}}

Return the list of available methods to solve the optimal control problem.

source