Skip to content

Commit

Permalink
Updates for JuMP's New NL Interface (#71)
Browse files Browse the repository at this point in the history
* updates for new nl interface
  • Loading branch information
ccoffrin authored Jan 19, 2024
1 parent 622c102 commit b7a8789
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
## Staged
- nothing

## v0.9.0
- Update to PowerModels v0.21 and JuMP's new nonlinear interface (breaking)

## v0.8.0
- Update to PowerModels v0.20 (breaking)
- Drop support for JuMP v0.22 and v0.23 (breaking)
Expand Down
6 changes: 3 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PowerModelsRestoration"
uuid = "23adbb12-a187-11e9-26a2-eb4d4e6e68fb"
authors = ["David M Fobes", "Noah Rhodes", "Carleton Coffrin"]
version = "0.8.0"
version = "0.9.0"

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

[compat]
InfrastructureModels = "~0.6, ~0.7"
JuMP = "~1"
JuMP = "1.15"
Memento = "~1.0, ~1.1, ~1.2, ~1.3, ~1.4"
PowerModels = "~0.20"
PowerModels = "~0.21"
julia = "1.6"

[extras]
Expand Down
4 changes: 2 additions & 2 deletions src/form/acp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function constraint_power_balance_shed(pm::_PM.AbstractACPModel, n::Int, i::Int,
z_shunt = get(_PM.var(pm, n), :z_shunt, Dict()); _PM._check_var_keys(z_shunt, keys(bus_gs), "power factor scale", "shunt")


_PM.con(pm, n, :kcl_p)[i] = JuMP.@NLconstraint(pm.model,
_PM.con(pm, n, :kcl_p)[i] = JuMP.@constraint(pm.model,
sum(p[a] for a in bus_arcs)
+ sum(p_dc[a_dc] for a_dc in bus_arcs_dc)
+ sum(psw[a_sw] for a_sw in bus_arcs_sw)
Expand All @@ -68,7 +68,7 @@ function constraint_power_balance_shed(pm::_PM.AbstractACPModel, n::Int, i::Int,
- sum(pd*z_demand[i] for (i,pd) in bus_pd)
- sum(gs*vm^2*z_shunt[i] for (i,gs) in bus_gs)
)
_PM.con(pm, n, :kcl_q)[i] = JuMP.@NLconstraint(pm.model,
_PM.con(pm, n, :kcl_q)[i] = JuMP.@constraint(pm.model,
sum(q[a] for a in bus_arcs)
+ sum(q_dc[a_dc] for a_dc in bus_arcs_dc)
+ sum(qsw[a_sw] for a_sw in bus_arcs_sw)
Expand Down

0 comments on commit b7a8789

Please sign in to comment.