Skip to content

Commit 87519bc

Browse files
Fix bugs in planning reserve margin. One bug was a typo in accessing a model component. The other was a problem with default capacity value for solar plants that have capacity factors greater than 1.0 (a frequently observed event on partly-cloudy days). I took a conservative approach of capping capacity value at 100% of nameplate capacity. An alternate approach would be changing the domain of gen_capacity_value from PercentFraction to NonNegativeReals.
1 parent ecaba60 commit 87519bc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

switch_model/balancing/planning_reserves.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,9 @@ def gen_capacity_value_default(m, g, t):
194194
if not m.gen_can_provide_cap_reserves[g]:
195195
return 0.0
196196
elif g in m.VARIABLE_GENS:
197-
return m.gen_max_capacity_factor[g, t]
197+
# This can be > 1 (Ex solar on partly cloudy days). Take a
198+
# conservative approach of capping at 100% of nameplate capacity.
199+
return min(1.0, m.gen_max_capacity_factor[g, t])
198200
else:
199201
return 1.0
200202
model.gen_capacity_value = Param(
@@ -221,10 +223,8 @@ def AvailableReserveCapacity_rule(m, prr, t):
221223
]
222224
for g in GENS:
223225
# Storage is only credited with its expected output
224-
# Note: this code appears to have no users, since it references
225-
# DispatchGen, which doesn't exist (should be m.DispatchGen).
226226
if g in getattr(m, 'STORAGE_GENS', set()):
227-
reserve_cap += DispatchGen[g, t] - m.ChargeStorage[g, t]
227+
reserve_cap += m.DispatchGen[g, t] - m.ChargeStorage[g, t]
228228
# If local_td is included with DER modeling, avoid allocating
229229
# distributed generation to central grid capacity because it will
230230
# be credited with adjusting load at the distribution node.

0 commit comments

Comments
 (0)