Skip to content

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 modelingthe extension needsand to solve, load
OptimalControlOptimalControlOptimalControl, NLPModelsIpopt
OptimalControl, scalarizedOptimalControlOptimalControl, MadNLP
JuMPJuMPJuMP, Ipopt
ModelingToolkitModelingToolkitModelingToolkit

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 ​

Toload
solve the OptimalControl modelings on a GPUMadNLPGPU, CUDA and CUDSS (see Solve with OptimalControl)
plot a solutionPlots (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.