Skip to content

Commit 4feccd7

Browse files
committed
updating documentation
1 parent 048471b commit 4feccd7

File tree

3 files changed

+45
-17
lines changed

3 files changed

+45
-17
lines changed

CHANGELOG.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
PowerModels.jl Change Log
22
=================
33

4-
### staged
4+
### Staged
55
- Updated to JuMP v0.15 syntax
6+
- Replaced PowerModels set data types with "ref" dictionary
7+
- Refactored Matpower data processing to simplify editing data after parsing
8+
- Replaced JSON test files with Matpower test files
9+
- Added documentation on internal JSON data format to DATA.md
10+
- Updated TNEP models to work with Matpower parsing extentions
611

712
### v0.2.3
813
- Multiple improvements to Matlab file parsing

DATA.md

+22-16
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# PowerModels Data Format
22

3-
## Network Data Dictionary
3+
## The Network Data Dictionary
44

55
Internally PowerModels utilizes a dictionary to store network data.
6-
The dictionary uses strings as key values so this data structure can be serialized to JSON for algorithmic data exchange.
6+
The dictionary uses strings as key values so it can be serialized to JSON for algorithmic data exchange.
77
The data dictionary organization and key names are designed to be consistent with the [Matpower](http://www.pserc.cornell.edu/matpower/) file format and should be familiar to power system researchers.
88

99
The network data dictionary structure is roughly as follows,
@@ -41,26 +41,32 @@ The network data dictionary structure is roughly as follows,
4141
...
4242
},
4343
...
44-
],
45-
"gencost":[
46-
{
47-
"index":<int>,
48-
"model":<int>,
49-
"startup":<float>,
50-
"shutdown":<float>,
51-
...
52-
},
53-
...
5444
]
5545
}
5646
```
5747

58-
For a detailed list of all possible parameters please refer to the specification document provided with [Matpower](http://www.pserc.cornell.edu/matpower/). In addition to the traditional Matpower parameters every network component in the PowerModels dictionary has an `index` parameter, which can be used to uniquely identify that network element.
48+
The following commands can be used to explore the network data dictionary generated by a given Matpower data file,
49+
```
50+
using PowerModels
51+
network_data = PowerModels.parse_file("$(Pkg.dir("PowerModels"))/test/data/case14.m")
52+
display(network_data)
53+
```
54+
55+
For a detailed list of all possible parameters refer to the specification document provided with [Matpower](http://www.pserc.cornell.edu/matpower/).
56+
57+
### Noteworthy Differences from Matpower Data Files
58+
59+
The PowerModels network data dictionary differs from the Matpower format in the following ways,
5960

60-
It is also important to note that although the Matpower format contains values in mixed units, during PowerModels data setup phase all of the data values are converted to per-unit and radian values.
61+
* All PowerModels components have an `index` parameter, which can be used to uniquely identify that network element.
62+
* All network parameters are in per-unit and angles are in radians.
63+
* All non-transformer branches are given nominal transformer values (i.e. a tap of 1.0 and a shift of 0).
64+
* When present, the `gencost` data is incorporated into the `gen` data, the column names remain the same.
65+
* Only quadratic active power generation cost functions are supported at this time.
66+
* Some additional derived values are added to branches, such as line admittance values (see `src/core/data.jl` for details).
6167

6268

63-
## Matpower Data Files
69+
## Working with Matpower Data Files
6470

6571
The data exchange via JSON files is ideal for building algorithms, however it is hard to for humans to read and process.
6672
To that end PowerModels also has extensive support for parsing Matpower network files in the `.m` format.
@@ -135,7 +141,7 @@ becomes,
135141
}
136142
```
137143

138-
#### Standard Matrix Extentions
144+
#### Standard Matrix Extensions
139145
Finally, if a nonstandard matrix's name extends a current Matpower matrix name with an underscore, then its values will be merged with the original Matpower component data. Note that this feature requires that the nonstandard matrix has column names and has the same number of rows as the original matrix (similar to the `gencost` matrix in the Matpower format). For example,
140146
```
141147
%column_names% rate_i rate_p

README.md

+17
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,23 @@ run_opf("nesta_case3_lmbd.m", SOCWRPowerModel, IpoptSolver())
7171
Extending PowerModels with new problems and formulations will be covered in a another tutorial, that is not yet available.
7272

7373

74+
### Modifying Network Data
75+
76+
The follow example demonstrates how to modify the network data in Julia.
77+
78+
```
79+
network_data = PowerModels.parse_file("nesta_case3_lmbd.m")
80+
run_opf(network_data, ACPPowerModel, IpoptSolver())
81+
82+
network_data["bus"][3]["pd"] = 0.0
83+
network_data["bus"][3]["qd"] = 0.0
84+
85+
run_opf(network_data, ACPPowerModel, IpoptSolver())
86+
```
87+
88+
For additional details about the PowerModels network data structure see the DATA.md file.
89+
90+
7491
## Comparison to Other Tools
7592

7693
Forthcoming.

0 commit comments

Comments
 (0)