Skip to content

Commit 5c71d52

Browse files
authored
Merge pull request #21 from LAMPSPUC/develop
PWF 0.1.0
2 parents 83695aa + 314c91d commit 5c71d52

35 files changed

+585
-444
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ jobs:
1515
- version: "1"
1616
os: ubuntu-latest
1717
arch: x64
18-
- version: "1.0"
19-
os: ubuntu-latest
20-
arch: x64
2118
steps:
2219
- uses: actions/checkout@v2
2320
- uses: julia-actions/setup-julia@v1

Project.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
name = "PWF"
22
uuid = "0f4c3beb-4231-4c4d-93e1-709cb40a89e6"
3-
version = "0.0.1"
3+
version = "0.1.0"
44

55
[deps]
6+
Memento = "f28f55f0-a522-5efc-85c2-fe41dfb9b2d9"
67
PowerModels = "c36e90e8-916a-50a6-bd94-075b64ef4655"
78

89
[compat]
9-
PowerModels = "0.18"
10-
julia = "1"
10+
PowerModels = "~0.18, ~0.19"
11+
julia = "^1"
1112

1213
[extras]
1314
Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9"

README.md

Lines changed: 56 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -14,37 +14,46 @@ The implementations were made based on the ANAREDE user guide manual (v09).
1414

1515
**Quickstart**
1616

17-
Parsing a .pwf file to Julia dictionary is as simple as:
17+
Until the creating of PWF.jl, '.pwf' files could only be parsed through Brazilian commercial softwares, such as ANAREDE and Organon. Therefore, the Brazilian Power System community was compelled to use one of the two solutions to run Power Flow analysis.
1818

