Skip to content

Commit

Permalink
Merge pull request #42 from ucsusa/multi-invest-bug
Browse files Browse the repository at this point in the history
Multi invest bug
  • Loading branch information
lshaver authored Sep 11, 2024
2 parents b8d6a7b + 2ecc37d commit 70831f8
Show file tree
Hide file tree
Showing 8 changed files with 278 additions and 160 deletions.
5 changes: 4 additions & 1 deletion Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ env_file = Path("./.env").resolve()
from dotenv import load_dotenv
load_dotenv(str(env_file))

results_folder = f"{config['scenario']}_v{config['version']}"
if config['myopic']:
results_folder = f"{config['scenario']}_v{config['version']}_myopic"
else:
results_folder = f"{config['scenario']}_v{config['version']}"

rule targets:
input:
Expand Down
77 changes: 46 additions & 31 deletions config.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
state_abbr: 'IL'
version: "10.0"
scenario: "test_single_year"
version: "11.0"
scenario: "multi-invest-optimization-test"

solver: 'cplex' # 'cplex','highs','gurobi'
solver: 'highs' # 'cplex','highs','gurobi'
geo_res: 'rto' # accepts: 'rto' or 'county'
time_res: 4 # hours
myopic: False
multi_investment_periods: True
time_res: 8 # hours
load_filter: 60e3 # MW, load above this level will be removed as outliers.
total_demand: 185e6 # Annual MWh in the first year
# total_demand: 136e6 # Annual MWh in the first year
# total_demand: 185e6 # Annual MWh in the first year
total_demand: 136e6 # Annual MWh in the first year
load_growth: 0.00 # % annual growth
random_seed: 1234

# model_years: [2025, 2030, 2035, 2040, 2045]
model_years: [2025]
plot_year: 2025
model_years: [2030, 2035, 2040, 2045, 2050]
# model_years: [2025]
plot_year: 2030

co2_limits:
# 2020: 31.25
Expand All @@ -29,29 +32,31 @@ retirements: # need to have every modeled year, at least
2030: 7445.50
2035:
2040:
2045: 11459.7
2045: 11459.70
2050:
Coal:
2025:
2030: 4981.60
2035: 2433.40
2035:
2040:
2045:
2045: 2435.40
2050:

capacity_max:
Solar:
# 2025: 1693
2025: 461
# 2025: 461
Wind:
# 2025: 8700
2025: 798
# 2025: 798
Batteries:
# 2025: 114
2025: 18
# 2025: 18

# solar_years: [2016,2017,2018,2019,2020] # NSRDB only accepts years 1998-2020
# wind_years: [2009,2010,2011,2012,2013] # WTK only goes from 2009-2013
solar_years: [2017] # NSRDB only accepts years 1998-2020
wind_years: [2009] # WTK only goes from 2009-2013
solar_years: [2016,2017,2018,2019,2020] # NSRDB only accepts years 1998-2020
wind_years: [2009,2010,2011,2012,2013] # WTK only goes from 2009-2013
# solar_years: [2017] # NSRDB only accepts years 1998-2020
# wind_years: [2009] # WTK only goes from 2009-2013
load_year: 2019
fuel_cost_year: 2023

Expand All @@ -61,14 +66,24 @@ region_names: ['MISO-Z4','ComEd']
discount_rate: 0.07

growth_rates: # MW/year
Nuclear: 1e3
Biomass: 1e3
Natural Gas: 10e3
Coal: 10e3
Petroleum: 10e3
Batteries: 2.5e3
Solar: 2.5e3
Wind: 2.5e3
Nuclear: "inf"
Biomass: "inf"
Natural Gas: "inf"
Coal: "inf"
Petroleum: "inf"
Batteries: "inf"
Solar: "inf"
Wind: "inf"

# growth_rates: # MW/year
# Nuclear: 1e9
# Biomass: 1e9
# Natural Gas: 10e9
# Coal: 10e9
# Petroleum: 10e9
# Batteries: 2.5e9
# Solar: 2.5e9
# Wind: 2.5e9

lifetime:
Nuclear: 80
Expand All @@ -84,7 +99,7 @@ atb_params:
atb_year: 2022 # the ATB publication year
case: 'Market' # 'R&D'
scenario: 'Moderate' # 'Conservative', 'Advanced'
crp: 20 # 30
crp: 20
carrier: [
"Natural Gas",
"Biomass",
Expand All @@ -103,11 +118,11 @@ atb_params:
'IGCCAvgCF',
'LWR',
'NuclearSMR',
'10Hr Battery Storage',
'8Hr Battery Storage',
'6Hr Battery Storage',
# '10Hr Battery Storage',
# '8Hr Battery Storage',
# '6Hr Battery Storage',
'4Hr Battery Storage',
'2Hr Battery Storage'
# '2Hr Battery Storage'
]

lines: # this is an assumption
Expand Down
Binary file modified dag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
113 changes: 66 additions & 47 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,69 @@
name: pypsa-illinois
channels:
- conda-forge
- bioconda
- conda-forge
- bioconda
dependencies:
# Requirements for core model functionality
- python==3.10.13
- pip
- ipython
- matplotlib
- pandas
- geopandas
- numpy
- scipy
- ipykernel
- jupyter
- jupyterlab
- seaborn
- pypsa
- plotly
- pyarrow
- iprogress
- pyogrio
- fiona
- momepy
- pysal
- osmnx
- spyder-kernels=2.5
- unyt
- cartopy
- descartes
- lxml
- snakemake
- pycountry
- yaml
- geopy
- tqdm
- graphviz
- networkx
- pytz
- camelot-py
- pip:
- git+https://github.com/kmax12/gridstatus.git
- python-dotenv
- highspy
- nrelpy
- us
- census
- streamlit
- vresutils
- python<3.12
- pip

- atlite>=0.2.9
- pypsa>=0.3
- linopy
- dask

# Dependencies of the workflow itself
- xlrd
- openpyxl!=3.1.1
- seaborn
- snakemake-minimal>=8.14
- memory_profiler
- yaml
- pytables
- lxml
- powerplantmatching>=0.5.15
- numpy
- pandas>=2.1
- geopandas>=1
- xarray>=2023.11.0
- rioxarray
- netcdf4
- networkx
- scipy
- glpk
- shapely>=2.0
- pyscipopt
- unyt
- matplotlib
- proj
- fiona
- country_converter
- geopy
- tqdm
- pytz
- jpype1
- pyxlsb
- graphviz
- pre-commit
- geojson

# Keep in conda environment when calling ipython
- ipython

# GIS dependencies:
- cartopy
- descartes
- rasterio!=1.2.10


- pip:
- tsam>=2.3.1
- snakemake-storage-plugin-http
- snakemake-executor-plugin-slurm
- snakemake-executor-plugin-cluster-generic
- highspy
- tabula-py
- git+https://github.com/kmax12/gridstatus.git
- python-dotenv
- nrelpy
- us
- census
Loading

0 comments on commit 70831f8

Please sign in to comment.