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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Fixed

* Fix setting of executable for `PluginABCE` ([#94](https://github.com/watts-dev/watts/pull/94))
* Updated example case for `PluginABCE` ([#97](https://github.com/watts-dev/watts/pull/97))

## [0.5.0]

Expand Down
171 changes: 104 additions & 67 deletions examples/1App_ABCE_C2N/abce_template.txt
Original file line number Diff line number Diff line change
@@ -1,79 +1,116 @@
# File locations and runtime options for ABCE
demand_data_file: "inputs/demand_data.csv"
seed_dispatch_data_file: "inputs/ALEAF_inputs/ABCE_IL_C2N__dispatch_summary_OP__step_0.csv"
unit_specs_abce_supp_file: "inputs/unit_specs_abce_supplemental.csv"
retirement_period_specs_file: "inputs/portfolio_retirement_specification.csv"
time_series_data_file: "inputs/timeseriesParams.xlsx"
gc_params_file: "inputs/gc_params.yml"
portfolios_file: "inputs/IL_portfolios.csv"
db_file: {{ DATABASE_NAME }}
ABCE_sysimage_file: "abceSysimage.so"
dispatch_sysimage_file: "dispatch.so"
output_file: "outputs.xlsx"
solver: "cplex"
simulation:
scenario_name: "ABCE_ERCOT_PWRC2N"
solver: "CPLEX"
num_steps: 2
annual_dispatch_engine: none
C2N_assumption: baseline

first_asset_id: 2001
scenario:
peak_demand: {{ peak_demand }}
policies:
CTAX:
enabled: True
qty: 0 # $/t CO2
PTC:
enabled: True
eligibility:
unit_type:
- conventional_nuclear
- wind
- solar
qty: {{ PTC_qty }} # $/MWh
allowed_xtr_types:
- wind
- solar
- ngcc
- ngct
- PWR_C2N0_single
- PWR_C2N1_single
- HTGR_C2N0_single
- HTGR_C2N2_single
- SFR_C2N0_single
- SFR_C2N3_single

num_steps: {{ N_STEPS }}

run_ALEAF: {{ run_ALEAF }}
#######################################################
# Advanced settings
#######################################################

natural_gas_price: {{ NATURAL_GAS_PRICE }}
conv_nuclear_FOM: {{ NFOM_VALUE }}
# Various constants: should never be updated!
constants:
first_asset_id: 2001
vis_lvl: 45 # sets the logging level for bare visual elements
large_epsilon: 1.0
time_before_start: -1
distant_time: 9999
big_number: 999999
hours_per_year: 8760
MW2kW: 1000 # converts MW to kW

C2N_subsidy: 1 # deprecated: to remove
C2N_assumption: baseline
# File paths and filenames
file_paths:
ABCE_sysimage_file: "abceSysimage.so"
db_file: "abce_db.db"
demand_data_file: "inputs/demand_data.csv"
agent_specifications_file: "inputs/single_agent_testing.yml"
# agent_specifications_file: "inputs/agent_specifications.yml"
output_file: "outputs.xlsx"
unit_specs_data_file: "inputs/unit_specs.yml"
logo: "abce.txt"

use_precomputed_price_curve: True # deprecated: to remove
enable_subsidy: False # deprecated: to remove
subsidy_amount: 0 # $/MWh
price_cap: 9001
# Modeled grid system settings which are unlikely to change frequently
system:
price_cap: 9001
tax_rate: 0.21
planning_reserve_margin: 0.1375
peak_initial_reserves: 0.0
max_total_ENS: 100000 # MWh, allowed gen. undersupply in first projected dispatch year (Energy Not Served)

policies:
CTAX:
enabled: False
qty: 30 # $/t CO2
PTC:
enabled: True
eligible:
- ConventionalNuclear
# - Wind
qty: {{ PTC_VALUE }} # $/MWh
num_repdays: 20
# Settings for demand projections
demand:
total_forecast_horizon: 10 # Number of periods in the complete forecast horizon
demand_visibility_horizon: 2
demand_projection_mode: exp_termrate # flat, exp_fitted, or exp_termrate
demand_projection_window: 5 # Total number of periods used to project demand
historical_demand_growth_rate: 0.01
terminal_demand_growth_rate: 0.01 # Exponential growth rate of demand

allowed_xtr_types:
- Wind
- Solar
# - AdvancedNuclear
- ConventionalNuclear
- NGCC
- NGCT
- Coal
# Settings for the agents' internal dispatch simulator and handling of
# dispatch data
dispatch:
num_dispatch_years: 10 # Num. of years to explicitly simulate dispatch
num_repdays: 35
hist_wt: 0.4 # Weighting of historical versus projected data
hist_decay: 0.5 # Decay factor for each historical data year

peak_demand: 28967 # MWh, to scale load duration data
demand_visibility_horizon: 5
demand_projection_mode: exp_termrate # flat, exp_fitted, or exp_termrate
demand_projection_window: 10 # Total number of periods used to project demand
historical_demand_growth_rate: 0.01
terminal_demand_growth_rate: 0.01 # Exponential growth rate of demand
planning_reserve_margin: 0.1375
peak_initial_reserves: 0 # MW, peak reserves demand (added to PD by agent_choice.jl)
tax_rate: 0.21
large_epsilon: 1.0 # Value for determining non-zero-ness of large values
num_dispatch_years: 10 # Num. of years to explicitly simulate dispatch
# Settings for agent behavior optimization
agent_opt:
num_future_periods_considered: 4 # Number of periods for which to consider future projects
max_type_rets_per_pd: 3
max_type_newbuilds_per_pd: 5
shortage_protection_period: 8
cap_decrease_threshold: 1.05
cap_decrease_margin: -0.05
cap_maintain_threshold: 1.0
cap_maintain_margin: 0.0
cap_increase_margin: 0.02
profit_lamda: 1.0 # Note: only the ratio between the lamdas matters
credit_rating_lamda: 0.1
cr_horizon: 6
int_bound: 5.0

hours_per_year: 8760
total_forecast_horizon: 100 # Number of periods in the complete forecast horizon
consider_future_projects: True
num_future_periods_considered: 4 # Number of periods for which to consider future projects
max_type_rets_per_pd: 5
max_type_newbuilds_per_pd: 3
financing:
default_debt_term: 30
default_equity_horizon: 30
depreciation_horizon: 20
starting_instrument_id: 1000

# Filenames and settings for ALEAF
ALEAF:
ALEAF_master_settings_file: "ALEAF_Master.xlsx"
ALEAF_model_type: "LC_GEP"
ALEAF_region: "ERCOT"
ALEAF_model_settings_file: "ALEAF_Master_LC_GEP.xlsx"
ALEAF_portfolio_file: "ALEAF_ERCOT.xlsx"
ALEAF_data_file: "inputs/ALEAF_settings.yml"

#### ALEAF SETTINGS
ALEAF_master_settings_file: "ALEAF_Master.xlsx"
ALEAF_model_type: "LC_GEP"
ALEAF_region: "IL"
ALEAF_model_settings_file: "ALEAF_Master_LC_GEP.xlsx"
ALEAF_portfolio_file: "ALEAF_IL.xlsx"
ALEAF_scenario_name: "ABCE_IL"
48 changes: 24 additions & 24 deletions examples/1App_ABCE_C2N/watts_exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,41 @@
from pathlib import Path
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend adding a little bit more description of what sensitivity analysis we are trying to do here. This is a sensitivity analysis where we are scanning a range of peak demand and PTC incentive to determine ???...

import numpy as np
import time
import logging


n_steps = 2

params = watts.Parameters()
params['NFOM_VALUE'] = "ATB"
params['N_STEPS'] = n_steps
params['run_ALEAF'] = "False"

# Initialize settings
template_name = "abce_template.txt"
results_path = Path.cwd() / 'results' / f"{n_steps}_periods_ALEAF_{params['run_ALEAF']}_99"
results_path = Path.cwd() / "results" / "ABCE_C2N_example"
results_path.mkdir(exist_ok=True, parents=True)

watts.Database.set_default_path(results_path)

average_ngp = 5 # $/mmbtu
variance_ngp = 2
n_samples = 12
# Initialize parameterization
params = watts.Parameters()

# Set up parameter lists
PTC_qty_list = np.linspace(start=0, stop=30, num=2) # $/MWh
peak_demand_list = np.linspace(start=76000, stop=80000, num=2) # MWh


# Start the runs
start = time.perf_counter()

np.random.seed(12345)
ngp_list = np.array([2.0, 3.5, 5.5, 8.5]) # $/mmbtu
# nfom_list = np.linspace(start=40, stop=500, num=n_samples) # $/MWh
ptc_list = np.linspace(start=0, stop=30, num=n_samples) # $/MWh
for PTC_qty in PTC_qty_list:
params["PTC_qty"] = PTC_qty

for peak_demand in peak_demand_list:
params["peak_demand"] = peak_demand

params.show_summary(show_metadata=True, sort_by="key")

abce_plugin = watts.PluginABCE(
template_name, show_stdout=True, show_stderr=True
)

for i, n in enumerate(ngp_list): # loop through all of the natural gas prices
params['NATURAL_GAS_PRICE'] = n
for j, p in enumerate(ptc_list):
params['PTC_VALUE'] = p
params['DATABASE_NAME'] = f'NG_PTC_run_4{i}{j}_pd{n_steps}.db'
params.show_summary(show_metadata=True, sort_by='key')
abce_plugin = watts.PluginABCE(f'{template_name}', show_stdout=True, show_stderr=True)
abce_result = abce_plugin(params, extra_args=['-f'])
abce_result = abce_plugin(params, extra_args=["-f"])

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to extract one or two potential results of interest and print them out?

end = time.perf_counter()

print(f'TOTAL SIMULATION TIME: {np.round(end-start)/60} minutes')
logging.info(f"TOTAL SIMULATION TIME: {np.round(end-start)/60} minutes")