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

Add resilience template #10

Open
wants to merge 92 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
cd6455c
Create .catalog
Feb 27, 2021
f214586
Delete ica_analysis.zip
Feb 27, 2021
7f8d7df
Create ica_analysis.zip
Feb 27, 2021
cad215d
Merge branch 'master' into develop
Mar 1, 2021
bde4ef1
Merge branch 'master' into develop
Mar 1, 2021
58659a8
Update to fix issues with IEEE-37 and IEEE-123
Mar 4, 2021
15edeec
add anticipation template files
avpeery Mar 4, 2021
6110ec6
Initial commit - WIP adding anticipation files
avpeery Mar 4, 2021
d71f7f1
updated index and makefile
avpeery Mar 9, 2021
5b0625c
added zip file for anticipation
avpeery Mar 9, 2021
4433900
Add support for default config output
Mar 9, 2021
9150997
Update ica_analysis.py
Mar 10, 2021
2803431
Merge remote-tracking branch 'origin/develop' into add-resilience-tem…
avpeery Mar 15, 2021
eb4305e
Update anticipation.md
Mar 15, 2021
b5f1b79
Merge branch 'master' into develop
Apr 1, 2021
11f4700
Merge branch 'add-resilience-template' of https://github.com/slacgism…
avpeery May 18, 2021
6270a91
Merge branch 'develop' into add-resilience-template
avpeery May 18, 2021
5281592
Adding csv inputs to template
aivanova5 May 20, 2021
129b279
Updating the template
aivanova5 Jun 22, 2021
41386e8
Added pole configurations of different lengths for Southern Yellow Pines
johnsonhsiung Jun 25, 2021
2b475f4
Added pole objects for five shortest and longest five poles to test r…
johnsonhsiung Jun 26, 2021
6760e51
Added verbose
johnsonhsiung Jun 28, 2021
ba7d5b1
Adding clock object
aivanova5 Jun 28, 2021
7fafa94
created pole_file_converter.py and its inputs and outputs
johnsonhsiung Jul 20, 2021
74c483f
added more sample values to xls file and bugfixed input parsing
johnsonhsiung Jul 21, 2021
f10fe80
added multi unit value handling for lengths
johnsonhsiung Jul 24, 2021
8388446
added decimal value parsing and depth
johnsonhsiung Jul 26, 2021
b1da6d5
fixed depth calculation bug
johnsonhsiung Jul 26, 2021
b9acd45
Added descriptive comments
johnsonhsiung Jul 26, 2021
574b237
Added bugfixes on edge cases
johnsonhsiung Jul 26, 2021
9c4d0ec
Added parsing for design - structure
johnsonhsiung Jul 27, 2021
b270e07
added rounding to nearest hundreth place
johnsonhsiung Jul 30, 2021
0328961
Now outputs final .csv file with combined info
johnsonhsiung Aug 2, 2021
11bd285
added parsing from circumference to diameter
johnsonhsiung Aug 6, 2021
70b3c02
fixed pole_mount error
johnsonhsiung Aug 6, 2021
ac0e3fc
added lat/long bounding and additional value checking
johnsonhsiung Aug 13, 2021
9305db2
added Jupyter Notebook documentation
johnsonhsiung Aug 13, 2021
36a85aa
Update Resilience_Template _Start_Guide.ipynb
johnsonhsiung Aug 13, 2021
e27a354
added lat/long bounding and additional value checking
johnsonhsiung Aug 13, 2021
804551f
Delete Resilience_Template _Start_Guide.ipynb
johnsonhsiung Aug 13, 2021
abae206
Documentation
johnsonhsiung Aug 13, 2021
216fe04
Delete Pole_File_Converter_Guide.ipynb
johnsonhsiung Aug 13, 2021
129ae94
Documentation
johnsonhsiung Aug 13, 2021
781b8d3
Update Resilience_Template_Start_Guide.ipynb
johnsonhsiung Aug 13, 2021
25ecc6e
Updating anticipation template
aivanova5 Sep 13, 2021
0fa05a6
Update .index
Sep 22, 2021
fb8dad7
Removing intermediate files
aivanova5 Oct 29, 2021
fd6e91e
Update .gitignore
aivanova5 Oct 29, 2021
925a20c
Update .gitignore
aivanova5 Oct 29, 2021
14cc5ef
Moving resilience_demo.sh from models to templates
aivanova5 Oct 29, 2021
a9f2652
Update anticipation.glm
aivanova5 Oct 29, 2021
df7727f
Merge branch 'add-resilience-template' of https://github.com/slacgism…
Nov 4, 2021
bf77ce4
Revert "Merge branch 'add-resilience-template' of https://github.com/…
Nov 4, 2021
3bd60e0
Create example_for_gridwere.xls
Nov 4, 2021
e21dec7
Update pole_file_converter.py
Nov 4, 2021
a0ba0d1
Create pole_mount_data.xls
Nov 4, 2021
c408e52
Update Two-ploe or two-node study.ipynb
Nov 4, 2021
4ff98b8
Update example_for_gridwere.xls
Nov 4, 2021
20ad6df
Delete .~lock.Pole_Output_Sample.xls#
aivanova5 Nov 4, 2021
e191824
File reorganization
aivanova5 Nov 4, 2021
a4413ad
Fixing docs files.
aivanova5 Nov 4, 2021
2cf2908
Create moment_equations.png
Nov 9, 2021
b80e537
Create Two-ploe or two-node study-checkpoint.ipynb
Nov 9, 2021
ad1ec31
Update example_for_gridwere.xls
Nov 9, 2021
d0fb28f
Merge branch 'add-resilience-template' of https://github.com/slacgism…
Nov 9, 2021
145090c
Update Two-ploe or two-node study.ipynb
Nov 9, 2021
940ece6
Delete moment_equations.png
Nov 9, 2021
93c081b
Update example_for_gridwere.xls
Nov 9, 2021
0b9240d
Update pole_mount_data.xls
Nov 9, 2021
3e31cbe
Update Two-ploe or two-node study.ipynb
Nov 9, 2021
1d95b49
Create moment_equations.png
Nov 9, 2021
f2c8d48
Create Two-ploe or two-node study-checkpoint.ipynb
Nov 10, 2021
4251e6b
Update example_for_gridwere.xls
Nov 10, 2021
737b29d
Update Two-ploe or two-node study.ipynb
Nov 10, 2021
5b6aabd
Update pole_file_converter.py
Nov 15, 2021
96d09c9
Create SampleReport.xls
Nov 15, 2021
3c902eb
Update pole_file_converter.py
Nov 15, 2021
8da5f4e
Update SampleReport.xls
Nov 15, 2021
7dc84e9
Update anticipation_config.csv
Nov 17, 2021
fcb8e35
Create test_wind.player
Nov 17, 2021
d5f2fef
Update anticipation.glm
Nov 17, 2021
e786271
Update pole_data.csv
Nov 17, 2021
a15d523
Update SampleReport.xls
Nov 17, 2021
9525c4d
Update example_for_gridwere.xls
Nov 17, 2021
6dd0b1a
Update anticipation.glm
Nov 17, 2021
0732133
Update anticipation_config.csv
Nov 17, 2021
dd2167d
Update anticipation_config.csv
Nov 17, 2021
6d91914
Update pole_file_converter.py
Nov 17, 2021
ae0aafc
Update pole_file_converter.py
Nov 17, 2021
0acdb43
Merge branch 'master' of https://github.com/slacgismo/gridlabd-templa…
jewelnewman Feb 16, 2022
a7fac5e
add resilience template framework and md file
jewelnewman Jun 29, 2022
81bdc59
improved documentation
jewelnewman Jun 29, 2022
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.DS_Store
__MACOSX/
*.pyc
*.csv
*.json
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ INSTALL=$(shell gridlabd --version=install)
TARGET=$(shell gridlabd template config get DATADIR)
SOURCE=$(subst $(INSTALL)/share/gridlabd/template,.,$(TARGET))

