Skip to content

Commit 12d560e

Browse files
ccoffrinGeth, Frederik (Energy, Newcastle)
andauthored
Updates for PowerModels v0.17 (#702)
* Rename Problem Modeling Functions (#700) * update constraint names * update variable function names * update expression function names update details are documented in issue #701 * update docs for new function names * minor updates for InfrastructureModels v0.5 * Fix reactive power control in storage systems (#699) Co-authored-by: Geth, Frederik (Energy, Newcastle) <[email protected]> Co-authored-by: Carleton Coffrin <[email protected]>
1 parent 558bfdf commit 12d560e

36 files changed

+658
-758
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ PowerModels.jl Change Log
44
### Staged
55
- nothing
66

7+
### v0.17.0
8+
- Updated to new function name convention, details in issue #701 (#555,#656) (breaking)
9+
- Update to InfrastructureModels v0.5 (breaking)
10+
- Added support for Memento v1.1
11+
- Fixed storage reactive power dispatch model, added reactive power control variable (breaking)
12+
713
### v0.16.0
814
- Added a native AC Power Flow solver in polar coordinates that uses NLSolve (#590)
915
- Added `ismulticonductor` check on data models
@@ -13,7 +19,7 @@ PowerModels.jl Change Log
1319
- Updated `correct_bus_types!` to correct slack buses and focus on preparation for power flow studies (breaking)
1420
- Updated ref extensions API to use ref and data dictionaries, not power model types (#668) (breaking)
1521
- Replaced `propagate_topology_status!` with `simplify_network!` (breaking)
16-
- Moved isolated component removal from `propagate_topology_status!` into `deactivate_isolated_components!` (#677) (breaking)
22+
- Moved isolated component removal into `deactivate_isolated_components!` (#677) (breaking)
1723
- Removed InitializePowerModel and instantiate_model to use InfratructureModels versions (breaking)
1824
- Removed export of some functions defined in InfratructureModels (breaking)
1925
- Removed branch flow variables from generic Power Flow problem specification (breaking)

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
1616

1717
[compat]
1818
Cbc = ">= 0.4"
19-
InfrastructureModels = "~0.4.3"
19+
InfrastructureModels = "~0.5"
2020
Ipopt = ">= 0.4"
2121
JSON = "~0.18, ~0.19, ~0.20, ~0.21"
2222
JuMP = "~0.19.1, ~0.20, ~0.21"
2323
Juniper = ">= 0.4"
2424
MathOptInterface = "~0.8, ~0.9"
25-
Memento = "~0.10, ~0.11, ~0.12, ~0.13, ~1.0"
25+
Memento = "~0.10, ~0.11, ~0.12, ~0.13, ~1.0, ~1.1"
2626
NLsolve = "4.0"
2727
SCS = ">= 0.6.3"
2828
julia = "^1"

docs/src/constraints.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ These templates should be defined over `AbstractPowerModel` and should not refer
1414
```@docs
1515
constraint_model_voltage
1616
constraint_model_voltage_on_off
17-
constraint_model_voltage_ne
17+
constraint_ne_model_voltage
1818
```
1919

2020
## Generator Constraints
2121

2222
```@docs
23-
constraint_active_gen_setpoint
24-
constraint_reactive_gen_setpoint
23+
constraint_gen_setpoint_active
24+
constraint_gen_setpoint_reactive
2525
```
2626

2727
## Bus Constraints
@@ -38,7 +38,7 @@ constraint_voltage_magnitude_setpoint
3838
```@docs
3939
constraint_power_balance
4040
constraint_power_balance_ls
41-
constraint_power_balance_ne
41+
constraint_ne_power_balance
4242
```
4343

4444
## Branch Constraints
@@ -57,8 +57,8 @@ constraint_ohms_y_to
5757
```@docs
5858
constraint_ohms_yt_from_on_off
5959
constraint_ohms_yt_to_on_off
60-
constraint_ohms_yt_from_ne
61-
constraint_ohms_yt_to_ne
60+
constraint_ne_ohms_yt_from
61+
constraint_ne_ohms_yt_to
6262
```
6363

6464
### Current
@@ -77,8 +77,8 @@ constraint_thermal_limit_from
7777
constraint_thermal_limit_to
7878
constraint_thermal_limit_from_on_off
7979
constraint_thermal_limit_to_on_off
80-
constraint_thermal_limit_from_ne
81-
constraint_thermal_limit_to_ne
80+
constraint_ne_thermal_limit_from
81+
constraint_ne_thermal_limit_to
8282
```
8383

8484
### Current Limit Constraints
@@ -92,14 +92,14 @@ constraint_current_limit
9292
```@docs
9393
constraint_voltage_angle_difference
9494
constraint_voltage_angle_difference_on_off
95-
constraint_voltage_angle_difference_ne
95+
constraint_ne_voltage_angle_difference
9696
```
9797

9898
### Loss Constraints
9999

100100
```@docs
101-
constraint_loss_lb
102-
constraint_flow_losses
101+
constraint_power_losses
102+
constraint_power_losses_lb
103103
constraint_voltage_magnitude_difference
104104
```
105105

@@ -110,14 +110,14 @@ constraint_storage_thermal_limit
110110
constraint_storage_current_limit
111111
constraint_storage_complementarity_nl
112112
constraint_storage_complementarity_mi
113-
constraint_storage_loss
113+
constraint_storage_losses
114114
constraint_storage_state_initial
115115
constraint_storage_state
116116
```
117117

118118
## DC Line Constraints
119119

120120
```@docs
121-
constraint_dcline
122-
constraint_active_dcline_setpoint
121+
constraint_dcline_power_losses
122+
constraint_dcline_setpoint_active
123123
```

docs/src/developer.md

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,45 @@ scope functions). Underscores are used to separate multi-word function names
99
and the words should typically be ordered from general to more specific,
1010
so that alphabetical sorting clusters similar functions together.
1111

12+
Due to model-agnostic design of PowerModels, top level functions are implicitly defined on complex numbers. Specializations of these functions yield different complex coordinates systems and real-valued model parameters.
1213

13-
## Variable and Parameter Naming Guidelines
14+
Top level functions have the following structure,
15+
```
16+
<variable|constraint>_<component short name>_<quantity name>(_fr|_to)(_on_off)
17+
```
18+
The suffixes have the following meanings,
19+
- `_fr`: the from-side of a two-terminal component (e.g., branch or switch)
20+
- `_to`: the to-side of a two-terminal component (e.g., branch or switch)
21+
- `_on_off`: indicates that the constraint can be added or removed with a discrete 0-1 indicator variable.
22+
Note that the from-to orientation of two-terminal components is often arbitrary and does not imply a direction of flow.
23+
24+
The most common values of `<quantity name>` are `power`, `current` and `voltage`. Compound names like `voltage_product` are also possible.
1425

15-
### Suffixes
1626

17-
- `_fr`: from-side ('i'-node)
18-
- `_to`: to-side ('j'-node)
27+
Lower level functions have the following structure,
28+
```
29+
<variable|constraint>_<component short name>_<quantity name>
30+
(_real|_imaginary|_magnitude|_angle|_factor)(_fr|_to)(_sqr)(_on_off)
31+
```
32+
The additional suffixes have the following meanings,
33+
- `_real`: the real component of a complex value in rectangular coordinates
34+
- `_imaginary`: the imaginary component of a complex value in rectangular coordinates
35+
- `_magnitude`: the magnitude of a complex value in polar coordinates
36+
- `_angle`: the angle of a complex value in polar coordinates
37+
- `_factor`: a continuous real value (usually in the range 0.0 to 1.0), that scales a complex value in equal proportions
38+
- `_sqr`: the square of a value, usually paired with `_magnitude`
39+
40+
41+
### Special Cases
42+
43+
In the interest of intuitive names for users, the following special cases are also acceptable,
44+
45+
- The value of `<component short name>` can be omitted from constraint definitions for one of the canonical components that it applies to.
46+
- `_power_real` -(can be replaced with)-> `_active`
47+
- `_power_imaginary` -(can be replaced with)-> `_reactive`
48+
49+
50+
## Variable and Parameter Naming Guidelines
1951

2052
### Power
2153

@@ -90,7 +122,7 @@ $y = g + j\cdot b$:
90122
- phase ids: `phase`, `ph`, `h`
91123

92124

93-
## DistFlow derivation
125+
## DistFlow Derivation
94126

95127
### For an asymmetric pi section
96128
Following notation of [^1], but recognizing it derives the SOC BFM without shunts.

docs/src/formulations.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ QCRMPowerModel <: AbstractWRForm
2525
SOCBFPowerModel <: AbstractSOCBFModel
2626
```
2727

28-
For details on `AbstractPowerModel`, see the section on [Power Model](@ref).
28+
For details on `AbstractPowerModel`, see the section on [Power Model](@ref). A more comprehensive list of supported formulation is documented in [Formulation Details](@ref).
2929

3030
## User-Defined Abstractions
3131

32-
Consider the class of conic Models for power flow models. One way of modelling them in this package is through the following type hierarchy:
32+
Consider the class of conic Models for power flow models. One way of modeling them in this package is through the following type hierarchy:
3333
```julia
3434
AbstractConicPowerModel <: AbstractPowerModel
3535
AbstractWRMModel <: AbstractConicPowerModel

0 commit comments

Comments
 (0)