diff --git a/src/model/resources/storage/storage_all.jl b/src/model/resources/storage/storage_all.jl index 20126ce29f..990ce58bba 100644 --- a/src/model/resources/storage/storage_all.jl +++ b/src/model/resources/storage/storage_all.jl @@ -173,7 +173,7 @@ function storage_all_reserves!(EP::Model, inputs::Dict, setup::Dict) vRSV_charge = EP[:vRSV_charge] vREG_discharge = EP[:vREG_discharge] vRSV_discharge = EP[:vRSV_discharge] - vCAPRES_discharge = EP[:vCAPRES_discharge] + eTotalCap = EP[:eTotalCap] eTotalCapEnergy = EP[:eTotalCapEnergy] @@ -208,7 +208,7 @@ function storage_all_reserves!(EP::Model, inputs::Dict, setup::Dict) add_similar_to_expression!(expr[STOR_REG, :], vREG_discharge[STOR_REG, :]) add_similar_to_expression!(expr[STOR_RSV, :], vRSV_discharge[STOR_RSV, :]) if CapacityReserveMargin > 0 - add_similar_to_expression!(expr[STOR_ALL, :], vCAPRES_discharge[STOR_ALL, :]) + add_similar_to_expression!(expr[STOR_ALL, :], EP[:vCAPRES_discharge][STOR_ALL, :]) end # Maximum discharging rate and contribution to reserves up must be less than power rating @constraint(EP, [y in STOR_ALL, t in T], expr[y, t] <= eTotalCap[y])