Skip to content

Commit

Permalink
Merge pull request #733 from lanl-ansi/bound-on-off
Browse files Browse the repository at this point in the history
Update to use Generic Bounds On/Off Constraint
  • Loading branch information
ccoffrin committed Jul 7, 2020
2 parents bc34e29 + 0ac2a6f commit 38f4609
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ PowerModels.jl Change Log
=========================

### Staged
- nothing

### v0.17.2
- Added support for ACR formulation with storage
- Added support for LPAC formulations of OTS and TNEP problems (#708) (thanks to @jay-dave)
- Added `windv*`, `nomv*` and `cw` values to `import_all` on PSS/E data files (#629)
- Strengthened checks for multi-network and multi-conductor in `run_model`
- Fixed conversions for transformer tap values in PSSE parser (#629)
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = "PowerModels"
uuid = "c36e90e8-916a-50a6-bd94-075b64ef4655"
authors = ["Carleton Coffrin"]
repo = "https://github.com/lanl-ansi/PowerModels.jl"
version = "0.17.1"
version = "0.17.2"

[deps]
InfrastructureModels = "2030c09a-7f63-5d83-885d-db604e0e9cc0"
Expand Down
6 changes: 0 additions & 6 deletions src/core/relaxation_scheme.jl
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,3 @@ function relaxation_cos_on_off(m, x, y, z, M_x)
JuMP.@constraint(m, y <= z - (1-cos(max_ad))/(max_ad^2)*(x^2) + (1-z)*((1-cos(max_ad))/(max_ad^2)*(M_x^2)))
end

function relaxation_variable_on_off(m, a, z)
a_lb, a_ub = _IM.variable_domain(a)
@assert (a_lb <= 0 && a_ub >= 0)
JuMP.@constraint(m, a <= z*a_ub)
JuMP.@constraint(m, a >= z*a_lb)
end
12 changes: 6 additions & 6 deletions src/form/lpac.jl
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,9 @@ function constraint_model_voltage_on_off(pm::AbstractLPACCModel, n::Int)
JuMP.@constraint(pm.model, t[i] - t[j] <= td[l] + td_ub*(1-z[l]))
relaxation_cos_on_off(pm.model, td[l], cs[l], z[l], td_max)

relaxation_variable_on_off(pm.model, td[l], z[l])
relaxation_variable_on_off(pm.model, phi_fr[l], z[l])
relaxation_variable_on_off(pm.model, phi_to[l], z[l])
_IM.constraint_bounds_on_off(pm.model, td[l], z[l])
_IM.constraint_bounds_on_off(pm.model, phi_fr[l], z[l])
_IM.constraint_bounds_on_off(pm.model, phi_to[l], z[l])
_IM.relaxation_equality_on_off(pm.model, phi[i], phi_fr[l], z[l])
_IM.relaxation_equality_on_off(pm.model, phi[j], phi_to[l], z[l])
end
Expand Down Expand Up @@ -298,9 +298,9 @@ function constraint_ne_model_voltage(pm::AbstractLPACCModel, n::Int)

relaxation_cos_on_off(pm.model, td_ne[l], cs_ne[l], z[l], td_max)

relaxation_variable_on_off(pm.model, phi_fr_ne[l], z[l])
relaxation_variable_on_off(pm.model, phi_to_ne[l], z[l])
relaxation_variable_on_off(pm.model, td_ne[l], z[l])
_IM.constraint_bounds_on_off(pm.model, phi_fr_ne[l], z[l])
_IM.constraint_bounds_on_off(pm.model, phi_to_ne[l], z[l])
_IM.constraint_bounds_on_off(pm.model, td_ne[l], z[l])

_IM.relaxation_equality_on_off(pm.model, phi[i], phi_fr_ne[l], z[l])
_IM.relaxation_equality_on_off(pm.model, phi[j], phi_to_ne[l], z[l])
Expand Down

0 comments on commit 38f4609

Please sign in to comment.