This archive is distributed in association with the INFORMS Journal on Computing under the MIT License.
The software and data in this repository are a snapshot of the software and data that were used in the research reported on in the paper Comparisons of Two-Stage Models for Flood Mitigation of Electrical Substations by B. Austgen, E. Kutanoglu, J. J. Hasenbein, and S. Santoso. The snapshot is based on this SHA in the development repository.
Important: This code is being developed on an on-going basis at https://gitlab.com/BrentAustgen/two-stage-hurricane-model. Please go there if you would like to get a more recent version or would like support.
To cite the contents of this repository, please cite both the paper and this repo, using their respective DOIs.
https://doi.org/10.1287/ijoc.2023.0125
https://doi.org/10.1287/ijoc.2023.0125.cd
Below is the BibTex for citing this snapshot of the respoitory.
@misc{AustgenComparisons2024,
author = {B. Austgen and E. Kutanoglu and J. J. Hasenbein and S. Santoso},
publisher = {INFORMS Journal on Computing},
title = {Comparisons of Two-Stage Models for Flood Mitigation of Electrical Substations},
year = {2024},
doi = {10.1287/ijoc.2023.0125.cd},
url = {https://github.com/INFORMSJoC/2023.0125},
note = {Available for download at https://github.com/INFORMSJoC/2023.0125},
}
The software in this repository allows users to the solve the optimization models found in the paper and execute the various analyses we conducted on the results of from those optimization models. The optimization models are designed to inform the siting and sizing of ad hoc flood mitigation around electrical substations prior to an imminent hurricane such that the resulting load shed may be minimized according to some preferred risk metric. The analyses mainly pertain to the sensitivity of the models to various parameters and to the performance of the models' prescribed mitigation solutions in an exact AC power flow model.
The scripts we provide are compatible with the conda environment specified in environment.yaml
,
though the file specifies numerous packages that are not called upon by this application.
Running the optimization scripts requires a working installation of Gurobi Optimizer and IPOPT. The former is used to solve mixed-integer linear programs (MILPs) and convex mixed-integer quadratically constrained programs (MIQPs) to global optimality. The latter is used to solve a nonconvex optimal AC power flow model to local optimality.
To replicate some of the figures that appear in the paper, users of this repository must create a
directory called data/original
and populate it with the following third-party data, which may
be downloaded as individual country files from
geoBoundaries @ William & Mary:
geoBoundaries-MEX-ADM1-all.zip
geoBoundaries-USA-ADM1-all.zip
Files in data/preprocessed
are those produced by our data preprocessing scripts, which are not
present in this repository. These files are used primarily to build instances of our two-stage
optimization models. They are also used to postprocess those results and to build some of the
figures that appear in the paper.
The source Python files contain helper classes and functions as well as filename definitions. Below, we provide a brief description of each source file:
config.py
: directory and filename definitions for data and resultsutil.py
: tools for optimization and postprocessingmodel.py
: implementations of the two-stage optimization models in the paperdrawutil.py
: tools to aid figure generation
We provide a variety of scripts in the form of Jupyter notebooks in the scripts/
directory.
The purpose of each such script is detailed below.
opt-01-heur-sol-algo.ipynb
: run the greedy heuristic and stores the mitigation solutionsopt-02-heur-sol-eval.ipynb
: evaluate the greedy heuristic mitigation solutions in a power flow modelopt-03-ws.ipynb
: solve the expected wait-and-see (EWS) and maximum wait-and-see (MWS) modelsopt-04-ev.ipynb
: compute an expected value (EV) solutionopt-05-eev.ipynb
: solve the expected result of the expected value solution (EEV) modelsopt-06-mv.ipynb
: compute a maximum value (MV) solutionopt-07-mmv.ipynb
: solve the maximum result of the maximum value solution (MMV) modelsopt-08-sp-ro.ipynb
: solve the stochastic programming (SP) and robust optimization (RO) modelsopt-09-no-good-cut.ipynb
: solve the SP and RO models again after eliminating the optimal mitigation solution with a "no-good" cut to evaluate its uniquenessopt-10-cross-powerflow-eval.ipynb
: evaluate performance of mitigation solution induced by a particular power flow model under an alternative model of power flowopt-11-cross-uncertainty-eval.ipynb
: evaluate performance of SP mitigation solution in RO model and vice versaopt-12-acpf-eval.ipynb
: evaluate the performance of the SP and RO solutions in the ACPF modelpost-01-consolidate.ipynb
: consolidate certain results into CSV filesijoc-01-lpac-geometries.ipynb
: illustrate the disc and cosine geometries of our LPAC variantsijoc-02-objective-and-bounds.ipynb
: illustrate the EEV/SP/EWS MMV/RO/MWS objective value dataijoc-03-solution-times.ipynb
: illustrate the time-to-solution for all SP and RO instancesijoc-04-sp-ro-similarity.ipynb
: illustrate the similarity of the SP and RO mitigation solutions and the performance of one under the alternative uncertainty perspectiveijoc-05-uncertainty-heatmap.ipynb
: illustrate the flooding scenariosijoc-06-flood-and-mitigation-maps.ipynb
: illustrate a specific mitigation solution on a mapijoc-07-acpf-perf.ipynb
: illustrate the performance of our models' prescribed mitigation solutions in the ACPF model and the relationship between contingency severity and error magnitudeijoc-08-nomenclature.ipynb
: illustrate the impact of substation flooding on buses, transmission lines, and transformers
We provide an example shell script named opt-headless-test.sh
that demonstrates how the
optimization scripts may be converted to Python scripts and executed from a command line interface.
Note that this shell script runs a small subset of all the experiments from our paper. As
detailed in the table below, we executed a large number of experiments, and it would not be
practical to execute all of these experiments in serial on a personal computing device. We
completed these experiments using SKX compute nodes from the Stampede2 cluster at the
Texas Advanced Computing Center (TACC), a system that prior to its retirement was fed computing
jobs from users via Simple Linux Utility for Resource Management (SLURM). To replicate all of our
results, we recommend using a comparable system and job scheduling tool.
We additionally provide shell scripts for running our postprocessing script and the
figure-generating scripts in headless mode. These shell scripts operate on data supplied in the
repository and are likely to terminate in seconds to minutes depending on your system. We name
these scripts post-headless.sh
and ijoc-headless.sh
.
Note: The table below summarizes the two-stage models, power flow models, case studies, and budget
values that we evaluated in our experiments. For each pair of two-stage model and case study,
we evaluated for using each incorporated power flow model all integer budgets between zero and the
budget threshold (i.e., maximum useful budget) indicated in the two right-most columns. Budget
thresholds marked with an asterisk (*) were determined via optimization whereas those without were
precomputed. In the row for EEV,
Model | Case Study | |||
Name | Formulation / Description | Imelda | Harvey | |
Two-Stage Model | EEV | 9 | 66 | |
SP | 20 | 193 | ||
EWS | 11 | 66 | ||
MMV | 8 | 62 | ||
RO | *9 | *62 | ||
MWS | *5 | *48 | ||
Power Flow Model | DC | sine is linear, cosine is 1, no reactive power branch conductance is negligible |
✓ | ✓ |
LPAC-C | sine is linear, cosine is 1, 4-sided polyhedral relaxation of unit circle |
✓ | ✓ | |
LPAC-F | sine is linear, 8-sided polyhedral relaxation of cosine, 12-sided polyhedral relaxation of unit circle |
✓ | ||
QPAC | sine is linear, quadratic relaxation of cosine, exact quadratic representation of unit circle |
✓ |
The subdirectories of results/
contain result data as listed below.
heuristic/
: heuristic mitigation solutions and their performance in instances of the SP and RO modelsws/
: partial solutions to instances the wait-and-see (WS) modelev/
: partial solutions to instances of the expected value (EV) modeleev/
: partial solutions to instances of the expected result of the expected value solution (EEV) modelmv/
: partial solutions to instances of the maximum value (MV) modelmmv/
: partial solutions to instances of the maximum result of the maximum value solution (MMV) modelsp/
: partial solutions to instances of the stochastic programming (SP) modelro/
: partial solutions to instances of the robust optimization (RO) modelspsol-romod/
: evaluation of optimal mitigation solutions to instances of the SP model in corresponding RO instancerosol-spmod/
: evaluation of optimal mitigation solutions to instances of the RO model in corresponding SP instanceacpf/
: evaluation of optimal mitigation solutions to instances of the SP and RO models under an exact AC power flow modelconslidated/
: condensed partial solution data in tabular formatfigures/
: the JPG and EPS files that appear in the paper and its online supplement
Below, we describe and show all of the figures in results/figures/
that appear in the paper and
its online supplement. We provide instructions for replicating each figure using the scripts and
data found in this repository.
Figure 1 in the paper shows the impact of substation flooding on buses and branches. It may be
replicated by running scripts/ijoc-08-nomenclature.ipynb
.
Figure 2 in the paper shows the cosine and disc geometries for our three LPAC variants for the case
of scripts/ijoc-01-lpac-geometries.ipynb
.
Figure 3 in the paper shows the objective value and bounds as functions of the mitigation budget in
the Tropical Storm Imelda case study. It may be replicated by running
scripts/ijoc-02-objective-and-bounds.ipynb
.
Figure 4 in the paper shows the objective value and bounds as functions of the mitigation budget in
the Hurricane Harvey case study. It may be replicated by running
scripts/ijoc-02-objective-and-bounds.ipynb
.
Figure 5 in the paper shows the times required to solve the studied instances to optimality.
It may be replicated by running scripts/ijoc-03-solution-times.ipynb
.
Figure 6 in the paper shows the similarity of the SP and RO solutions and the performance of each
in the alternative model. It may be replicated by running scripts/ijoc-04-sp-ro-similarity.ipynb
.
Figure 7 in the paper shows a comparison of the SP and RO mitigation solutions for the Hurricane
Harvey instance with scripts/ijoc-06-flood-and-mitigation-maps.ipynb
twice -- once specifying to illustrate the SP
solution and again specifying to illustrate the RO solution.
Figure 8 in the paper shows the absolute and relative error in load shed as a function of
contingency severity as determined by AC model evaluations of the optimal DC model solutions.
It may be replicated by running scripts/ijoc-07-acpf-perf.ipynb
.
Figure 9 in the paper shows load shed resulting from the optimal DC model solutions evaluated
using DC and AC models. It may be replicated by running scripts/ijoc-07-acpf-perf.ipynb
.
Figure 1 in the online supplement shows a comparison of cosine relaxations based on tangent lines
that are equidistantly or optimally spaced. It may be replicated by running
scripts/ijoc-01-lpac-geometries.ipynb
.
Figure 2 in the online supplement shows the Tropical Storm Imelda flood levels by scenario and by
substation. It may be replicated by running scripts/ijoc-05-uncertainty-heatmap.ipynb
.
Figure 3 in the online supplement shows the Hurricane Harvey flood levels by scenario and by
substation. It may be replicated by running scripts/ijoc-05-uncertainty-heatmap.ipynb
.
This code is being developed on an on-going basis at the author's GitLab site.
For support in using this software, submit an issue.