19-
```julia
20-
using PWF
19+
PWF.jl unlocks the power of open-source to the Power System community. Therefore, now, anyone can read the standard Brazilian file ('.pwf') and run steady-state electrical analysis with state-of-the-art methodologies. For the Power Flow algorithm, we encourage the usage of the package PowerModels.jl, which already have integration with the PWF.jl package.
2120

22-
file = "3bus.pwf"
23-
pwf_dict = parse_file(file)
24-
```
21+
To perform Power Flow analysis using PWF.jl in Julia, follow the steps bellow:
22+
23+
1. First of all, make sure you have [Visual Studio Code](https://code.visualstudio.com/) and [Julia Language](https://julialang.org/downloads/) Long-term support (LTS) 1.6.6 configured correctly;
2524

26-
Converting the .pwf file into PowerModels.jl network data dictionary:
25+
2. Then, add PWF.jl and PowerModels.jl to the known packages;
2726

2827
```julia
29-
network_data = parse_file(file; pm = true)
28+
using Pkg
29+
30+
Pkg.add("PWF")
31+
Pkg.add("PowerModels")
3032
```
3133

32-
Then you are ready to use PowerModels!
34+
3. Finally, you are ready to perform power flow analysis
3335

3436
```julia
35-
using PowerModels, Ipopt
37+
using PWF, PowerModels
38+
39+
network_path = "network.pwf"
3640

37-
run_ac_pf(network_data, Ipopt.Optimizer)
41+
network = PWF.parse_file(network_path)
42+
43+
results = PowerModels.run_ac_pf(network)
44+
45+
results["solution"]["bus"]["1"]["vm"] # folution for voltage magniture of bus 1
46+
results["solution"]["bus"]["1"]["va"] # solution for voltage angle of bus 1
3847
```
3948

4049
For more information about PowerModels.jl visit the PowerModels [documentation](https://lanl-ansi.github.io/PowerModels.jl/stable/)
4150

4251
## Parser
4352

44-
The package parses all available sections into a julia dictionary. Each key represents a .pwf section as shown below:
53+
The package can parse all available sections into a julia dictionary withou any modifications. Each key represents a .pwf section as shown below:
4554

4655
```julia
47-
julia> PWF.parse_file(file)
56+
julia> parse_file(file; pm = false)
4857
Dict{String, Any} with 6 entries:
4958
"DLIN" => Dict{String, Any}[Dict("AGGREGATOR 10"=>nothing, "AGGREGATOR 5"=>nothing, "AGGR"
5059
"name" => "3bus"
@@ -54,42 +63,12 @@ Dict{String, Any} with 6 entries:
5463
"DOPC" => Dict{String, Any}("CONT"=>'L', "CELO"=>'L' "MOST"=>'L', "MOSF"=>'L', "RCVG"=>'
5564
```
5665
57-
**PWF Sections Available:**
58-
59-
- DBAR
60-
- DBSH
61-
- DCBA
62-
- DCCV
63-
- DCER
64-
- DCLI
65-
- DCNV
66-
- DCSC
67-
- DCTE
68-
- DELO
69-
- DGBT
70-
- DGER
71-
- DGLT
72-
- DLIN
73-
- DOPC
74-
- DSHL
75-
- DARE
76-
- DCAI
77-
- DCAR
78-
- DGEI
79-
- DINJ
80-
- DMFL
81-
- DMOT
82-
- DMTE
83-
- DAGR
84-
- DCMT
85-
- DTPF
86-
8766
## PowerModels.jl converter
8867
8968
The package also allow converting .pwf file directly into PowerModels.jl network data structure:
9069
9170
```julia
92-
julia> PWF.parse_file(file; pm = true)
71+
julia> parse_file(file; pm = true) # default
9372
Dict{String, Any} with 13 entries:
9473
"bus" => Dict{String, Any}("1"=>Dict{String, Any}("zone"=>1, "bus_i"=>1, "bus_"…
9574
"source_type" => "pwf"
@@ -126,17 +105,17 @@ There are two main softwares used for parsing PWF files and each one does slight
126105
127106
```julia
128107
129-
julia> data = parse_file(file; pm = true, software = ANAREDE)
108+
julia> data = parse_file(file; pm = true, software = ANAREDE) # default
130109
131110
julia> data = parse_file(file; pm = true, software = Organon)
132111
```
133112
134113
**Additional data inside PWF files**
135114
136-
If parse_pwf_to_powermodels' argument add_control_data is set to true (default = false), additional information present on the PWF file that is not used by PowerModels will be stored inside each element in the field "control_data", such as the example below:
115+
If parse_file' argument add_control_data is set to true (default = false), additional information present on the PWF file that is not used by PowerModels will be stored inside each element in the field "control_data", such as the example below:
137116

138117
```julia
139-
julia> data = PWF.parse_pwf_to_powermodels(file, add_control_data = true);
118+
julia> data = parse_file(file, pm = true, add_control_data = true);
140119
141120
julia> data["shunt"]["1"]["control_data"]
142121
Dict{String, Any} with 9 entries:
@@ -151,6 +130,36 @@ Dict{String, Any} with 9 entries:
151130
"controlled_bus" => 1
152131
```
153132

133+
**PWF Sections Available:**
134+
135+
- DBAR
136+
- DBSH
137+
- DCBA
138+
- DCCV
139+
- DCER
140+
- DCLI
141+
- DCNV
142+
- DCSC
143+
- DCTE
144+
- DELO
145+
- DGBT
146+
- DGER
147+
- DGLT
148+
- DLIN
149+
- DOPC
150+
- DSHL
151+
- DARE
152+
- DCAI
153+
- DCAR
154+
- DGEI
155+
- DINJ
156+
- DMFL
157+
- DMOT
158+
- DMTE
159+
- DAGR
160+
- DCMT
161+
- DTPF
162+
154163
## Contributing
155164

156165
- PRs such as adding new sections and fixing bugs are very welcome!

docs/src/dbar.md

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,35 @@
11
# DBAR
2+
23
## Description
4+
35
This section includes general information about AC buses, in columns described as follows:
6+
47
## Usage
5-
Column | Description
6-
--- | ---
7-
Number | Bus identification number
8-
Operation | Bus addition, removal or modification
9-
Status | Bus status - on or off
10-
Type | Bus type - PQ, PV or swing
11-
Base voltage group | Bus voltage group identifier, defined in DGBT section. If there is no such section or the group is not defined there, base voltage will be set to 1.0 kv
12-
Name | Bus alphanumeric identification
13-
Voltage limit group | Bus voltage bounds group identifier, defined in DGLT section. If there is no such section or the group is not defined there, bounds will be set to 0.9 and 1.1.
14-
Voltage | Initial voltage (per unit)
15-
Angle | Initial phase angle (degrees)
16-
Active generation | Bus active generation (MW)
17-
Reactive generation | Bus reactive generation (Mvar)
18-
Minimum reactive generation | Lower bound for bus reative generation (Mvar)
19-
Maximum reactive generation | Upper bound for bus reative generation (Mvar)
20-
Controlled bus | Bus which voltage magnitude will be controlled as defined in Voltage field
21-
Active charge | Bus active charge (MW)
22-
Reactive charge | Bus reactive charge (Mvar)
23-
Total reactive power | Total injected power by capacitor reactor banks; Positive value for capacitor and negative for reactors
24-
Area | Number of area which the bus is a part of
25-
Charge definition voltage | Voltage in which active and reactive charge were measured
26-
Visualization mode | Bus visualization in ANAREDE software
27-
Aggregator 1-10 | Additional information
8+
9+
| Column | Description |
10+
| --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
11+
| Number | Bus identification number |
12+
| Operation | Bus addition, removal or modification |
13+
| Status | Bus status - on or off |
14+
| Type | Bus type - PQ, PV or swing |
15+
| Base voltage group | Bus voltage group identifier, defined in DGBT section. If there is no such section or the group is not defined there, base voltage will be set to 1.0 kv |
16+
| Name | Bus alphanumeric identification |
17+
| Voltage limit group | Bus voltage bounds group identifier, defined in DGLT section. If there is no such section or the group is not defined there, bounds will be set to 0.9 and 1.1. |
18+
| Voltage | Initial voltage (per unit) |
19+
| Angle | Initial phase angle (degrees) |
20+
| Active generation | Bus active generation (MW) |
21+
| Reactive generation | Bus reactive generation (Mvar) |
22+
| Minimum reactive generation | Lower bound for bus reative generation (Mvar) |
23+
| Maximum reactive generation | Upper bound for bus reative generation (Mvar) |
24+
| Controlled bus | Bus which voltage magnitude will be controlled as defined in Voltage field |
25+
| Active charge | Bus active charge (MW) |
26+
| Reactive charge | Bus reactive charge (Mvar) |
27+
| Total reactive power | Total injected power by capacitor reactor banks; Positive value for capacitor and negative for reactors |
28+
| Area | Number of area which the bus is a part of |
29+
| Charge definition voltage | Voltage in which active and reactive charge were measured |
30+
| Visualization mode | Bus visualization in ANAREDE software |
31+
| Aggregator 1-10 | Additional information |
32+
2833
## Example
29-
![Alt text](assets/DBAR.png)
34+
35+
![Alt text](docs/assets/DBAR.png)

0 commit comments

Comments
 (0)