ModelPredictiveControl
An open source model predictive control package for Julia.
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.7%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
An open source model predictive control package for Julia.
Basic Info
- Host: GitHub
- Owner: JuliaControl
- License: mit
- Language: Julia
- Default Branch: main
- Homepage: https://juliacontrol.github.io/ModelPredictiveControl.jl/stable
- Size: 16 MB
Statistics
- Stars: 97
- Watchers: 5
- Forks: 2
- Open Issues: 6
- Releases: 103
Topics
Metadata Files
README.md
ModelPredictiveControl.jl
An open source model predictive control package for Julia.
The package depends on ControlSystemsBase.jl
for the linear systems, JuMP.jl for the
optimization and DifferentiationInterface.jl
for the derivatives.
Installation
To install the ModelPredictiveControl package, run this command in the Julia REPL:
julia
using Pkg; Pkg.add("ModelPredictiveControl")
Getting Started
To construct model predictive controllers (MPCs), we must first specify a plant model that is typically extracted from input-output data using system identification. The model here is linear with one input, two outputs and a large time delay in the first channel (a transfer function matrix, with $s$ as the Laplace variable):
math
\mathbf{G}(s) = \frac{\mathbf{y}(s)}{\mathbf{u}(s)} =
\begin{bmatrix}
\frac{2e^{-20s}}{10s + 1} \\[3pt]
\frac{10}{4s +1}
\end{bmatrix}
We first construct the plant model with a sample time $T_s = 1$ s:
julia
using ModelPredictiveControl, ControlSystemsBase
G = [ tf( 2 , [10, 1])*delay(20)
tf( 10, [4, 1]) ]
Ts = 1.0
model = LinModel(G, Ts)
Our goal is controlling the first output $y1$, but the second one $y2$ should never exceed 35:
julia
mpc = LinMPC(model, Mwt=[1, 0], Nwt=[0.1])
mpc = setconstraint!(mpc, ymax=[Inf, 35])
The keyword arguments Mwt and Nwt are the output setpoint tracking and move suppression
weights, respectively. A setpoint step change of five tests mpc controller in closed-loop.
The result is displayed with Plots.jl:
julia
using Plots
ry = [5, 0]
res = sim!(mpc, 40, ry)
plot(res, plotry=true, plotymax=true)
See the manual for more detailed examples.
Features
Model Predictive Control Features
- linear and nonlinear plant models exploiting multiple dispatch
- model linearization based on automatic differentiation (exact Jacobians)
- supported objective function terms:
- output setpoint tracking
- move suppression
- input setpoint tracking
- terminal costs
- custom economic costs (economic model predictive control)
- control horizon distinct from prediction horizon and custom move blocking
- adaptive linear model predictive controller
- manual model modification
- automatic successive linearization of a nonlinear model
- objective function weights and covariance matrices modification
- explicit predictive controller for problems without constraint
- online-tunable soft and hard constraints on:
- output predictions
- manipulated inputs
- manipulated inputs increments
- terminal states to ensure nominal stability
- custom nonlinear inequality constraints (soft or hard)
- supported feedback strategy:
- state estimator (see State Estimation features)
- internal model structure with a custom stochastic model
- automatic model augmentation with integrating states for offset-free tracking
- support for unmeasured model outputs
- feedforward action with measured disturbances that supports direct transmission
- custom predictions for (or preview):
- output setpoints
- measured disturbances
- input setpoints
- easy integration with
Plots.jl - optimization based on
JuMP.jlto quickly compare multiple optimizers:- many quadratic solvers for linear control
- many nonlinear solvers for nonlinear control (local or global)
- derivatives based on
DifferentiationInterface.jlto compare different approaches:- automatic differentiation (exact solution)
- symbolic differentiation (exact solution)
- finite difference (approximate solution)
- supported transcription methods of the optimization problem:
- direct single shooting
- direct multiple shooting
- trapezoidal collocation
- additional information about the optimum to ease troubleshooting
- real-time control loop features:
- implementations that carefully limits the allocations
- simple soft real-time utilities
State Estimation Features
- supported state estimators/observers:
- steady-state Kalman filter
- Kalman filter
- Luenberger observer
- internal model structure
- extended Kalman filter
- unscented Kalman filter
- moving horizon estimator
- disable built-in observer to manually provide your own state estimate
- easily estimate unmeasured disturbances by adding one or more integrators at the:
- manipulated inputs
- measured outputs
- bumpless manual to automatic transfer for control with a proper initial estimate
- estimators in two possible forms:
- filter (or current) form to improve accuracy and robustness
- predictor (or delayed) form to reduce computational load
- moving horizon estimator in two formulations:
- linear plant models (quadratic optimization)
- nonlinear plant models (nonlinear optimization)
- moving horizon estimator online-tunable soft and hard constraints on:
- state estimates
- process noise estimates
- sensor noise estimates
Owner
- Name: JuliaControl
- Login: JuliaControl
- Kind: organization
- Repositories: 11
- Profile: https://github.com/JuliaControl
Control Systems Design in Julia
Citation (CITATION.cff)
cff-version: 1.2.0
message: "If you use this software, please cite the article below."
authors:
- name: "ModelPredictiveControl.jl contributors"
title: "ModelPredictiveControl.jl - An open source model predictive control package for Julia."
url: "https://github.com/JuliaControl/ModelPredictiveControl.jl"
preferred-citation:
type: generic
authors:
- family-names: "Gagnon"
given-names: "Francis"
- family-names: "Thivierge"
given-names: "Alex"
- family-names: "Desbiens"
given-names: "André"
- family-names: "Bagge Carlson"
given-names: "Fredrik"
title: "ModelPredictiveControl.jl: advanced process control made easy in Julia"
year: 2024
doi: "10.48550/arXiv.2411.09764"
url: "https://arxiv.org/abs/2411.09764"
GitHub Events
Total
- Create event: 116
- Commit comment event: 52
- Release event: 27
- Issues event: 27
- Watch event: 31
- Delete event: 81
- Issue comment event: 328
- Push event: 882
- Pull request review comment event: 7
- Pull request review event: 8
- Pull request event: 176
- Fork event: 2
Last Year
- Create event: 116
- Commit comment event: 52
- Release event: 27
- Issues event: 27
- Watch event: 31
- Delete event: 81
- Issue comment event: 328
- Push event: 882
- Pull request review comment event: 7
- Pull request review event: 8
- Pull request event: 176
- Fork event: 2
Committers
Last synced: over 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| franckgaga | f****2@g****m | 1,012 |
| CompatHelper Julia | c****y@j****g | 10 |
| Francis Gagnon | 3****a | 8 |
| Fredrik Bagge Carlson | b****n@g****m | 3 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 18
- Total pull requests: 121
- Average time to close issues: 20 days
- Average time to close pull requests: 2 days
- Total issue authors: 5
- Total pull request authors: 5
- Average comments per issue: 5.17
- Average comments per pull request: 1.13
- Merged pull requests: 105
- Bot issues: 0
- Bot pull requests: 5
Past Year
- Issues: 13
- Pull requests: 72
- Average time to close issues: 28 days
- Average time to close pull requests: 1 day
- Issue authors: 3
- Pull request authors: 4
- Average comments per issue: 6.0
- Average comments per pull request: 1.46
- Merged pull requests: 56
- Bot issues: 0
- Bot pull requests: 5
Top Authors
Issue Authors
- franckgaga (19)
- 1-Bart-1 (7)
- caxelrud (3)
- ufechner7 (2)
- pekpuglia (1)
- acxz (1)
- baggepinnen (1)
Pull Request Authors
- franckgaga (194)
- baggepinnen (8)
- github-actions[bot] (3)
- dependabot[bot] (2)
- gdalle (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- julia 11 total
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 103
juliahub.com: ModelPredictiveControl
An open source model predictive control package for Julia.
- Homepage: https://juliacontrol.github.io/ModelPredictiveControl.jl/stable
- Documentation: https://docs.juliahub.com/General/ModelPredictiveControl/stable/
- License: MIT
-
Latest release: 1.8.2
published 8 months ago
Rankings
Dependencies
- actions/checkout v2 composite
- codecov/codecov-action v3 composite
- julia-actions/cache v1 composite
- julia-actions/julia-buildpkg v1 composite
- julia-actions/julia-processcoverage v1 composite
- julia-actions/julia-runtest v1 composite
- julia-actions/setup-julia v1 composite
- JuliaRegistries/TagBot v1 composite
- actions/checkout v2 composite
- julia-actions/setup-julia v1 composite