From d3d23bba6d830edc19feb6b06bf7bec434cb3432 Mon Sep 17 00:00:00 2001 From: Kaarthik Sundar Date: Wed, 15 Nov 2017 16:13:44 -0700 Subject: [PATCH] QC-OTS tests and changelog (#196) * Bug fix on QC-OTS formulation ``relaxation_product_on_off(pm.model, vm_fr[i], vm_to[j], vv[l], z[l])`` to ``relaxation_product_on_off(pm.model, vm_fr[l], vm_to[l], vv[l], z[l])`` --- CHANGELOG.md | 1 + src/form/wr.jl | 2 +- test/ots.jl | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48711f4e9..1203a03ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ PowerModels.jl Change Log ================= ### Staged +- Fixed bug in QC-OTS formulation - Added lambda-based convex hull relaxation scheme for trilinear products - Added QCWRTri Power Flow formulation diff --git a/src/form/wr.jl b/src/form/wr.jl index 3cb03a760..f86fe5905 100644 --- a/src/form/wr.jl +++ b/src/form/wr.jl @@ -687,7 +687,7 @@ function constraint_voltage_on_off{T <: QCWRForm}(pm::GenericPowerModel{T}, n::I relaxation_sin_on_off(pm.model, td[l], si[l], z[l], td_max) relaxation_cos_on_off(pm.model, td[l], cs[l], z[l], td_max) - relaxation_product_on_off(pm.model, vm_fr[i], vm_to[j], vv[l], z[l]) + relaxation_product_on_off(pm.model, vm_fr[l], vm_to[l], vv[l], z[l]) relaxation_product_on_off(pm.model, vv[l], cs[l], wr[l], z[l]) relaxation_product_on_off(pm.model, vv[l], si[l], wi[l], z[l]) diff --git a/test/ots.jl b/test/ots.jl index fde5fbfb0..a96ead293 100644 --- a/test/ots.jl +++ b/test/ots.jl @@ -139,7 +139,7 @@ end check_br_status(result["solution"]) @test result["status"] == :Optimal - @test isapprox(result["objective"], 15001.6; atol = 1e0) + @test isapprox(result["objective"], 14999.7; atol = 1e0) end @testset "5-bus asymmetric case" begin result = run_ots("../test/data/case5_asym.m", QCWRPowerModel, pajarito_solver) @@ -147,7 +147,7 @@ end check_br_status(result["solution"]) @test result["status"] == :Optimal - @test isapprox(result["objective"], 15009.4; atol = 1e0) + @test isapprox(result["objective"], 14999.7; atol = 1e0) end @testset "6-bus case" begin result = run_ots("../test/data/case6.m", QCWRPowerModel, pajarito_solver)