OptimalControl API
Index
Available methods
using OptimalControl
available_methods()
(:direct, :adnlp, :ipopt)
Documentation
OptimalControl.OptimalControl
— ModuleOptimalControl
module.
Lists all the imported modules and packages:
Base
CTBase
CTDirect
CTFlows
CTProblems
Core
DocStringExtensions
List of all the exported names:
*
Autonomous
ControlConstraint
ControlLaw
FeedbackControl
Fixed
Flow
Hamiltonian
HamiltonianLift
HamiltonianVectorField
Index
@Lie
Lie
Lift
MixedConstraint
Model
Multiplier
NonAutonomous
NonFixed
ParsingError
Poisson
Problem
@Problems
Problems
@ProblemsDescriptions
ProblemsDescriptions
StateConstraint
VectorField
available_methods
constraint
constraint!
control!
ct_repl
@def
dynamics!
is_max
is_min
is_time_dependent
is_time_independent
is_variable_dependent
is_variable_independent
objective!
plot
plot!
remove_constraint!
solve
state!
time!
variable!
∂ₜ
⋅
OptimalControl.available_methods
— Methodavailable_methods() -> Tuple{Tuple{Vararg{Symbol}}}
Return the list of available methods to solve the optimal control problem.
OptimalControl.solve
— Methodsolve(
ocp::OptimalControlModel,
description::Symbol...;
display,
init,
kwargs...
) -> Union{Nothing, OptimalControlSolution}
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.
Keyword arguments:
display
: print or not information during the resolutioninit
: an initial condition for the solver
There is only one available method for the moment: a direct method which transforms the optimal control problem into a nonlinear programming problem (NLP) solved by Ipopt
, thanks to the package ADNLPModels
. The direct method comes from the CTDirect
package.
- To see the list of available methods, simply call
available_methods()
. - 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))