Skip to content

control-toolbox/OptimalControl.jl

Repository files navigation

OptimalControl.jl

The OptimalControl.jl package is the root package of the control-toolbox ecosystem. The control-toolbox ecosystem gathers Julia packages for mathematical control and applications. It aims to provide tools to model and solve optimal control problems with ordinary differential equations by direct and indirect methods.

Name Badge
Documentation Documentation Documentation
Code Status Build Status Covering Status pkgeval Code Style: Blue
Licence License: MIT
Release Release
Citation DOI

Installation

To install OptimalControl.jl please open Julia's interactive session (known as REPL) and press ] key in the REPL to use the package mode, then add the package:

julia> ]
pkg> add OptimalControl

Basic usage

Let us model and solve a simple optimal control problem, then plot the solution:

using OptimalControl
using NLPModelsIpopt
using Plots

ocp = @def begin
    t  [0, 1], time
    x  R², state
    u  R, control
    x(0) == [ -1, 0 ]
    x(1) == [ 0, 0 ]
    (t) == [ x₂(t), u(t) ]
    0.5( u(t)^2 )  min
end

sol = solve(ocp)

plot(sol)

For more details about this problem, please check the basic example tutorial. For a comprehensive introduction to the syntax used above to describe the optimal control problem, check the abstract syntax tutorial.

Citing us

If you use OptimalControl.jl in your work, please cite us:

Caillau, J.-B., Cots, O., Gergaud, J., Martinon, P., & Sed, S. OptimalControl.jl: a Julia package to model and solve optimal control problems with ODE's [Computer software]. https://doi.org/10.5281/zenodo.13336563

or in BibTeX format:

@software{Caillau_OptimalControl_jl_a_Julia,
author = {Caillau, Jean-Baptiste and Cots, Olivier and Gergaud, Joseph and Martinon, Pierre and Sed, Sophia},
doi = {10.5281/zenodo.13336563},
license = {["MIT"]},
title = {{OptimalControl.jl: a Julia package to model and solve optimal control problems with ODE's}},
url = {https://control-toolbox.org/OptimalControl.jl}
}

Contributing

If you think you found a bug or if you have a feature request / suggestion, feel free to open an issue. Before opening a pull request, please start an issue or a discussion on the topic.

Contributions are welcomed, check out how to contribute to a Github project. If it is your first contribution, you can also check this first contribution tutorial. You can find first good issues (if any 🙂) here. You may find other packages to contribute to at the control-toolbox organization.

If you want to ask a question, feel free to start a discussion here. This forum is for general discussion about this repository and the control-toolbox organization.

Note

If you want to add an application or a package to the control-toolbox ecosystem, please follow this set up tutorial.

See also

We acknowledge support of colleagues from ADNLPModels @Julia Smooth Optimizers and MadNLP.