Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maximum uptime constraint #859

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from
Open

Conversation

joroeder
Copy link
Member

This PR adds a maximum uptime constraint for NonConvex flows.

The motivation is a scheduling problem for industrial processes, if you have e.g. a cyclic industrial process (block profile) with a certain time between each process and a fixed length of the process. With a maximum_uptime attribute and in combination with the existing minimum_downtime and other attributes, it is possible to model this problem within oemof.solph. See the example.

The API is an additional attribute at the NonConvex class:

Flow(
    nonconvex=NonConvex(
        maximum_uptime=4,
    )
)

The constraint itself is based on the rule that the sum of maximum_uptime +1 consecutive binary decision variables of the flow need to be smaller or equal the maximum operation time maximum_uptime.

If there is nothing against the implementation of this constraint, I would continue to implement docstrings, tests, etc. I would a appreciate a short feedback on that.

p.s.: This constraint would allow the scheduling of block profiles. We would be also interested to schedule fixed but fluctuating profiles. Any ideas?

@@ -373,6 +373,13 @@ def _create(self, group=None):
if g[2].nonconvex.minimum_uptime is not None
]
)
self.MAXUPTIMEFLOWS = Set(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must be placed close to

as the _non_convex_flow.py was refactored into _non_convex_flow_block.py

@@ -545,6 +552,34 @@ def _min_uptime_rule(block, i, o, t):
self.MINUPTIMEFLOWS, m.TIMESTEPS, rule=_min_uptime_rule
)

def _max_uptime_rule(block, i, o, t):
Copy link
Contributor

@Bachibouzouk Bachibouzouk Feb 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here it seems it should be set similar to

def _min_downtime_constraint(self):

It seems that here we would also need a def _max_downtime_constraint(self) to wrap around max_uptime_rule

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants