Skip to content

Commit c664a44

Browse files
committed
Cache derating_factor in allamcycle module
1 parent 4945292 commit c664a44

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/model/resources/flexible_ccs/allamcyclelox.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,11 @@ function allamcyclelox!(EP::Model, inputs::Dict, setup::Dict)
240240
# Expressions related to policies
241241
# Capacity Reserves Margin policy
242242
if setup["CapacityReserveMargin"] > 0
243+
nCRMZones = inputs["NCapacityReserveMargin"]
244+
capresfactor = inputs["DERATING_FACTOR"]
243245
@expression(EP,
244-
eCapResMarBalanceAllam[res = 1:inputs["NCapacityReserveMargin"], t = 1:T],
245-
sum(derating_factor(gen[y], tag = res) * (eP_Allam[y, t]-vCHARGE_ALLAM[y,t]) for y in ALLAM_CYCLE_LOX))
246+
eCapResMarBalanceAllam[res = 1:nCRMZones, t = 1:T],
247+
sum(capresfactor[y, res] * (eP_Allam[y, t]-vCHARGE_ALLAM[y,t]) for y in ALLAM_CYCLE_LOX))
246248
add_similar_to_expression!(EP[:eCapResMarBalance], eCapResMarBalanceAllam)
247249
end
248250

0 commit comments

Comments
 (0)