From 5791df0e54a2a001c0cfec60d2eb2cdb977c71ca Mon Sep 17 00:00:00 2001 From: David M Fobes Date: Tue, 18 Jan 2022 16:28:35 -0700 Subject: [PATCH] FIX: variable_mc_capcontrol kwargs was missing report and relax in each instance of variable_mc_capcontrol --- CHANGELOG.md | 4 ++++ Project.toml | 2 +- src/core/variable.jl | 4 +++- src/form/acp.jl | 6 +++--- src/form/acr.jl | 6 +++--- src/form/apo.jl | 2 +- src/form/bf_fbs.jl | 6 +++--- src/form/bf_mx_lin.jl | 8 ++++---- src/form/fotr.jl | 6 +++--- 9 files changed, 25 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf55860d0..e681535f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ - none +## v0.14.1 + +- Fix `variable_mc_capcontrol` keyword arguments + ## v0.14.0 - Drop support for JuMP < v0.22 diff --git a/Project.toml b/Project.toml index 272309e61..dea3fd157 100644 --- a/Project.toml +++ b/Project.toml @@ -2,7 +2,7 @@ name = "PowerModelsDistribution" uuid = "d7431456-977f-11e9-2de3-97ff7677985e" authors = ["David M Fobes ", "Carleton Coffrin"] repo = "https://github.com/lanl-ansi/PowerModelsDistribution.jl.git" -version = "0.14.0" +version = "0.14.1" [deps] CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" diff --git a/src/core/variable.jl b/src/core/variable.jl index 10e4d3f48..0876fc5b5 100644 --- a/src/core/variable.jl +++ b/src/core/variable.jl @@ -762,7 +762,7 @@ end Capacitor (with capcontrol) relaxed power variables for AbstractLPUBFModel (using McCormick envelopes) """ -function variable_mc_capacitor_reactive_power(pm::AbstractUnbalancedPowerModel; nw::Int=nw_id_default) +function variable_mc_capacitor_reactive_power(pm::AbstractUnbalancedPowerModel; nw::Int=nw_id_default, report::Bool=false) cap_switch_ids = [id for (id,cap) in ref(pm, nw, :shunt) if haskey(cap,"controls")] cap_reactive_power = var(pm, nw)[:capacitor_reactive_power] = Dict( i => JuMP.@variable( @@ -771,6 +771,8 @@ function variable_mc_capacitor_reactive_power(pm::AbstractUnbalancedPowerModel; base_name="$(nw)_cap_cur_$(i)", ) for i in cap_switch_ids ) + + report && _IM.sol_component_value(pm, pmd_it_sym, nw, :shunt, :capacitor_reactive_power, cap_switch_ids, cap_reactive_power) end diff --git a/src/form/acp.jl b/src/form/acp.jl index b045751cf..faed29d9f 100644 --- a/src/form/acp.jl +++ b/src/form/acp.jl @@ -69,12 +69,12 @@ end """ - variable_mc_capcontrol(pm::AbstractUnbalancedACPModel; nw::Int=nw_id_default, relax::Bool=false) + variable_mc_capcontrol(pm::AbstractUnbalancedACPModel; nw::Int=nw_id_default, relax::Bool=false, report::Bool=true) Capacitor switching variables. """ -function variable_mc_capcontrol(pm::AbstractUnbalancedACPModel; nw::Int=nw_id_default, relax::Bool=false) - variable_mc_capacitor_switch_state(pm; nw=nw, relax=relax) +function variable_mc_capcontrol(pm::AbstractUnbalancedACPModel; nw::Int=nw_id_default, relax::Bool=false, report::Bool=true) + variable_mc_capacitor_switch_state(pm; nw=nw, relax=relax, report=report) end diff --git a/src/form/acr.jl b/src/form/acr.jl index b8654a237..3fd1a20b8 100644 --- a/src/form/acr.jl +++ b/src/form/acr.jl @@ -108,12 +108,12 @@ end """ - variable_mc_capcontrol(pm::AbstractUnbalancedACRModel; nw::Int=nw_id_default, relax::Bool=false) + variable_mc_capcontrol(pm::AbstractUnbalancedACRModel; nw::Int=nw_id_default, relax::Bool=false, report::Bool=true) Capacitor switching variables. """ -function variable_mc_capcontrol(pm::AbstractUnbalancedACRModel; nw::Int=nw_id_default, relax::Bool=false) - variable_mc_capacitor_switch_state(pm; nw=nw, relax=relax) +function variable_mc_capcontrol(pm::AbstractUnbalancedACRModel; nw::Int=nw_id_default, relax::Bool=false, report::Bool=true) + variable_mc_capacitor_switch_state(pm; nw=nw, relax=relax, report=report) end diff --git a/src/form/apo.jl b/src/form/apo.jl index b54cbdd99..018c4d980 100644 --- a/src/form/apo.jl +++ b/src/form/apo.jl @@ -79,7 +79,7 @@ end "nothing to do, these models do not have complex voltage variables" -function variable_mc_capcontrol(pm::AbstractUnbalancedNFAModel; nw::Int=nw_id_default, bounded::Bool=true, report::Bool=true) +function variable_mc_capcontrol(pm::AbstractUnbalancedNFAModel; nw::Int=nw_id_default, relax::Bool=false, report::Bool=true) end diff --git a/src/form/bf_fbs.jl b/src/form/bf_fbs.jl index 25d6d3b98..5d9d99ff8 100644 --- a/src/form/bf_fbs.jl +++ b/src/form/bf_fbs.jl @@ -90,12 +90,12 @@ end """ - variable_mc_capcontrol(pm::FBSUBFPowerModel; nw::Int=nw_id_default, relax::Bool=false) + variable_mc_capcontrol(pm::FBSUBFPowerModel; nw::Int=nw_id_default, relax::Bool=false, report::Bool=true) Capacitor switching variables. """ -function variable_mc_capcontrol(pm::FBSUBFPowerModel; nw::Int=nw_id_default, relax::Bool=false) - variable_mc_capacitor_switch_state(pm; nw=nw, relax=relax) +function variable_mc_capcontrol(pm::FBSUBFPowerModel; nw::Int=nw_id_default, relax::Bool=false, report::Bool=true) + variable_mc_capacitor_switch_state(pm; nw=nw, relax=relax, report=report) end diff --git a/src/form/bf_mx_lin.jl b/src/form/bf_mx_lin.jl index 84c8c24d0..c6519aadc 100644 --- a/src/form/bf_mx_lin.jl +++ b/src/form/bf_mx_lin.jl @@ -22,13 +22,13 @@ end """ - variable_mc_capcontrol(pm::AbstractLPUBFModel; nw::Int=nw_id_default, relax::Bool=false) + variable_mc_capcontrol(pm::AbstractLPUBFModel; nw::Int=nw_id_default, relax::Bool=false, report::Bool=true) Capacitor switching and relaxed power variables. """ -function variable_mc_capcontrol(pm::AbstractLPUBFModel; nw::Int=nw_id_default, relax::Bool=false) - variable_mc_capacitor_switch_state(pm; nw=nw, relax=relax) - variable_mc_capacitor_reactive_power(pm; nw=nw) +function variable_mc_capcontrol(pm::AbstractLPUBFModel; nw::Int=nw_id_default, relax::Bool=false, report::Bool=true) + variable_mc_capacitor_switch_state(pm; nw=nw, relax=relax, report=report) + variable_mc_capacitor_reactive_power(pm; nw=nw, report=report) end diff --git a/src/form/fotr.jl b/src/form/fotr.jl index 7c0581ab4..63ae88942 100644 --- a/src/form/fotr.jl +++ b/src/form/fotr.jl @@ -58,12 +58,12 @@ end """ - variable_mc_capcontrol(pm::FOTRUPowerModel; nw::Int=nw_id_default, relax::Bool=false) + variable_mc_capcontrol(pm::FOTRUPowerModel; nw::Int=nw_id_default, relax::Bool=false, report::Bool=true) Capacitor switching variables. """ -function variable_mc_capcontrol(pm::FOTRUPowerModel; nw::Int=nw_id_default, relax::Bool=false) - variable_mc_capacitor_switch_state(pm; nw=nw, relax=relax) +function variable_mc_capcontrol(pm::FOTRUPowerModel; nw::Int=nw_id_default, relax::Bool=false, report::Bool=true) + variable_mc_capacitor_switch_state(pm; nw=nw, relax=relax, report=report) end