# Model Predictive Control (MPC) in Julia

**URL:** <https://discourse.julialang.org/t/model-predictive-control-mpc-in-julia/24240>\
**Category:** Optimization (Mathematical)\
**Tags:** question\
**Created:** [May 15, 2019, 2:48pm UTC](https://discourse.julialang.org/t/model-predictive-control-mpc-in-julia/24240 "2019-05-15T14:48:57Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![uwechsler](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/uwechsler/32/5223_2.png) [@uwechsler](https://discourse.julialang.org/u/uwechsler)\
**Post date:** [August 1, 2019, 2:02pm UTC](https://discourse.julialang.org/t/model-predictive-control-mpc-in-julia/24240/21 "2019-08-01T14:02:22Z")

</div>

The short answer is that tube-based MPC, in general, is a really common approach for robust MPC.

Additionally, we want to do all the time-consuming computations before applying the MPC algorithm online, i.e., solving the receding horizon problem. Therefore, tube-based MPC is better than a min-max approach. Or what approach would you use as an alternative?

You can checkout [LazySets.jl](https://github.com/JuliaReach/LazySets.jl) for set computations. I haven’t looked at the implementation of the control invariant set for nonlinear systems yet. It is true, that the computation is more involved than in the linear case. However, there exist methods to do so, but I am not sure if these methods work only for a specific kind of nonlinear systems or have different restrictions.

---

<div class="post-metadata">

**Author:** ![mforets](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mforets/32/298_2.png) [@mforets](https://discourse.julialang.org/u/mforets)\
**Post date:** [August 2, 2019, 11:17am UTC](https://discourse.julialang.org/t/model-predictive-control-mpc-in-julia/24240/22 "2019-08-02T11:17:50Z")

</div>

> [@uwechsler](#):
>
> However, I hope to be able to implement an ellipsoidal set representation in the future.

You may find [LazySets.Ellipsoid](https://juliareach.github.io/LazySets.jl/latest/lib/representations/#LazySets.Ellipsoid) useful and since it’s a `LazySet` it plays well with other set types and set operations.

---

<div class="post-metadata">

**Author:** ![bienpierre](https://avatars.discourse-cdn.com/v4/letter/b/8c91f0/32.png) [@bienpierre](https://discourse.julialang.org/u/bienpierre)\
**Post date:** [August 2, 2019, 3:43pm UTC](https://discourse.julialang.org/t/model-predictive-control-mpc-in-julia/24240/23 "2019-08-02T15:43:24Z")

</div>

Thanks for answering and the julia package links.

> Or what approach would you use as an alternative?

For an additive disturbance I don’t have knowledge of an other robust MPC ( tube-based or min-max). This [survey](https://www.tandfonline.com/doi/abs/10.1080/23307706.2014.913837) enumerates other approach, however they are for parametric or unstructured uncertainties.

I haven’t implemented some robust MPC yet, and if you have a reference that compares the tube-based and min-max MPC, it will help me a lot.

Regards

---

<div class="post-metadata">

**Author:** ![uwechsler](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/uwechsler/32/5223_2.png) [@uwechsler](https://discourse.julialang.org/u/uwechsler)\
**Post date:** [August 12, 2019, 9:12am UTC](https://discourse.julialang.org/t/model-predictive-control-mpc-in-julia/24240/24 "2019-08-12T09:12:28Z")

</div>

I don’t have a comparison since I didn’t need to implement min-max MPC or any other kind of MPC. And most likely, I will not do that in the near future.

But I should be able to help you with the implementation of tube-based MPC if you have questions, just write a post or pm me.

---

<div class="post-metadata">

**Author:** ![brett\_knoss](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/brett_knoss/32/13050_2.png) [@brett\_knoss](https://discourse.julialang.org/u/brett_knoss)\
**Post date:** [April 11, 2020, 3:04am UTC](https://discourse.julialang.org/t/model-predictive-control-mpc-in-julia/24240/25 "2020-04-11T03:04:16Z")

</div>

Check out [Packages](https://www.juliaopt.org/packages/)

It mentions [Munkres.jl](https://github.com/FugroRoames/Munkres.jl)  
too bad it’s not a JuMP extension. I think otherwise JuMP would have everything you need.

[Previous page](https://discourse.julialang.org/t/model-predictive-control-mpc-in-julia/24240.md?page=1)
