Skip to content

Commit b7a8789

Browse files
authored
Updates for JuMP's New NL Interface (#71)
* updates for new nl interface
1 parent 622c102 commit b7a8789

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
## Staged
44
- nothing
55

6+
## v0.9.0
7+
- Update to PowerModels v0.21 and JuMP's new nonlinear interface (breaking)
8+
69
## v0.8.0
710
- Update to PowerModels v0.20 (breaking)
811
- Drop support for JuMP v0.22 and v0.23 (breaking)

Project.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "PowerModelsRestoration"
22
uuid = "23adbb12-a187-11e9-26a2-eb4d4e6e68fb"
33
authors = ["David M Fobes", "Noah Rhodes", "Carleton Coffrin"]
4-
version = "0.8.0"
4+
version = "0.9.0"
55

66
[deps]
77
InfrastructureModels = "2030c09a-7f63-5d83-885d-db604e0e9cc0"
@@ -11,9 +11,9 @@ PowerModels = "c36e90e8-916a-50a6-bd94-075b64ef4655"
1111

1212
[compat]
1313
InfrastructureModels = "~0.6, ~0.7"
14-
JuMP = "~1"
14+
JuMP = "1.15"
1515
Memento = "~1.0, ~1.1, ~1.2, ~1.3, ~1.4"
16-
PowerModels = "~0.20"
16+
PowerModels = "~0.21"
1717
julia = "1.6"
1818

1919
[extras]

src/form/acp.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function constraint_power_balance_shed(pm::_PM.AbstractACPModel, n::Int, i::Int,
5858
z_shunt = get(_PM.var(pm, n), :z_shunt, Dict()); _PM._check_var_keys(z_shunt, keys(bus_gs), "power factor scale", "shunt")
5959

6060

61-
_PM.con(pm, n, :kcl_p)[i] = JuMP.@NLconstraint(pm.model,
61+
_PM.con(pm, n, :kcl_p)[i] = JuMP.@constraint(pm.model,
6262
sum(p[a] for a in bus_arcs)
6363
+ sum(p_dc[a_dc] for a_dc in bus_arcs_dc)
6464
+ sum(psw[a_sw] for a_sw in bus_arcs_sw)
@@ -68,7 +68,7 @@ function constraint_power_balance_shed(pm::_PM.AbstractACPModel, n::Int, i::Int,
6868
- sum(pd*z_demand[i] for (i,pd) in bus_pd)
6969
- sum(gs*vm^2*z_shunt[i] for (i,gs) in bus_gs)
7070
)
71-
_PM.con(pm, n, :kcl_q)[i] = JuMP.@NLconstraint(pm.model,
71+
_PM.con(pm, n, :kcl_q)[i] = JuMP.@constraint(pm.model,
7272
sum(q[a] for a in bus_arcs)
7373
+ sum(q_dc[a_dc] for a_dc in bus_arcs_dc)
7474
+ sum(qsw[a_sw] for a_sw in bus_arcs_sw)

0 commit comments

Comments
 (0)