Skip to content

Commit

Permalink
Merge pull request #942 from oemof/fix-sinkdsm-load-shedding-limit
Browse files Browse the repository at this point in the history
Fix SinkDSM load shedding limit
  • Loading branch information
p-snft committed Jun 11, 2023
2 parents 7040c22 + 965455b commit bcf1153
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
6 changes: 5 additions & 1 deletion src/oemof/solph/components/experimental/_sink_dsm.py
Original file line number Diff line number Diff line change
Expand Up @@ -4859,7 +4859,11 @@ def dr_yearly_limit_shed_rule(block):
for p in m.PERIODS:
if g.shed_eligibility:
# sum of all load reductions
lhs = sum(self.dsm_do_shed[g, t] for t in m.TIMESTEPS)
lhs = sum(
self.dsm_do_shed[g, t]
for pp, t in m.TIMEINDEX
if pp == p
)

# year limit
rhs = (
Expand Down
16 changes: 2 additions & 14 deletions tests/lp_files/dsm_module_DLR_invest_multi_period.lp
Original file line number Diff line number Diff line change
Expand Up @@ -623,28 +623,16 @@ c_u_SinkDSMDLRInvestmentBlock_dr_storage_limit_inc(demand_dsm_2_5)_:
c_u_SinkDSMDLRInvestmentBlock_dr_yearly_limit_shed(demand_dsm_0)_:
+1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_0)
+1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_1)
+1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_2)
+1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_3)
+1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_4)
+1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_5)
-50.0 SinkDSMDLRInvestmentBlock_total(demand_dsm_0)
-50 SinkDSMDLRInvestmentBlock_total(demand_dsm_0)
<= 0

c_u_SinkDSMDLRInvestmentBlock_dr_yearly_limit_shed(demand_dsm_1)_:
+1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_0)
+1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_1)
+1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_2)
+1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_3)
+1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_4)
+1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_5)
-50.0 SinkDSMDLRInvestmentBlock_total(demand_dsm_1)
-50 SinkDSMDLRInvestmentBlock_total(demand_dsm_1)
<= 0

c_u_SinkDSMDLRInvestmentBlock_dr_yearly_limit_shed(demand_dsm_2)_:
+1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_0)
+1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_1)
+1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_2)
+1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_3)
+1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_4)
+1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_5)
-50.0 SinkDSMDLRInvestmentBlock_total(demand_dsm_2)
Expand Down

0 comments on commit bcf1153

Please sign in to comment.