Skip to content

Commit

Permalink
Fix write_net_revenue when Reserves = 0 (#626)
Browse files Browse the repository at this point in the history
  • Loading branch information
lbonaldo authored Feb 13, 2024
1 parent 91d4678 commit 8a3f674
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/write_outputs/write_net_revenue.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ function write_net_revenue(path::AbstractString, inputs::Dict, setup::Dict, EP::
T = inputs["T"] # Number of time steps (hours)
Z = inputs["Z"] # Number of zones
G = inputs["G"] # Number of generators
RSV = inputs["RSV"] # Generators contributing to operating reserves
REG = inputs["REG"] # Generators contributing to regulation
COMMIT = inputs["COMMIT"] # Thermal units for unit commitment
STOR_ALL = inputs["STOR_ALL"]

if setup["Reserves"] >= 1
RSV = inputs["RSV"] # Generators contributing to operating reserves
REG = inputs["REG"] # Generators contributing to regulation
end

VRE_STOR = inputs["VRE_STOR"]
dfVRE_STOR = inputs["dfVRE_STOR"]
if !isempty(VRE_STOR)
Expand Down
2 changes: 2 additions & 0 deletions src/write_outputs/write_outputs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ function write_outputs(EP::Model, path::AbstractString, setup::Dict, inputs::Dic
end
end

dfOpRegRevenue = DataFrame()
dfOpRsvRevenue = DataFrame()
if setup["Reserves"]==1 && has_duals(EP)
elapsed_time_op_res_rev = @elapsed dfOpRegRevenue, dfOpRsvRevenue = write_operating_reserve_regulation_revenue(path, inputs, setup, EP)
println("Time elapsed for writing oerating reserve and regulation revenue is")
Expand Down

0 comments on commit 8a3f674

Please sign in to comment.