Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi invest bug #42

Merged
merged 16 commits into from
Sep 11, 2024
Merged
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
17 changes: 14 additions & 3 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ 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:
f"results/{results_folder}/figures/illinois_dispatch.png",
f"results/{results_folder}/networks/illinois_solved.nc"
f"results/{results_folder}/networks/illinois_solved.nc",
f"dag.png"
# input:
# expand("results/")

Expand Down Expand Up @@ -108,4 +112,11 @@ rule plot_results:
emissions_figure = f"results/{results_folder}/figures/illinois_emissions.png",
active_units_figure = f"results/{results_folder}/figures/illinois_active_units.png",
monthly_generation_figure = f"results/{results_folder}/figures/illinois_monthly_generation.png"
script: "scripts/plot_results.py"
script: "scripts/plot_results.py"

rule build_dag:
input: "Snakefile"
output:
"dag.png"
shell:
"snakemake --dag | dot -Tpng > {output}"
112 changes: 70 additions & 42 deletions config.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
state_abbr: 'IL'
version: "1.0-test"
scenario: "wind_cf"
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: 1 # 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
load_share:
MISO-Z4: 0.33
ComEd: 0.67
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 @@ -25,37 +26,64 @@ co2_limits:
# 2040: 6.25
# 2045: 0.0

# 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: [2016] # NSRDB only accepts years 1998-2020
wind_years: [2009] # WTK only goes from 2009-2013
retirements: # need to have every modeled year, at least
Natural Gas:
2025:
2030: 7445.50
2035:
2040:
2045: 11459.70
2050:
Coal:
2025:
2030: 4981.60
2035:
2040:
2045: 2435.40
2050:

capacity_max:
Solar:
# 2025: 1693
# 2025: 461
Wind:
# 2025: 8700
# 2025: 798
Batteries:
# 2025: 114
# 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
load_year: 2019
fuel_cost_year: 2019
fuel_cost_year: 2023

rto_subba: ['0004','CE'] # MISO-Z4, ComEd
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: 5e3
Solar: 5e3
Wind: 5e3

# lifetime:
# Nuclear: 80
# Biomass: 40
# Natural Gas: 40
# Coal: 50
# Solar: 20
# Wind: 20
# Batteries: 15
# Petroleum: 40
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 @@ -71,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 @@ -90,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 Expand Up @@ -124,14 +152,14 @@ extendable_techs: [
# 'CTAvgCF',
# 'IGCCAvgCF',
# 'Biopower',
# 'Land-Based Wind',
# 'Utility PV',
'Land-Based Wind',
'Utility PV',
# 'LWR',
# 'NuclearSMR',
# '10Hr Battery Storage',
# '8Hr Battery Storage',
# '6Hr Battery Storage',
# '4Hr Battery Storage',
'4Hr Battery Storage',
# '2Hr Battery Storage'
]

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