Open
Description
We have been playing around with various ways to do scenario sampling based analysis of power systems in oemof. The cleanest option seems to be to leverage the stochastic programming language built on top of pyomo, mpi-sppy.
This seems relatively straightforward. What we need to do is the following:
- For each variable and each summand of the objective function, record whether it is general (1st stage) or specific to the scenarios (2nd stage).
- Once the pyomo concrete model is built, collect all general variables/summands and pass them to mpisppy.utils.sputils.attach_root_node, see for example.
Architecturally this means the following:
- Figure out where to store the stage information for variables
- Figure out where to store the objective function summands
- Figure out where to store the stage information for them
-> Probably the blocks/components? All blocks/components?
And writing a utility function that
- Extracts all 1st stage variables from the model
- Extracts all 1st stage summands from the model
-> So the question: How do we iterate over all blocks/components and extract information from them?
If you are interested in helping with that please get in touch! We particularly need help with the architectural aspects.
In the meantime we will create a prototype where we record the information manually.