Skip to content

Commit

Permalink
Merge with last PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
lbonaldo committed Feb 14, 2024
1 parent 740782a commit 7a3ca00
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/model/resources/hydro/hydro_res.jl
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function hydro_res!(EP::Model, inputs::Dict, setup::Dict)
CONSTRAINTSET = HYDRO_RES
end

@constraint(EP, cHydroReservoirStart[y in CONSTRAINTSET,t in START_SUBPERIODS], EP[:vS_HYDRO][y,t] == EP[:vS_HYDRO][y, hoursbefore(p,t,1)]- (1/dfGen[y,:Eff_Down]*EP[:vP][y,t]) - vSPILL[y,t] + inputs["pP_Max"][y,t]*EP[:eTotalCap][y])
@constraint(EP, cHydroReservoirStart[y in CONSTRAINTSET,t in START_SUBPERIODS], EP[:vS_HYDRO][y,t] == EP[:vS_HYDRO][y, hoursbefore(p,t,1)]- (1/efficiency_down(gen[y])*EP[:vP][y,t]) - vSPILL[y,t] + inputs["pP_Max"][y,t]*EP[:eTotalCap][y])

### Constraints commmon to all reservoir hydro (y in set HYDRO_RES) ###
@constraints(EP, begin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@ Function for reporting the operating reserve and regulation revenue earned by ge
"""
function write_operating_reserve_regulation_revenue(path::AbstractString, inputs::Dict, setup::Dict, EP::Model)
scale_factor = setup["ParameterScale"] == 1 ? ModelScalingFactor : 1
dfGen = inputs["dfGen"]

gen = inputs["RESOURCES"]
RSV = inputs["RSV"]
REG = inputs["REG"]

dfOpRsvRevenue = DataFrame(Region = dfGen[RSV, :region], Resource = dfGen[RSV, :Resource], Zone = dfGen[RSV, :Zone], Cluster = dfGen[RSV, :cluster], AnnualSum = Array{Float64}(undef, length(RSV)),)
dfOpRegRevenue = DataFrame(Region = dfGen[REG, :region], Resource = dfGen[REG, :Resource], Zone = dfGen[REG, :Zone], Cluster = dfGen[REG, :cluster], AnnualSum = Array{Float64}(undef, length(REG)),)
regions = region.(gen)
clusters = cluster.(gen)
zones = zone_id.(gen)
names = inputs["RESOURCE_NAMES"]

dfOpRsvRevenue = DataFrame(Region = regions[RSV], Resource = names[RSV], Zone = zones[RSV], Cluster = clusters[RSV], AnnualSum = Array{Float64}(undef, length(RSV)),)
dfOpRegRevenue = DataFrame(Region = regions[REG], Resource = names[REG], Zone = zones[REG], Cluster = clusters[REG], AnnualSum = Array{Float64}(undef, length(REG)),)

weighted_reg_price = operating_regulation_price(EP, inputs, setup)
weighted_rsv_price = operating_reserve_price(EP, inputs, setup)
Expand Down

0 comments on commit 7a3ca00

Please sign in to comment.