diff --git a/CHANGELOG.md b/CHANGELOG.md index eaeb6fd2..06b3f94b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ PowerModels.jl Change Log ### v0.19.10 - Add support for ACP and DCP formulation in OPF with PST variables (#543,#875) - Fix implementation of `calc_theta_delta_bounds` when conductor parameter is used (#870) +- Update tests for SCS v2.0 ### v0.19.9 - Fix implementation of polynomial costs above quadratic diff --git a/Project.toml b/Project.toml index 281db515..7affbdaf 100644 --- a/Project.toml +++ b/Project.toml @@ -22,7 +22,7 @@ JuMP = "~0.22, ~0.23, 1" Juniper = "~0.8, ~0.9" Memento = "~1.0, ~1.1, ~1.2, ~1.3, ~1.4" NLsolve = "4.0" -SCS = "~0.9, ~1.0" +SCS = "~0.9, ~1.0, ~2.0" julia = "1.6" [extras] diff --git a/test/opf-var.jl b/test/opf-var.jl index c7537cc4..154fdfcc 100644 --- a/test/opf-var.jl +++ b/test/opf-var.jl @@ -127,8 +127,8 @@ end result = PowerModels._solve_opf_cl(data, SDPWRMPowerModel, sdp_solver) @test result["termination_status"] == OPTIMAL - @test isapprox(result["objective"], 5728.62; atol = 1e0) - #@test isapprox(result["objective"], 5747.63; atol = 1e0) + #@test isapprox(result["objective"], 5728.62; atol = 1e0) + @test isapprox(result["objective"], 5747.63; atol = 1e0) end @testset "5-bus case" begin data = build_current_data("../test/data/matpower/case5.m") diff --git a/test/opf.jl b/test/opf.jl index 5f8419ba..ed24811d 100644 --- a/test/opf.jl +++ b/test/opf.jl @@ -590,8 +590,8 @@ end result = run_opf("../test/data/matpower/case3.m", SOCWRConicPowerModel, sdp_solver) @test result["termination_status"] == OPTIMAL - @test isapprox(result["objective"], 5736.94; atol = 2e0) - #@test isapprox(result["objective"], 5747.37; atol = 2e0) + #@test isapprox(result["objective"], 5736.94; atol = 2e0) + @test isapprox(result["objective"], 5747.37; atol = 2e0) end @testset "5-bus transformer swap case" begin result = run_opf("../test/data/matpower/case5.m", SOCWRConicPowerModel, sdp_solver) @@ -621,31 +621,31 @@ end result = run_opf("../test/data/matpower/case5_npg.m", SOCWRConicPowerModel, sdp_solver) @test result["termination_status"] == OPTIMAL - @test isapprox(result["objective"], 3551.71; atol = 40) - #@test isapprox(result["objective"], 3602.11; atol = 40) + #@test isapprox(result["objective"], 3551.71; atol = 40) + @test isapprox(result["objective"], 3602.11; atol = 40) end @testset "5-bus with pwl costs" begin result = run_opf("../test/data/matpower/case5_pwlc.m", SOCWRConicPowerModel, sdp_solver) @test result["termination_status"] == OPTIMAL - @test isapprox(result["objective"], 42889; atol = 1e0) - #@test isapprox(result["objective"], 42906; atol = 1e0) + #@test isapprox(result["objective"], 42889; atol = 1e0) + @test isapprox(result["objective"], 42906; atol = 1e0) end @testset "6-bus case" begin result = run_opf("../test/data/matpower/case6.m", SOCWRConicPowerModel, sdp_solver) @test result["termination_status"] == OPTIMAL #@test isapprox(result["objective"], 11472.2; atol = 3e0) - @test isapprox(result["objective"], 11451.5; atol = 3e0) - #@test isapprox(result["objective"], 11473.4; atol = 3e0) + #@test isapprox(result["objective"], 11451.5; atol = 3e0) + @test isapprox(result["objective"], 11473.4; atol = 3e0) end @testset "24-bus rts case" begin result = run_opf("../test/data/matpower/case24.m", SOCWRConicPowerModel, sdp_solver) @test result["termination_status"] == OPTIMAL #@test isapprox(result["objective"], 70693.9; atol = 1e0) - @test isapprox(result["objective"], 70670.0; atol = 1e0) - #@test isapprox(result["objective"], 70683.5; atol = 1e0) + #@test isapprox(result["objective"], 70670.0; atol = 1e0) + @test isapprox(result["objective"], 70683.5; atol = 1e0) end @testset "14-bus variable bounds" begin pm = instantiate_model("../test/data/matpower/case14.m", SOCWRConicPowerModel, PowerModels.build_opf) @@ -906,14 +906,16 @@ end result = run_opf("../test/data/matpower/case3.m", SDPWRMPowerModel, sdp_solver) @test result["termination_status"] == OPTIMAL - @test isapprox(result["objective"], 5818.00; atol = 1e1) - #@test isapprox(result["objective"], 5852.51; atol = 1e1) + #@test isapprox(result["objective"], 5818.00; atol = 1e1) + @test isapprox(result["objective"], 5852.51; atol = 1e1) @test haskey(result["solution"],"WR") @test haskey(result["solution"],"WI") - @test isapprox(result["solution"]["bus"]["1"]["w"], 1.179, atol = 1e-2) + #@test isapprox(result["solution"]["bus"]["1"]["w"], 1.179, atol = 1e-2) + @test isapprox(result["solution"]["bus"]["1"]["w"], 1.209, atol = 1e-2) @test isapprox(result["solution"]["branch"]["1"]["wr"], 0.941, atol = 1e-2) - @test isapprox(result["solution"]["branch"]["1"]["wi"], 0.269, atol = 1e-2) + #@test isapprox(result["solution"]["branch"]["1"]["wi"], 0.269, atol = 1e-2) + @test isapprox(result["solution"]["branch"]["1"]["wi"], 0.284, atol = 1e-2) end @testset "5-bus asymmetric case" begin result = run_opf("../test/data/matpower/case5_asym.m", SDPWRMPowerModel, sdp_solver) @@ -938,8 +940,8 @@ end @test result["termination_status"] == OPTIMAL #@test isapprox(result["objective"], 6827.34; atol = 1e0) - @test isapprox(result["objective"], 6735.17; atol = 1e0) - #@test isapprox(result["objective"], 6827.71; atol = 1e0) + #@test isapprox(result["objective"], 6735.17; atol = 1e0) + @test isapprox(result["objective"], 6827.71; atol = 1e0) end # too slow for unit tests # @testset "14-bus case" begin @@ -953,8 +955,8 @@ end @test result["termination_status"] == OPTIMAL #@test isapprox(result["objective"], 11580.8; atol = 1e1) - @test isapprox(result["objective"], 11507.7; atol = 1e1) - #@test isapprox(result["objective"], 11580.5; atol = 1e1) + #@test isapprox(result["objective"], 11507.7; atol = 1e1) + @test isapprox(result["objective"], 11580.5; atol = 1e1) end @testset "14-bus variable bounds" begin pm = instantiate_model("../test/data/matpower/case14.m", SDPWRMPowerModel, PowerModels.build_opf) @@ -969,14 +971,16 @@ end @test result["termination_status"] == OPTIMAL #@test isapprox(result["objective"], 5851.23; atol = 1e1) - @test isapprox(result["objective"], 5818.00; atol = 1e1) - #@test isapprox(result["objective"], 5852.51; atol = 1e1) + #@test isapprox(result["objective"], 5818.00; atol = 1e1) + @test isapprox(result["objective"], 5852.51; atol = 1e1) @test haskey(result["solution"]["w_group"]["1"],"WR") @test haskey(result["solution"]["w_group"]["1"],"WI") - @test isapprox(result["solution"]["bus"]["1"]["w"], 1.179, atol = 1e-2) + #@test isapprox(result["solution"]["bus"]["1"]["w"], 1.179, atol = 1e-2) + @test isapprox(result["solution"]["bus"]["1"]["w"], 1.209, atol = 1e-2) @test isapprox(result["solution"]["branch"]["1"]["wr"], 0.941, atol = 1e-2) - @test isapprox(result["solution"]["branch"]["1"]["wi"], 0.269, atol = 1e-2) + #@test isapprox(result["solution"]["branch"]["1"]["wi"], 0.269, atol = 1e-2) + @test isapprox(result["solution"]["branch"]["1"]["wi"], 0.284, atol = 1e-2) end @testset "5-bus with asymmetric line charge" begin result = run_opf("../test/data/pti/case5_alc.raw", SparseSDPWRMPowerModel, sdp_solver)