Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ For questions or general discussion, please open a [discussion](https://github.c

To contribute code, fork the repository, make your changes, and submit a pull request. Please review our [Developer Guide](https://reeds-model.github.io/ReEDS/developer_best_practices.html) before getting started.

**Note:** if you're considering making a change that might lead to meaningful differences in model capability, workflow, or outputs, we recommend initiating a [discussion](https://github.com/ReEDS-Model/ReEDS/discussions).
**Note:** if you're considering making a change that might lead to meaningful differences in model capability, workflow, or outputs, we recommend initiating a [discussion](https://github.com/ReEDS-Model/ReEDS/discussions).
17 changes: 9 additions & 8 deletions b_inputs.gms
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@ alias(cendiv,cendiv2) ;
alias(rscbin,arscbin) ;
alias(nercr,nercrr) ;
alias(transgrp,transgrpp) ;
alias(transreg,transregg) ;
alias(itlgrp,itlgrpp) ;

parameter yeart(t) "numeric value for year",
Expand Down Expand Up @@ -3540,12 +3541,12 @@ routes_transgroup(transgrp,transgrpp,r,rr)$[
$(not sameas(r,rr))
] = yes ;

set routes_nercr(nercr,nercrr,r,rr) "collection of routes between nercrs" ;
routes_nercr(nercr,nercrr,r,rr)$[
parameter routes_transreg(transreg,transregg,r,rr) "collection of routes between transregs" ;
routes_transreg(transreg,transregg,r,rr)$[
sum{(t,trtype), routes(r,rr,trtype,t) }
$r_nercr(r,nercr)
$r_nercr(rr,nercrr)
$(not sameas(nercr,nercrr))
$r_transreg(r,transreg)
$r_transreg(rr,transregg)
$(not sameas(transreg,transregg))
$(not sameas(r,rr))
] = yes ;

Expand Down Expand Up @@ -4961,7 +4962,7 @@ $onlisting
/ ;

$onempty
parameter firm_import_limit(nercr,allt) "--fraction-- limit on net firm imports into NERC regions"
parameter firm_import_limit(transreg,allt) "--fraction-- limit on net firm imports into FERC regions"
/
$offlisting
$ondelim
Expand All @@ -4970,11 +4971,11 @@ $offdelim
$onlisting
/ ;

parameter peakload_nercr(nercr,allt) "--MW-- Peak exogenous demand across all weather years by NERC region"
parameter peakload_transreg(transreg,allt) "--MW-- Peak exogenous demand across all weather years by FERC region"
/
$offlisting
$ondelim
$include inputs_case%ds%peakload_nercr.csv
$include inputs_case%ds%peakload_transreg.csv
$offdelim
$onlisting
/ ;
Expand Down
6 changes: 3 additions & 3 deletions c_mga.gms
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ eq_MGA_Objective$Sw_MGA..

$elseif.mgaobj %GSw_MGA_Objective% == 'rasharing'
Equation eq_MGA_Objective "--MWh-- Defines RA flows for MGA" ;
Variable MGA_OBJ "--MWh-- Flows between NERC regions during stress periods" ;
Variable MGA_OBJ "--MWh-- Flows between FERC regions during stress periods" ;
eq_MGA_Objective$Sw_MGA..
MGA_OBJ
=e=
sum{(r,rr,h,trtype,nercr,nercrr,t)
sum{(r,rr,h,trtype,transreg,transregg,t)
$[tmodel(t)
$routes(r,rr,trtype,t)
$routes_prm(r,rr)
$routes_nercr(nercr,nercrr,r,rr)
$routes_transreg(transreg,transregg,r,rr)
$h_stress(h)],
FLOW(r,rr,h,t,trtype) * hours(h)
}
Expand Down
36 changes: 18 additions & 18 deletions c_supplymodel.gms
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@ eq_interconnection_queues(tg,r,t) "--MW-- capacity deployment limit base
eq_CAPTRAN_ITL(itlgrp,itlgrpp,t) "--MW-- combined flow capacity between ITL groups"
eq_itlgrp_limit_energy(itlgrp,itlgrpp,allh,t) "--MW-- limit on combined interface energy flows for ITLs"
eq_itlgrp_limit_prm(itlgrp,itlgrpp,ccseason,t) "--MW-- limit on combined interface PRM flows for ITLs"
eq_firm_transfer_limit(nercr,allh,t) "--MW-- limit net firm capacity imports into NERC regions when using stress periods"
eq_firm_transfer_limit_cc(nercr,ccseason,t) "--MW-- limit net firm capacity imports into NERC regions when using capacity credit"
eq_firm_transfer_limit(transreg,allh,t) "--MW-- limit net firm capacity imports into FERC regions when using stress periods"
eq_firm_transfer_limit_cc(transreg,ccseason,t) "--MW-- limit net firm capacity imports into FERC regions when using capacity credit"
eq_offshore_no_backflow(r,rr,trtype,allh,t) "--MW-- disallow transmission flows from land to offshore zones"

* storage-specific equations
Expand Down Expand Up @@ -2171,51 +2171,51 @@ eq_itlgrp_limit_prm(itlgrp,itlgrpp,ccseason,t)

* ---------------------------------------------------------------------------

* NERC regions are only allowed to import firm capacity up to their limit
eq_firm_transfer_limit(nercr,h,t)
* FERC regions are only allowed to import firm capacity up to their limit
eq_firm_transfer_limit(transreg,h,t)
$[tmodel(t)
$Sw_PRM_NetImportLimit
$h_stress(h)]..

* max net import fraction [.] * peak demand by NERC region [MW]
firm_import_limit(nercr,t) * peakload_nercr(nercr,t)
* max net import fraction [.] * peak demand by FERC region [MW]
firm_import_limit(transreg,t) * peakload_transreg(transreg,t)

=g=

* net transmission imports (i.e. minus exports) accounting for losses on imports
* imports [MW]
+ sum{(r,rr,trtype,nercrr)
$[routes(rr,r,trtype,t)$routes_prm(rr,r)$routes_nercr(nercrr,nercr,rr,r)],
+ sum{(r,rr,trtype,transregg)
$[routes(rr,r,trtype,t)$routes_prm(rr,r)$routes_transreg(transregg,transreg,rr,r)],
FLOW(rr,r,h,t,trtype) * (1 - tranloss(rr,r,trtype)) }
* exports [MW]
- sum{(r,rr,trtype,nercrr)
$[routes(r,rr,trtype,t)$routes_prm(r,rr)$routes_nercr(nercr,nercrr,r,rr)],
- sum{(r,rr,trtype,transregg)
$[routes(r,rr,trtype,t)$routes_prm(r,rr)$routes_transreg(transreg,transregg,r,rr)],
FLOW(r,rr,h,t,trtype) }
;

* ---------------------------------------------------------------------------

* NERC regions are only allowed to import firm capacity up to their limit
eq_firm_transfer_limit_cc(nercr,ccseason,t)
* FERC regions are only allowed to import firm capacity up to their limit
eq_firm_transfer_limit_cc(transreg,ccseason,t)
$[tmodel(t)
$Sw_PRM_NetImportLimit
$Sw_PRM_CapCredit
$(not Sw_PCM)]..

* max net import fraction [.] * peak demand by ccseason [MW]
firm_import_limit(nercr,t)
* sum{r$r_nercr(r,nercr), peakdem_static_ccseason(r,ccseason,t) }
firm_import_limit(transreg,t)
* sum{r$r_transreg(r,transreg), peakdem_static_ccseason(r,ccseason,t) }

=g=

* net transmission imports (i.e. minus exports) accounting for losses on imports
* imports [MW]
+ sum{(r,rr,trtype,nercrr)
$[routes(rr,r,trtype,t)$routes_prm(rr,r)$routes_nercr(nercrr,nercr,rr,r)],
+ sum{(r,rr,trtype,transregg)
$[routes(rr,r,trtype,t)$routes_prm(rr,r)$routes_transreg(transregg,transreg,rr,r)],
PRMTRADE(rr,r,trtype,ccseason,t) * (1 - tranloss(rr,r,trtype)) }
* exports [MW]
- sum{(r,rr,trtype,nercrr)
$[routes(r,rr,trtype,t)$routes_prm(r,rr)$routes_nercr(nercr,nercrr,r,rr)],
- sum{(r,rr,trtype,transregg)
$[routes(r,rr,trtype,t)$routes_prm(r,rr)$routes_transreg(transreg,transregg,r,rr)],
PRMTRADE(r,rr,trtype,ccseason,t) }
;

Expand Down
2 changes: 1 addition & 1 deletion cases.csv
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ GSw_PRM_CapCreditSeasons,Season definition to use for capacity credit (2season i
GSw_PRM_hierarchy_level,hierarchy level within which to calculate peak demand,r; nercr; transreg; transgrp; cendiv; st; interconnect; country; usda_region,nercr,
GSw_PRM_NetImportLimit,Turn on (1) or off (0) the eq_firm_transfer_limit constraint on max firm net imports (NOTE: This constraint is only applied during stress periods in ReEDS; it is not applied in PRAS),0; 1,1,
GSw_PRM_NetImportLimitScen,/-delimited list of {year}_{max percent import OR 'hist' for historical percent OR 'histmax' for max historical percent across all regions} values to use in eq_firm_transfer_limit,N/A,2031_hist/2050_100,
GSw_PRM_scenario,"column of inputs/reserves/prm_annual.csv from which to draw the PRM (""nerc"" means the annual values from the 2024 NERC LTRA; ""static"" means the 2024 values from the same source); or a float (like 0.12) which gets applied as a fraction to all regions in all years (0.12 means 12%)",(static|nerc|ramp2025_20by50|^\d*\.?\d+$),0.12,
GSw_PRM_scenario,"column of inputs/reserves/prm_annual.csv from which to draw the PRM (""nerc"" means the annual values from the 2024 NERC LTRA; ""static"" means the 2026 values from the same source); or a float (like 0.12) which gets applied as a fraction to all regions in all years (0.12 means 12%)",(static|nerc|^\d*\.?\d+$),0.12,
GSw_PRM_StressIncrement,How many stress periods to add per iteration,int,2,
GSw_PRM_StressIterateMax,Max number of times to iterate on a given solve year to achieve GSw_PRM_StressThreshold when using stress periods (0 means don't iterate; 1 means 1 extra ReEDS run; etc),int,5,
GSw_PRM_StressLoadAggMethod,How to aggregate load for stress periods within the chunks specified by GSw_HourlyChunkLengthStress (only used if GSw_HourlyChunkAggMethod=mean; otherwise GSw_HourlyChunkAggMethod is used),mean; max,max,
Expand Down
4 changes: 2 additions & 2 deletions docs/source/figs/docs/hierarchy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions docs/source/plotting_scripts/maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,11 @@
'New_England':c['b'],
},
'nercr': {
'WECC_CA':c['y'],
'WECC_NW':c['b'],
'WECC_SW':c['g'],
'WECC_NW':cm2(8),
'WECC_BA':cm2(9),
'WECC_RM':cm2(10),
'WECC_CA':cm2(10),
'WECC_SW':cm2(11),
'SPP':c['y'],
'ERCOT':c['b'],
'MISO':c['g'],
Expand Down
8 changes: 4 additions & 4 deletions input_processing/hourly_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,13 +737,13 @@ def main(reeds_path, inputs_case):

reeds.io.write_profile_to_h5(regional_load_hourly, 'load.h5', inputs_case)
peakload.to_csv(os.path.join(inputs_case,'peakload.csv'))
### Write peak demand by NERC region to use in firm net import constraint
### Write peak demand by FERC region to use in firm net import constraint
(
peakload.loc['nercr']
peakload.loc['transreg']
.stack('year')
.rename_axis(['*nercr','t'])
.rename_axis(['*transreg','t'])
.rename('MW')
.to_csv(os.path.join(inputs_case,'peakload_nercr.csv'))
.to_csv(os.path.join(inputs_case,'peakload_transreg.csv'))
)
if int(sw.GSw_DRShed):
reeds.io.write_profile_to_h5(regional_dr_shed_hourly, 'dr_shed_hourly.h5', inputs_case)
Expand Down
14 changes: 7 additions & 7 deletions input_processing/transmission.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,10 @@ def calculate_co2_storage_routes(dfzones, co2_storage_sites):
### --- PROCEDURE ---
### ===========================================================================

#%% Limits on PRMTRADE across nercr boundaries
#%% Limits on PRMTRADE across transreg boundaries
if not int(sw.GSw_PRM_NetImportLimit):
## No limit
firm_import_limit = pd.DataFrame(columns=['*nercr','t','fraction']).set_index(['*nercr','t'])
firm_import_limit = pd.DataFrame(columns=['*transreg','t','fraction']).set_index(['*transreg','t'])
else:
limits = pd.Series(
{int(i.split('_')[0]): i.split('_')[1] for i in sw.GSw_PRM_NetImportLimitScen.split('/')}
Expand All @@ -240,12 +240,12 @@ def calculate_co2_storage_routes(dfzones, co2_storage_sites):
## calculate the historical net_firm_import fraction for each region and drop negative values
peak_net_imports = pd.read_csv(
os.path.join(inputs_case,'peak_net_imports.csv'),
index_col=['nercr']
index_col=['transreg']
)
net_firm_import_frac = (
peak_net_imports.MW / peak_net_imports.MW_TotalDemand
).clip(lower=0)
nercrs = net_firm_import_frac.index
transregs = net_firm_import_frac.index

_dfout = {}
for key, val in limits.items():
Expand All @@ -260,14 +260,14 @@ def calculate_co2_storage_routes(dfzones, co2_storage_sites):
_dfout[y] = net_firm_import_frac.clip(lower=net_firm_import_frac.max())
else:
## Input values are percentages so convert to fractions
_dfout[key] = pd.Series(index=nercrs, data=float(val) / 100)
_dfout[key] = pd.Series(index=transregs, data=float(val) / 100)

firm_import_limit = (
pd.concat(_dfout, names=('t',)).unstack('nercr')
pd.concat(_dfout, names=('t',)).unstack('transreg')
## Linear interpolation between values; flat projections before and after
.reindex(allyears).interpolate('linear').bfill().ffill()
.loc[solveyears]
.unstack('t').rename('fraction').rename_axis(['*nercr','t'])
.unstack('t').rename('fraction').rename_axis(['*transreg','t'])
)

firm_import_limit.to_csv(os.path.join(inputs_case, 'firm_import_limit.csv'))
Expand Down
26 changes: 12 additions & 14 deletions inputs/reserves/peak_net_imports.csv
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
nercr,t,MW,MW_TotalDemand
MISO,2024,16100,121933
NPCC_NE,2024,1800,24633
NPCC_NY,2024,5000,32280
PJM,2024,11800,149737
SERC_E,2024,2800,44014
SERC_C,2024,4400,42259
SERC_F,2024,2900,53190
SERC_SE,2024,4800,46354
SPP,2024,4000,53603
ERCOT,2024,800,84325
WECC_CA,2024,12600,57178
WECC_NW,2024,8800,62899
WECC_SW,2024,7300,26749
transreg,t,MW,MW_TotalDemand
CAISO,2024,12600,59900
NorthernGrid,2024,8800,48200
WestConnect,2024,7300,38700
ERCOT,2024,800,83900
SPP,2024,4000,54500
MISO,2024,16100,131000
SERTP,2024,9000,128000
FRCC,2024,2900,51100
PJM,2024,11800,150400
NYISO,2024,5000,32300
ISONE,2024,1800,25700
Loading
Loading