Skip to content

Commit b589149

Browse files
authored
New England IEEE 39-Bus Case (#310)
* Initial case file and README * Cmake, source, and headers * change log and improved oneline --------- Co-authored-by: lukelowry <lukelowry@users.noreply.github.com>
1 parent d152c32 commit b589149

File tree

9 files changed

+2585
-1
lines changed

9 files changed

+2585
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## v0.2
44

5-
- Added 3, 10, and 37 bus test cases.
5+
- Added 3, 10, 37, and 39 bus test cases.
66
- Updated documentation.
77
- Added JSON parsing.
88
- Automatic differentiation with enzyme (w.r.t. internal and external variables).
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
add_subdirectory(Hawaii)
2+
add_subdirectory(NewEngland)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
gridkit_example_current_install_path(_install_path)
2+
3+
add_executable(newengland newengland.cpp)
4+
target_link_libraries(newengland
5+
GridKit::phasor_dynamics_core
6+
GridKit::phasor_dynamics_components
7+
GridKit::phasor_dynamics_signal
8+
GridKit::solvers_dyn)
9+
install(TARGETS newengland RUNTIME DESTINATION ${_install_path})
10+
gridkit_example_add_file(newengland.json)
11+
12+
add_test(NAME newengland
13+
COMMAND newengland ${CMAKE_CURRENT_BINARY_DIR}/newengland.json)
14+
add_test(NAME newengland_no_arg
15+
COMMAND newengland
16+
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# **Synthetic Hawaii Case**
2+
3+
## One-Line Diagram
4+
5+
<div align="center">
6+
<img align="center" src="newengland-oneline.png">
7+
8+
Figure 1: Oneline of the New England IEEE 39-bus case, courtesy of [PowerWorld](https://www.powerworld.com/WebHelp/)
9+
</div>
10+
11+
## Case Description
12+
13+
This case is a modified version of the NE 39-bus case, available at the Texas A&M University [Electric Grid Test Case Repository](https://electricgrids.engr.tamu.edu/electric-grid-test-cases/). It has been modified to include GridKit-compatible generator models.
14+
15+
Model | Count
16+
------------|--------
17+
[Bus](../../../../GridKit/Model/PhasorDynamics/Bus/README.md) | 39
18+
[Branch](../../../../GridKit/Model/PhasorDynamics/Branch/README.md) | 46
19+
[GENROU](../../../../GridKit/Model/PhasorDynamics/SynchronousMachine/GENROUwS/README.md) | 10
20+
[TGOV1](../../../../GridKit/Model/PhasorDynamics/Governor/Tgov1/README.md) | 10
21+
[IEEET1](../../../../GridKit/Model/PhasorDynamics/Exciter/IEEET1/README.md) | 10
22+
23+
## Case Events
24+
25+
The following examples needs to be constructed with this case. Currently the only events that have been implemented are faults. This is a practical case to use for modeling outages, or even forced oscillations.
26+
- Bus Fault
27+
- Line Outage
28+
- Generator Outage
29+
- Forced Oscillations
203 KB
Loading
14.4 KB
Loading
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/**
2+
* @file newengland.cpp
3+
* @author Luke Lowery (lukel@tamu.edu)
4+
* @author Adam Birchfield (abirchfield@tamu.edu)
5+
* @author Slaven Peles (peless@ornl.gov)
6+
* @brief Example running the New England IEEE 39-Bus Case
7+
*
8+
* Simulates a New England IEEE 39-Bus with Genrou 6th order generator model and
9+
* compares results with data generated for the same system by Poweworld.
10+
*
11+
*/
12+
#include "newengland.hpp"
13+
14+
#include <ctime>
15+
#include <filesystem>
16+
#include <iostream>
17+
18+
#include <GridKit/Model/PhasorDynamics/ComponentLibrary.hpp>
19+
#include <GridKit/Model/PhasorDynamics/SystemModel.hpp>
20+
#include <GridKit/Model/PhasorDynamics/SystemModelData.hpp>
21+
#include <GridKit/Solver/Dynamic/Ida.hpp>
22+
#include <GridKit/Utilities/Testing.hpp>
23+
24+
int main(int argc, const char* argv[])
25+
{
26+
using namespace GridKit::PhasorDynamics;
27+
using namespace AnalysisManager::Sundials;
28+
29+
using scalar_type = double;
30+
// using real_type = double;
31+
using index_type = size_t;
32+
33+
// Read Input JSON File
34+
std::filesystem::path input_file;
35+
if (argc < 2)
36+
{
37+
if (std::filesystem::exists("newengland.json"))
38+
{
39+
input_file = std::filesystem::current_path() / "newengland.json";
40+
}
41+
else
42+
{
43+
std::cout << "\n"
44+
"ERROR: No input file found or provided.\n"
45+
"\n"
46+
"Usage:\n"
47+
" newengland <json-input-file>\n"
48+
"\n"
49+
"Please provide a JSON input file as a positional command-line \n"
50+
"argument.\n"
51+
"\n"
52+
"By default this example will look for \"newengland.json\" in the \n"
53+
"current working directory and use that if found.\n"
54+
"\n";
55+
exit(1);
56+
}
57+
}
58+
else
59+
{
60+
input_file = argv[1];
61+
}
62+
63+
std::cout << "Example: newengland\n";
64+
std::cout << "Input file: " << input_file << '\n';
65+
66+
// Parse Model Data
67+
auto data = parseSystemModelData(input_file);
68+
69+
// Instantiate System Model
70+
SystemModel<scalar_type, index_type> sys(data);
71+
sys.allocate();
72+
73+
int status = 0;
74+
return status;
75+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/**
2+
* @file newengland.hpp
3+
* @author Luke Lowery (lukel@tamu.edu)
4+
* @author Adam Birchfield (abirchfield@tamu.edu)
5+
*
6+
*/
7+
#include <vector>
8+
9+
// Columns:
10+
// Time, Machine Speed (PowerWorld), Bus 1 Voltage Magnitude (PowerWorld)},
11+
std::vector<std::vector<double>> reference_solution =
12+
{{0, 1, 0}, // It should be {0,1,1.000000477} but something is wrong in GridKit
13+
{0.004167, 1, 1.000000477},
14+
{0.008333, 1, 1.000000477},
15+
{0.0125, 0.99999994, 1.000000477}};

0 commit comments

Comments
 (0)