TEMPLATES=ica_analysis
TEMPLATES= anticipation ica_analysis
FILES=$(foreach template,$(TEMPLATES),$(wildcard $(SOURCE)/$(template)/*))

build:
Expand Down
1 change: 1 addition & 0 deletions US/CA/SLAC/.index
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
anticipation
ica_analysis
Binary file added US/CA/SLAC/anticipation.zip
Binary file not shown.
2 changes: 2 additions & 0 deletions US/CA/SLAC/anticipation/.catalog
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
anticipation.glm:a=r
anticipation.py:a=rx

Large diffs are not rendered by default.

96 changes: 96 additions & 0 deletions US/CA/SLAC/anticipation/anticipation.glm
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
// Grid Resilience and Intelligence Platform (GRIP) GridLAB-D auxiliary model file


//Set up for globals
#set literal_if=FALSE
#set verbose=FALSE
#set output_message_context=NONE

//Set up modules
module powerflow;
module climate;
module tape;

// convert CSV configuration file, if any
#ifexist "anticipation_config.csv"
#exec strings <anticipation_config.csv | awk 'BEGIN {FS=","} {print "#define",$1 "=" $2}' >anticipation_config.glm
#endif

// load configuration file, if any
#ifexist "anticipation_config.glm"
#include "anticipation_config.glm"
#endif

// Set up clock
clock {
starttime ${STARTTIME};
stoptime ${STOPTIME};
timezone ${TIMEZONE};
}


class pole_mount
{
char32 type;
char1024 related;
char32 id;
char32 size;
}

object climate {
name weather;
object player {
property wind_speed;
file "test_wind.player";
};
}

// load the gridlabd-python module
module anticipation;
module powerflow {
#if RELIABILITY_MODE==off
stop_on_pole_failure TRUE;
#endif
message_flags VERBOSE;
}
#if RELIABILITY_MODE==off // TO DO _ CHANGE TO ON
object fault_check
{
check_mode ONCHANGE;
output_filename "fault_check.txt";
reliability_mode TRUE;
grid_association true;
}
#endif //RELIABILITY_MODE

#if POLE_VULNERABILITY_ANALYSIS=="on"
#debug "POLE VULNERABILITY ANALYSIS is enabled"
#input "${POLE_DATA}" -f table -t object
#endif //POLE_VULNERABILITY_ANALYSIS

#if PSPS_ANALYSIS=="on"
#debug "PSPS ANALYSIS is enabled"
#endif //PSPS_ANALYSIS

#if VEGETATION_VULNERABILITY_ANALYSIS=="on"
#debug "VEGETATION_VULNERABILITY_ANALYSIS is enabled"
#endif

//object recorder {
// parent "pole6";
// property "equipment_moment_nowind";
// property "equipment_moment";
// property "pole_moment_nowind";
// property "pole_moment";
// property "wire_tension";
// property "tilt_angle";
// property "total_moment";
// property "resisting_moment";
// property "critical_wind_speed";
// property "pole_stress";
// file "pole_outputs.csv";
// interval -1;
//}



13 changes: 13 additions & 0 deletions US/CA/SLAC/anticipation/anticipation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Anticipation GridLAB-D Template

# Synopsis

~~~
sh% gridlabd -D OUTPUT=<folder> <settings>.glm <network>.glm <recorders>.glm <template-dir>/anticipation.glm
sh% gridlabd -D OUTPUT=<folder> <cyme>.mdb ...
sh% gridlabd -D OUTPUT=<folder> <cyme>.mdb <poledata>.csv ...
~~~

# Description

## Template Files
16 changes: 16 additions & 0 deletions US/CA/SLAC/anticipation/anticipation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import gridlabd
def on_init(t):
# ATTACH THE POLES TO LINE OBJECTS BASED ON LAT / LONG
# model_objects = gridlabd.get("objects")
# pole_objects = []
# pole_coordinates = {}
# for model_object in model_objects :
# if "pole" == gridlabd.get_value(model_object, "class") or "powerflow.pole" == gridlabd.get_value(model_object, "class"):
# pole_objects.append(model_object)
# pole_coordinates[model_object]={"latitude" : gridlabd.get_value(model_object, "latitude"), "longitude" : gridlabd.get_value(model_object, "latitude") }
# print(pole_coordinates)
# for pole in pole_objects :
# gridlabd.get_value("")
# print(pole_objects)

return True
8 changes: 8 additions & 0 deletions US/CA/SLAC/anticipation/anticipation_config.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
POLE_VULNERABILITY_ANALYSIS,on
PSPS_ANALYSIS,off
VEGETATION_VULNERABILITY_ANALYSIS,off
RELIABILITY_MODE,on
POLE_DATA,"pole_data/pole_data_sec.csv"
STARTTIME,2021-06-08 00:00:00
STOPTIME,2021-06-08 06:00:00
TIMEZONE,PST+8PDT
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "967157e9",
"metadata": {},
"source": [
"# Resilience Template Start Guide \n",
"\n",
"## Environment Setup and Directory Navigation\n",
"1. Follow the guide https://docs.google.com/document/d/19hcR_RtNDjdpHn-SEGlzLocJnGF0lC53rXhEkPyB6aM/edit to set up your environment. By the end of this step, you should be able to copy the files in the add-resilience-template branch into the Docker container.\n",
"2. After copying your files into the Docker container, cd into model/US/CA/SLAC/anticipation. \n",
"\n",
"## File Descriptions\n",
"This section describes useful files that can be manipulated to produce different results. \n",
"\n",
"anticipation.glm - the main file that produces the glm objects based on its inputs. Currently, the three inputs that can be used are *pole_library_config.csv, pole_vulnerability_config.csv,* and *Sample_Output.csv*. Descriptions of these files can be found below. User has to manually comment and uncomment commands to change which file is being used as an input. After this file is run, a .glm file is produced with the same name as the input. \n",
"\n",
"pole_library_config.csv - an input file for *anticipation.glm*. It represents different pole configurations and each row is read to be a pole_configuration object while the columns are different properties of a pole configuration object. \n",
"\n",
"pole_vulnerability_config.csv - an input file for *anticipation.glm*. It represents different poles and each row is read to be a pole object while the columns are different properties of a pole object. \n",
"\n",
"Sample_Output.csv - the output of p*ole_file_converter.py*. It contains information for a pole, a pole configuration, and numerous pole mounts. Further description of *pole_file_converter.py* can be found below. \n",
"\n",
"pole_file_converter.py - this python program takes in the input *Pole_Output_Sample.xls* and outputs *Sample_Output.csv*. It's main purpose is to convert information from the input into a GridLAB-D readable .csv file. It also outputs intermediate files *Design - Pole.csv* (pole and pole configuration data), *Design - Strcture.csv* (pole mount data), and *Analysis.csv*, which are the transformed sheets in *Pole_Output_Sample.xls* before they are combined into Sample_Output.csv. Currently, *Analysis.csv* is not used or converted. \n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.6"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading