MPT with Pyomo

25 views
Skip to first unread message

Giorgio Balestrieri

unread,
Feb 18, 2019, 8:40:11 PM2/18/19
to Pyomo Developers
Hi,

is anybody aware of any project/extension aimed at using Pyomo for Model Predictive Control?
Or at least into application where a model has to be updated and solved many (~10k) times?

I'm not looking into a really fast application, but something where performance (in terms of time to create/update a model) does matter.
I know by definition Pyomo won't be as fast as - for instance - JuliaOpt, but its great design and the smooth integration with Python are way more important for my team.

Thank you,
Giorgio

Nicholson, Bethany L.

unread,
Feb 19, 2019, 9:59:33 AM2/19/19
to pyomo-de...@googlegroups.com

I know of two efforts for implementing Nonlinear MPC into Pyomo but I’m not sure about linear MPC. See the following references:

 

https://www.sciencedirect.com/science/article/pii/S0098135416301533

 

https://onlinelibrary.wiley.com/doi/full/10.1002/aic.16511

 

Bethany

--
You received this message because you are subscribed to the Google Groups "Pyomo Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-develope...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Woodruff

unread,
Feb 19, 2019, 12:11:51 PM2/19/19
to pyomo-de...@googlegroups.com
Hi Giorgio,
  If you are going to instantiate your model once then modify and solve it many times, as you may already know, you should use a persistent solver (assuming you have access to gurobi or cplex):


Dave

--

Giorgio Balestrieri

unread,
Feb 19, 2019, 12:36:09 PM2/19/19
to pyomo-de...@googlegroups.com
Hi David,

thank you very much for your reply. This looks very promising. I stumbled into persistent solvers before but never realized the main purpose is to offer better performance when incremental changes are made to a model (not sure if there are other goals, I previously thought this was mostly meant to facilitate warm starts).

Would you be able to provide some more context about the expected performance? In particular, what I'm interested in understanding is what affects the performance the most between:
  • adding/removing components
  • updating data of existing components
  • activating/deactivating components.
Also, I might have access to Gurobi or Cplex, but in general I'd much rather rely on open source solvers since each single problem is quite small. Is there a plan to include some other solvers (CBC? Glpk?) or is it something not possible at all due to the way they work?

Thank you again for the awesome work on Pyomo!

Giorgio Balestrieri

unread,
Feb 19, 2019, 12:38:38 PM2/19/19
to Pyomo Developers
Thank you Bethany! I did get in touch with the authors of the paper a while ago, it seems they basically found a way to manually update the LP files. I guess somehow the persistent solvers are aimed at achieving a similar thing but in a more generalized way. I have very limited insight in the potential differences between the two solutions though, so I'll definitely keep this on my radar.

Thank you,
Giorgio

Watson, Jean-Paul

unread,
Feb 19, 2019, 1:57:20 PM2/19/19
to pyomo-de...@googlegroups.com

The expected performance definitely depends on how much of the model is “touched” by the incremental changes.

 

Regarding the addition / removal of components: generally this should be very fast, e.g., in the case of Benders or similar iterative computations. Ditto for objective functions changes, e.g., Lagrange multiplier updates.

 

Regarding the updating of data on existing components: it depends on how many components depend on that data. If it’s only a few constraints or the objective, the update will go quite quickly. Else, you basically are re-building the model at each step. But the latter should be quite rare in practice.

 

Regarding activation/deactivation of components: again, it depends on how many components are involved. Deactivation / deletion is presumably a no-op for the corresponding gurobi/cplex bindings. Activation is similar, in that we don’t do anything smart there – you should simply have to re-populate (via methods on the persistent solver interface) those components in the interface.

 

It is important to note that Pyomo does not automatically track which components have been modified – it’s up to the user to tell the persistent solver plugin what to change / re-compile.

 

jpw

 

 

 

From: <pyomo-de...@googlegroups.com> on behalf of Giorgio Balestrieri <giorgio.ba...@gmail.com>


Reply-To: "pyomo-de...@googlegroups.com" <pyomo-de...@googlegroups.com>
Date: Tuesday, February 19, 2019 at 10:36 AM
To: Pyomo Developers <pyomo-de...@googlegroups.com>

Subject: [EXTERNAL] Re: MPT with Pyomo

Hi David,

 

thank you very much for your reply. This looks very promising. I stumbled into persistent solvers before but never realized the main purpose is to offer better performance when incremental changes are made to a model (not sure if there are other goals, I previously thought this was mostly meant to facilitate warm starts).

 

Would you be able to provide some more context about the expected performance? In particular, what I'm interested in understanding is what affects the performance the most between:

  • adding/removing components
  • updating data of existing components
  • activating/deactivating components.

Thank you again for the awesome work on Pyomo!


On Tuesday, February 19, 2019 at 6:11:51 PM UTC+1, DLWoodruff wrote:

Hi Giorgio,

  If you are going to instantiate your model once then modify and solve it many times, as you may already know, you should use a persistent solver (assuming you have access to gurobi or cplex):

 

 

Dave

 

On Mon, Feb 18, 2019 at 5:40 PM Giorgio Balestrieri <giorgio.ba...@gmail.com> wrote:

Hi,

 

is anybody aware of any project/extension aimed at using Pyomo for Model Predictive Control?

Or at least into application where a model has to be updated and solved many (~10k) times?

 

I'm not looking into a really fast application, but something where performance (in terms of time to create/update a model) does matter.

I know by definition Pyomo won't be as fast as - for instance - JuliaOpt, but its great design and the smooth integration with Python are way more important for my team.

 

Thank you,

Giorgio

--
You received this message because you are subscribed to the Google Groups "Pyomo Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-develope...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Giorgio Balestrieri

unread,
Feb 19, 2019, 2:20:51 PM2/19/19
to Pyomo Developers
Thank you very much for the clarifications.

I think it would be extremely useful to come up with some benchmarks.

Do you think there is a point where updating too many data with a persistent solver is actually slower than re-creating the Pyomo model, or should it "always" be faster?

Watson, Jean-Paul

unread,
Feb 20, 2019, 8:32:23 PM2/20/19
to pyomo-de...@googlegroups.com

I don’t think so – there is always the up-front cost of creating the pyomo model, followed by some translation process to a solver. You’ll always save the former even if the parameter changes are extensive (for example), and always need the latter.

Reply all
Reply to author
Forward
0 new messages