# \[ANN\] ModelPredictiveControl.jl

**URL:** <https://discourse.julialang.org/t/ann-modelpredictivecontrol-jl/100147>\
**Category:** Package Announcements\
**Tags:** control, jump, controlsystems, nmpc\
**Created:** [June 10, 2023, 6:10pm UTC](https://discourse.julialang.org/t/ann-modelpredictivecontrol-jl/100147 "2023-06-10T18:10:43Z")\
**Posts on this page:** 1\
**Showing post:** 75

<div class="post-metadata">

**Author:** ![franckgaga](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/franckgaga/32/218241_2.png) [@franckgaga](https://discourse.julialang.org/u/franckgaga)\
**Post date:** [June 24, 2026, 2:42pm UTC](https://discourse.julialang.org/t/ann-modelpredictivecontrol-jl/100147/75 "2026-06-24T14:42:23Z")

</div>

**ModelPredictiveControl v2.5.0**

I will release ModelPredictiveControl.jl v2.5.0 soon! 🥳🥳🥳

There has been a lot of work under the hood. The underlying QP and NLP problems should be more numerically robust now. All the box constraints are no longer treated as linear inequality constraints (as it was the case before, to simplify the internal logic). They are now defined as proper box constraints, which is, for the MPC:

- the slack variable \epsilon \ge 0
- the input increment bounds \mathbf{\Delta u\_{min/max}}
- the terminal constraint \mathbf{\hat{x}}\_i(k + H\_p), for transcription other than single shooting

and, for the MHE:

- the slack variable \varepsilon \ge 0
- the estimated process noise bounds \mathbf{\hat{w}\_{min/max}}
- the arrival estimate \mathbf{\hat{x}}\_k(k + N\_k + p)

as they should be, to leverage the selected inequality-handling method of the NLP solver, or, to exploit QP solvers that natively support them. Also, the dimensions of the optimization problem is now pretty-printed:

```julia
LinMPC controller with a sample time Ts = 4.0 s:
├ estimator: SteadyKalmanFilter
├ model: LinModel
├ optimizer: OSQP 
├ transcription: MultipleShooting
└ dimensions:
  │ ├ 10 prediction steps Hp
  │ ├ 5 control steps Hc
  │ ├ 2 manipulated inputs u (0 integrating states)
  │ ├ 6 estimated states x̂
  │ ├ 2 measured outputs ym (2 integrating states)
  │ ├ 0 unmeasured outputs yu
  │ └ 1 measured disturbances d
  └ optimization: # <--- new section
    ├ 71 decision variables Z̃ (1 slack variable, 21 bounds) 
    ├ 40 linear inequality constraints A (0 custom)
    └ 60 linear equality constraints Aeq

```

Thanks @cvanaret for the help! Here is the change log:

- added: support box constraint in `LinMPC` and `NonLinMPC`
- added: support box constraints in `MovingHorizonEstimator`
- added: pretty-print optimization problem dimensions for MPC and MHE
- added: `covestim` keyword argument in both `MovingHorizonEstimator` constructors
- debug: `setconstraint!` for MHE and softness parameter arguments now works
- debug: honor the `P̂_0` argument at `MovingHorizonEstimator` construction
- changed: `Cwt=1e4` in custom constraints case study
- added: dispatch on `covestim` type when inverting \mathbf{\bar{P}} in the `MovingHorizonEstimator`
- doc: added [C code generation example](https://juliacontrol.github.io/ModelPredictiveControl.jl/dev/manual/linmpc/#Generating-C-code) in “Manual: Linear Design” (via LinearMPC.jl)
- doc: various minor improvements
- test: improve coverage of predictive controller constraint violation
- bench: `MovingHorzizonEstimator` benchmark with `SteadyKalmanFilter` for the arrival covariance
- bench: removed all `LinMPC` and MHE with `Ipopt`
- bench: `MovingHorizonEstimator` with `covestim=SteadyKalmanFilter(...)`
- bench: `add_bridges=true` for `OSQP`
- bench: increase `samples` for `LinMPC`

---

_[View the full topic](https://discourse.julialang.org/t/ann-modelpredictivecontrol-jl/100147)._
