Repeated solves with the same model instance

Hello everyone,

I have a question regarding repeated solution of an oemof model, e.g. in the context of model predictive control. For performance reasons it would be interesting to be able to re-use an already instantiated oemof model. The workflow would be as follows:

  1. instantiate oemof model

  2. solve model

  3. change parameters

  4. solve model

  5. goto 3.

The parameters I want to change would be the time series for load, costs, … so the model topology would stay the same. I know that this is possible for a pyomo ConcreteModel() by declaring your parameters with pyo.Param() and adapting the values in between calls of solve(), see Manipulating Pyomo Models — Pyomo 6.8.1 documentation .

So far my impression is that oemof does not use pyo.Param’s, at least I couldn’t find any after instantiating the model. So, does anybody know how to accomplish this with oemof?

On a related side-note, it would be nice if the time step could vary in between repeated solves.

Thanks in advance.

Hi @raph89,

This kind of feature has been requested several times already. We already looked into it, however, with the people involved in the oemof project, it does not have highest priority at the moment.

So, if you want to contribute to a solution, feel very welcome. When somebody is pushing this, I guess it will happen.

Cheers,
Patrik