Installation
OptimalControlProblems.jl is a registered Julia package. In the Julia REPL:
julia
using Pkg
Pkg.add("OptimalControlProblems")The package alone lists the problems and reads their metadata: names, parameters, statuses, initial guess and reference objective. To build a problem in a modeling, you also need the package of that modeling: each modeling is an extension, loaded when its package is.
What to install, for what
| To use the modeling | the extension needs | and to solve, load |
|---|---|---|
| OptimalControl | OptimalControl | OptimalControl, NLPModelsIpopt |
| OptimalControl, scalarized | OptimalControl | OptimalControl, MadNLP |
| JuMP | JuMP | JuMP, Ipopt |
| ModelingToolkit | ModelingToolkit | ModelingToolkit |
For instance, to build the problems with OptimalControl and solve them with Ipopt:
julia
Pkg.add(["OptimalControl", "NLPModelsIpopt"])and with JuMP:
julia
Pkg.add(["JuMP", "Ipopt"])Other packages
| To | load |
|---|---|
| solve the OptimalControl modelings on a GPU | MadNLPGPU, CUDA and CUDSS (see Solve with OptimalControl) |
| plot a solution | Plots (see Plot a solution) |
When a problem is asked for in a modeling whose package is not loaded, the error says which package to load:
julia> beam(JuMPBackend())
ERROR: UndefVarError: `beam` not defined in `Main`
Suggestion: check for spelling errors or missing imports.
Hint: a global variable of this name also exists in OptimalControlProblems.Catalogue.
- Also exported by OptimalControlProblems.