Skip to content

Commit

Permalink
Fixed issue #605 by tracking capacity between stages for all generato…
Browse files Browse the repository at this point in the history
…rs with either New_Build=1 or Can_Retire=1.
  • Loading branch information
filippopecci committed Jan 8, 2024
1 parent fa5f5b8 commit ca505a2
Show file tree
Hide file tree
Showing 65 changed files with 4,561 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/multi_stage/dual_dynamic_programming.jl
Original file line number Diff line number Diff line change
Expand Up @@ -356,13 +356,13 @@ returns: JuMP model with updated linking constraints.
"""
function fix_initial_investments(EP_prev::Model, EP_cur::Model, start_cap_d::Dict, inputs_d::Dict)

RET_CAP = inputs_d["RET_CAP"] # Set of all resources subject to inter-stage capacity tracking

ALL_CAP = union(inputs_d["RET_CAP"],inputs_d["NEW_CAP"]) # Set of all resources subject to inter-stage capacity tracking
# start_cap_d dictionary contains the starting capacity expression name (e) as a key,
# and the associated linking constraint name (c) as a value
for (e, c) in start_cap_d
for y in keys(EP_cur[c])
if y[1] in RET_CAP # extract resource integer index value from key
if y[1] in ALL_CAP # extract resource integer index value from key
# Set the right hand side value of the linking initial capacity constraint in the current
# stage to the value of the available capacity variable solved for in the previous stages
set_normalized_rhs(EP_cur[c][y], value(EP_prev[e][y]))
Expand Down
5 changes: 0 additions & 5 deletions src/multi_stage/endogenous_retirement.jl
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ function endogenous_retirement_discharge!(EP::Model, inputs::Dict, num_stages::I

dfGen = inputs["dfGen"]

G = inputs["G"] # Number of resources (generators, storage, DR, and DERs)

NEW_CAP = inputs["NEW_CAP"] # Set of all resources eligible for new capacity
RET_CAP = inputs["RET_CAP"] # Set of all resources eligible for capacity retirements
COMMIT = inputs["COMMIT"] # Set of all resources eligible for unit commitment
Expand Down Expand Up @@ -181,8 +179,6 @@ function endogenous_retirement_charge!(EP::Model, inputs::Dict, num_stages::Int,

dfGen = inputs["dfGen"]

STOR_ASYMMETRIC = inputs["STOR_ASYMMETRIC"] # Set of storage resources with asymmetric (separte) charge/discharge capacity components

NEW_CAP_CHARGE = inputs["NEW_CAP_CHARGE"] # Set of asymmetric charge/discharge storage resources eligible for new charge capacity
RET_CAP_CHARGE = inputs["RET_CAP_CHARGE"] # Set of asymmetric charge/discharge storage resources eligible for charge capacity retirements

Expand Down Expand Up @@ -231,7 +227,6 @@ function endogenous_retirement_energy!(EP::Model, inputs::Dict, num_stages::Int,

dfGen = inputs["dfGen"]

STOR_ALL = inputs["STOR_ALL"] # Set of all storage resources
NEW_CAP_ENERGY = inputs["NEW_CAP_ENERGY"] # Set of all storage resources eligible for new energy capacity
RET_CAP_ENERGY = inputs["RET_CAP_ENERGY"] # Set of all storage resources eligible for energy capacity retirements

Expand Down
2 changes: 2 additions & 0 deletions test/MultiStage/Can_Retire/Inputs_p1/CO2_cap.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
,Network_zones,CO_2_Cap_Zone_1,CO_2_Max_tons_MWh_1,CO_2_Max_Mtons_1
NE,z1,1,1,1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
,Network_zones,CapRes_1
NE,z1,0.156
121 changes: 121 additions & 0 deletions test/MultiStage/Can_Retire/Inputs_p1/Demand_data.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
Voll,Demand_Segment,Cost_of_Demand_Curtailment_per_MW,Max_Demand_Curtailment,Rep_Periods,Timesteps_per_Rep_Period,Sub_Weights,Time_Index,Demand_MW_z1
50000,1,1,1,5,24,24.0,1,11122.0
,,,,,,3672.0,2,10655.0
,,,,,,5016.0,3,10441.0
,,,,,,24.0,4,10365.0
,,,,,,24.0,5,10639.0
,,,,,,,6,11577.0
,,,,,,,7,13349.0
,,,,,,,8,14550.0
,,,,,,,9,14922.0
,,,,,,,10,15165.0
,,,,,,,11,15328.0
,,,,,,,12,15380.0
,,,,,,,13,15275.0
,,,,,,,14,15154.0
,,,,,,,15,14953.0
,,,,,,,16,14885.0
,,,,,,,17,15340.0
,,,,,,,18,16003.0
,,,,,,,19,15767.0
,,,,,,,20,15236.0
,,,,,,,21,14663.0
,,,,,,,22,13889.0
,,,,,,,23,12855.0
,,,,,,,24,11809.0
,,,,,,,25,9702.0
,,,,,,,26,9229.0
,,,,,,,27,9004.0
,,,,,,,28,8951.0
,,,,,,,29,9188.0
,,,,,,,30,10087.0
,,,,,,,31,11929.0
,,,,,,,32,13166.0
,,,,,,,33,13504.0
,,,,,,,34,13632.0
,,,,,,,35,13724.0
,,,,,,,36,13742.0
,,,,,,,37,13665.0
,,,,,,,38,13641.0
,,,,,,,39,13501.0
,,,,,,,40,13366.0
,,,,,,,41,13376.0
,,,,,,,42,13524.0
,,,,,,,43,13736.0
,,,,,,,44,14401.0
,,,,,,,45,14006.0
,,,,,,,46,13006.0
,,,,,,,47,11658.0
,,,,,,,48,10416.0
,,,,,,,49,10219.0
,,,,,,,50,9671.0
,,,,,,,51,9383.0
,,,,,,,52,9269.0
,,,,,,,53,9483.0
,,,,,,,54,10103.0
,,,,,,,55,11573.0
,,,,,,,56,13059.0
,,,,,,,57,13905.0
,,,,,,,58,14430.0
,,,,,,,59,14873.0
,,,,,,,60,15179.0
,,,,,,,61,15323.0
,,,,,,,62,15515.0
,,,,,,,63,15537.0
,,,,,,,64,15481.0
,,,,,,,65,15485.0
,,,,,,,66,15440.0
,,,,,,,67,15208.0
,,,,,,,68,15028.0
,,,,,,,69,15221.0
,,,,,,,70,14913.0
,,,,,,,71,13573.0
,,,,,,,72,12159.0
,,,,,,,73,14935.0
,,,,,,,74,14062.0
,,,,,,,75,13498.0
,,,,,,,76,13146.0
,,,,,,,77,13178.0
,,,,,,,78,13712.0
,,,,,,,79,15192.0
,,,,,,,80,17114.0
,,,,,,,81,18656.0
,,,,,,,82,20020.0
,,,,,,,83,21201.0
,,,,,,,84,22009.0
,,,,,,,85,22567.0
,,,,,,,86,23070.0
,,,,,,,87,23388.0
,,,,,,,88,23629.0
,,,,,,,89,23770.0
,,,,,,,90,23575.0
,,,,,,,91,23034.0
,,,,,,,92,22325.0
,,,,,,,93,21921.0
,,,,,,,94,21122.0
,,,,,,,95,19311.0
,,,,,,,96,17514.0
,,,,,,,97,11232.0
,,,,,,,98,10825.0
,,,,,,,99,10632.0
,,,,,,,100,10622.0
,,,,,,,101,10948.0
,,,,,,,102,11984.0
,,,,,,,103,13879.0
,,,,,,,104,14890.0
,,,,,,,105,15134.0
,,,,,,,106,15241.0
,,,,,,,107,15360.0
,,,,,,,108,15407.0
,,,,,,,109,15385.0
,,,,,,,110,15372.0
,,,,,,,111,15285.0
,,,,,,,112,15482.0
,,,,,,,113,16544.0
,,,,,,,114,17247.0
,,,,,,,115,17114.0
,,,,,,,116,16657.0
,,,,,,,117,15936.0
,,,,,,,118,14783.0
,,,,,,,119,13342.0
,,,,,,,120,12052.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
,Network_zones,ESR_1,ESR_2
NE,z1,0.259,0.348
122 changes: 122 additions & 0 deletions test/MultiStage/Can_Retire/Inputs_p1/Fuels_data.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
Time_Index,NG,None
0,0.05306,0.0
1,5.28,0.0
2,5.28,0.0
3,5.28,0.0
4,5.28,0.0
5,5.28,0.0
6,5.28,0.0
7,5.28,0.0
8,5.28,0.0
9,5.28,0.0
10,5.28,0.0
11,5.28,0.0
12,5.28,0.0
13,5.28,0.0
14,5.28,0.0
15,5.28,0.0
16,5.28,0.0
17,5.28,0.0
18,5.28,0.0
19,5.28,0.0
20,5.28,0.0
21,5.28,0.0
22,5.28,0.0
23,5.28,0.0
24,5.28,0.0
25,3.69,0.0
26,3.69,0.0
27,3.69,0.0
28,3.69,0.0
29,3.69,0.0
30,3.69,0.0
31,3.69,0.0
32,3.69,0.0
33,3.69,0.0
34,3.69,0.0
35,3.69,0.0
36,3.69,0.0
37,3.69,0.0
38,3.69,0.0
39,3.69,0.0
40,3.69,0.0
41,3.69,0.0
42,3.69,0.0
43,3.69,0.0
44,3.69,0.0
45,3.69,0.0
46,3.69,0.0
47,3.69,0.0
48,3.69,0.0
49,2.23,0.0
50,2.23,0.0
51,2.23,0.0
52,2.23,0.0
53,2.23,0.0
54,2.23,0.0
55,2.23,0.0
56,2.23,0.0
57,2.23,0.0
58,2.23,0.0
59,2.23,0.0
60,2.23,0.0
61,2.23,0.0
62,2.23,0.0
63,2.23,0.0
64,2.23,0.0
65,2.23,0.0
66,2.23,0.0
67,2.23,0.0
68,2.23,0.0
69,2.23,0.0
70,2.23,0.0
71,2.23,0.0
72,2.23,0.0
73,2.34,0.0
74,2.34,0.0
75,2.34,0.0
76,2.34,0.0
77,2.34,0.0
78,2.34,0.0
79,2.34,0.0
80,2.34,0.0
81,2.34,0.0
82,2.34,0.0
83,2.34,0.0
84,2.34,0.0
85,2.34,0.0
86,2.34,0.0
87,2.34,0.0
88,2.34,0.0
89,2.34,0.0
90,2.34,0.0
91,2.34,0.0
92,2.34,0.0
93,2.34,0.0
94,2.34,0.0
95,2.34,0.0
96,2.34,0.0
97,2.74,0.0
98,2.74,0.0
99,2.74,0.0
100,2.74,0.0
101,2.74,0.0
102,2.74,0.0
103,2.74,0.0
104,2.74,0.0
105,2.74,0.0
106,2.74,0.0
107,2.74,0.0
108,2.74,0.0
109,2.74,0.0
110,2.74,0.0
111,2.74,0.0
112,2.74,0.0
113,2.74,0.0
114,2.74,0.0
115,2.74,0.0
116,2.74,0.0
117,2.74,0.0
118,2.74,0.0
119,2.74,0.0
120,2.74,0.0
5 changes: 5 additions & 0 deletions test/MultiStage/Can_Retire/Inputs_p1/Generators_data.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Resource,Zone,THERM,MUST_RUN,STOR,FLEX,HYDRO,VRE,Num_VRE_Bins,New_Build,Can_Retire,Existing_Cap_MW,Existing_Cap_MWh,Existing_Charge_Cap_MW,Max_Cap_MW,Max_Cap_MWh,Max_Charge_Cap_MW,Min_Cap_MW,Min_Cap_MWh,Min_Charge_Cap_MW,Inv_Cost_per_MWyr,Inv_Cost_per_MWhyr,Inv_Cost_Charge_per_MWyr,Fixed_OM_Cost_per_MWyr,Fixed_OM_Cost_per_MWhyr,Fixed_OM_Cost_Charge_per_MWyr,Var_OM_Cost_per_MWh,Var_OM_Cost_per_MWh_In,Heat_Rate_MMBTU_per_MWh,Fuel,Cap_Size,Start_Cost_per_MW,Start_Fuel_MMBTU_per_MW,Up_Time,Down_Time,Ramp_Up_Percentage,Ramp_Dn_Percentage,Hydro_Energy_to_Power_Ratio,Min_Power,Self_Disch,Eff_Up,Eff_Down,Min_Duration,Max_Duration,Max_Flexible_Demand_Advance,Max_Flexible_Demand_Delay,Flexible_Demand_Energy_Eff,Reg_Max,Rsv_Max,Reg_Cost,Rsv_Cost,MinCapTag,MinCapTag_1,MinCapTag_2,MinCapTag_3,MGA,Resource_Type,CapRes_1,ESR_1,ESR_2,region,cluster,WACC,Capital_Recovery_Period,Lifetime,Min_Retired_Cap_MW,Min_Retired_Energy_Cap_MW,Min_Retired_Charge_Cap_MW,LDS
natural_gas_combined_cycle,1,1,0,0,0,0,0,0,1,0,10000,0,0,-1,-1,-1,0,0,0,65400,0,0,10287,0,0,3.55,0,7.43,NG,250,91,2,6,6,0.64,0.64,0,0.468,0,1,1,0,0,0,0,1,0.25,0.5,0,0,2,0,0,0,1,natural_gas_fired_combined_cycle,0.93,0,0,NE,1,0.039,20,20,0,0,0,0
solar_pv,1,0,0,0,0,0,1,1,1,1,500,0,0,-1,-1,-1,0,0,0,85300,0,0,18760,0,0,0,0,9.13,None,0,0,0,0,0,1,1,0,0,0,1,1,0,0,0,0,1,0,0,0,0,7,1,0,0,1,solar_photovoltaic,0.8,1,1,NE,1,0.017,20,20,0,0,0,0
onshore_wind,1,0,0,0,0,0,1,1,1,1,1000,0,0,-1,-1,-1,0,0,0,97200,0,0,43205,0,0,0.1,0,9.12,None,0,0,0,0,0,1,1,0,0,0,1,1,0,0,0,0,1,0,0,0,0,6,0,1,0,1,onshore_wind_turbine,0.8,1,1,NE,1,0.024,20,20,0,0,0,0
battery,1,0,0,1,0,0,0,0,1,1,0,0,0,-1,-1,-1,0,0,0,19584,22494,0,4895,5622,5622,0.15,0.15,0,None,0,0,0,0,0,1,1,0,0,0,0.92,0.92,1,10,0,0,1,0,0,0,0,12,0,0,1,0,battery_mid,0.95,0,0,NE,0,0.027,20,20,0,0,0,0
Loading

0 comments on commit ca505a2

Please sign in to comment.