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

Define multi-period investment storage level for very first time step of optimization #965

Merged
merged 5 commits into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/oemof/solph/components/_generic_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -1312,6 +1312,22 @@ def _old_storage_capacity_rule(block):

self.old_rule_build = BuildAction(rule=_old_storage_capacity_rule)

def _initially_empty_rule(block):
"""Ensure storage to be empty initially"""
for n in self.INVESTSTORAGES:
for t in m.TIMESTEPS:
if t == 0:
expr = self.storage_content[n, 0] == 0
self.initially_empty.add((n, t), expr)
jokochems marked this conversation as resolved.
Show resolved Hide resolved

self.initially_empty = Constraint(
self.INVESTSTORAGES, m.TIMESTEPS, noruleinit=True
)

self.initially_empty_build = BuildAction(
rule=_initially_empty_rule
)

# Standard storage implementation for discrete time points
else:

Expand Down
Loading
Loading