Adjust summed_max/min of a flow



Hi guys,

I’m currently modelling what the impact of electric vehicles will be on the power production and the power demand of Switzerland.

My problem:
If a flow is not fixed, I can set summed_max and summed_min constraint of the flow, so that the solver optimizes the flow to minimize the cost function. This is already implemented in oemof.

However, summed_max and summed_min are only the limits over all timesteps. For example if I calculate the scenario over a timespan of a year, they are the maximum and minimum limit for all the 8760 timesteps. What I want to do however is to be able to set summed_max and summed_min for monthly timesteps, so that it optimizes the flow within these monthly limits (~730) timesteps.

Is there a way I can do that? I appreciate your help and inputs!


First of all such a function is not implemented in oemof.solph.

I wonder if it is a good idea to do so from a model-philosophic perspective, but you may have your reasons. By the way a month is a very arbitrary time period.

Anyway, I have four ideas how you can deal with your problem.

  1. You could solve your problem month by month but this will obviously affect all components, which might be a problem.
  2. You could create your own component with your own API.
  3. You could extend the existing Flow class in a private Fork and add a summed_max_periodical attribute. Afterwards we could discuss, whether it could become a core feature of oemof.solph.
  4. You could create 12 parallel Flows, each working just one month, having a summed_max attribute. I know, this is a very clumsy way, but it is easy and should work if the problem does not become to big.


Just a little update: In the meantime, there appeared a ticket at GitHub that suggest a new feature, which might help with your problem. Would the suggested solution serve your needs?