knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of capratTX
is to simulate water storage reservoirs providing cooling water to thermal power plants in the ERCOT.
You must download the ERCOT Reservoir Watershed Delineations and Inflow Scenarios data files to run this software.
You can install the development version of capratTX
using devtools
:
library(devtools) install_github("pnnl/capratTX")
Start by loading the library and setting the data path:
library(capratTX) data_path <- "your_directory/ERCOT Reservoir Watershed Delineations and Inflow Scenarios/"
data_path <- "../../WECC-ERCOT/ERCOT/data/ERCOT Reservoir Watershed Delineations and Inflow Scenarios/"
Calibrate reservoirs and save a parameter file (calibration may take a minute or two reservoir operating functions are optimized):
calibrate_all_reservoirs(data_path) -> calibrated_parameters head(calibrated_parameters) readr::write_csv(calibrated_parameters, "params.csv")
To simulate all dams with the calibrated rules under a given period ("baseline" or "future"):
simulate_gcm_inflows_all_dams(data_path, period = "future", params_path = "params.csv") -> sim_data head(sim_data)
Plot storage projections for a particular reservoir:
library(ggplot2) library(dplyr) sim_data %>% # select reservoir desired filter(reservoir == "Travis") %>% # get annual minimums group_by(reservoir, gcm, year) %>% summarise(s_min = min(s_sim)) %>% ungroup() %>% ggplot(aes(year, s_min, col = gcm)) + geom_line() + labs(y = "Minimum storage level (MCM)", x = NULL)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.