Skip to content

Commit 010b6ee

Browse files
authored
Updates for SCS v2.0 (#898)
* allow scs v2 * update tests for scs v2.0
1 parent fd9f63d commit 010b6ee

File tree

4 files changed

+30
-25
lines changed

4 files changed

+30
-25
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ PowerModels.jl Change Log
77
### v0.19.10
88
- Add support for ACP and DCP formulation in OPF with PST variables (#543,#875)
99
- Fix implementation of `calc_theta_delta_bounds` when conductor parameter is used (#870)
10+
- Update tests for SCS v2.0
1011

1112
### v0.19.9
1213
- Fix implementation of polynomial costs above quadratic

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ JuMP = "~0.22, ~0.23, 1"
2222
Juniper = "~0.8, ~0.9"
2323
Memento = "~1.0, ~1.1, ~1.2, ~1.3, ~1.4"
2424
NLsolve = "4.0"
25-
SCS = "~0.9, ~1.0"
25+
SCS = "~0.9, ~1.0, ~2.0"
2626
julia = "1.6"
2727

2828
[extras]

test/opf-var.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ end
127127
result = PowerModels._solve_opf_cl(data, SDPWRMPowerModel, sdp_solver)
128128

129129
@test result["termination_status"] == OPTIMAL
130-
@test isapprox(result["objective"], 5728.62; atol = 1e0)
131-
#@test isapprox(result["objective"], 5747.63; atol = 1e0)
130+
#@test isapprox(result["objective"], 5728.62; atol = 1e0)
131+
@test isapprox(result["objective"], 5747.63; atol = 1e0)
132132
end
133133
@testset "5-bus case" begin
134134
data = build_current_data("../test/data/matpower/case5.m")

test/opf.jl

+26-22
Original file line numberDiff line numberDiff line change
@@ -590,8 +590,8 @@ end
590590
result = run_opf("../test/data/matpower/case3.m", SOCWRConicPowerModel, sdp_solver)
591591

592592
@test result["termination_status"] == OPTIMAL
593-
@test isapprox(result["objective"], 5736.94; atol = 2e0)
594-
#@test isapprox(result["objective"], 5747.37; atol = 2e0)
593+
#@test isapprox(result["objective"], 5736.94; atol = 2e0)
594+
@test isapprox(result["objective"], 5747.37; atol = 2e0)
595595
end
596596
@testset "5-bus transformer swap case" begin
597597
result = run_opf("../test/data/matpower/case5.m", SOCWRConicPowerModel, sdp_solver)
@@ -621,31 +621,31 @@ end
621621
result = run_opf("../test/data/matpower/case5_npg.m", SOCWRConicPowerModel, sdp_solver)
622622

623623
@test result["termination_status"] == OPTIMAL
624-
@test isapprox(result["objective"], 3551.71; atol = 40)
625-
#@test isapprox(result["objective"], 3602.11; atol = 40)
624+
#@test isapprox(result["objective"], 3551.71; atol = 40)
625+
@test isapprox(result["objective"], 3602.11; atol = 40)
626626
end
627627
@testset "5-bus with pwl costs" begin
628628
result = run_opf("../test/data/matpower/case5_pwlc.m", SOCWRConicPowerModel, sdp_solver)
629629

630630
@test result["termination_status"] == OPTIMAL
631-
@test isapprox(result["objective"], 42889; atol = 1e0)
632-
#@test isapprox(result["objective"], 42906; atol = 1e0)
631+
#@test isapprox(result["objective"], 42889; atol = 1e0)
632+
@test isapprox(result["objective"], 42906; atol = 1e0)
633633
end
634634
@testset "6-bus case" begin
635635
result = run_opf("../test/data/matpower/case6.m", SOCWRConicPowerModel, sdp_solver)
636636

637637
@test result["termination_status"] == OPTIMAL
638638
#@test isapprox(result["objective"], 11472.2; atol = 3e0)
639-
@test isapprox(result["objective"], 11451.5; atol = 3e0)
640-
#@test isapprox(result["objective"], 11473.4; atol = 3e0)
639+
#@test isapprox(result["objective"], 11451.5; atol = 3e0)
640+
@test isapprox(result["objective"], 11473.4; atol = 3e0)
641641
end
642642
@testset "24-bus rts case" begin
643643
result = run_opf("../test/data/matpower/case24.m", SOCWRConicPowerModel, sdp_solver)
644644

645645
@test result["termination_status"] == OPTIMAL
646646
#@test isapprox(result["objective"], 70693.9; atol = 1e0)
647-
@test isapprox(result["objective"], 70670.0; atol = 1e0)
648-
#@test isapprox(result["objective"], 70683.5; atol = 1e0)
647+
#@test isapprox(result["objective"], 70670.0; atol = 1e0)
648+
@test isapprox(result["objective"], 70683.5; atol = 1e0)
649649
end
650650
@testset "14-bus variable bounds" begin
651651
pm = instantiate_model("../test/data/matpower/case14.m", SOCWRConicPowerModel, PowerModels.build_opf)
@@ -906,14 +906,16 @@ end
906906
result = run_opf("../test/data/matpower/case3.m", SDPWRMPowerModel, sdp_solver)
907907

908908
@test result["termination_status"] == OPTIMAL
909-
@test isapprox(result["objective"], 5818.00; atol = 1e1)
910-
#@test isapprox(result["objective"], 5852.51; atol = 1e1)
909+
#@test isapprox(result["objective"], 5818.00; atol = 1e1)
910+
@test isapprox(result["objective"], 5852.51; atol = 1e1)
911911

912912
@test haskey(result["solution"],"WR")
913913
@test haskey(result["solution"],"WI")
914-
@test isapprox(result["solution"]["bus"]["1"]["w"], 1.179, atol = 1e-2)
914+
#@test isapprox(result["solution"]["bus"]["1"]["w"], 1.179, atol = 1e-2)
915+
@test isapprox(result["solution"]["bus"]["1"]["w"], 1.209, atol = 1e-2)
915916
@test isapprox(result["solution"]["branch"]["1"]["wr"], 0.941, atol = 1e-2)
916-
@test isapprox(result["solution"]["branch"]["1"]["wi"], 0.269, atol = 1e-2)
917+
#@test isapprox(result["solution"]["branch"]["1"]["wi"], 0.269, atol = 1e-2)
918+
@test isapprox(result["solution"]["branch"]["1"]["wi"], 0.284, atol = 1e-2)
917919
end
918920
@testset "5-bus asymmetric case" begin
919921
result = run_opf("../test/data/matpower/case5_asym.m", SDPWRMPowerModel, sdp_solver)
@@ -938,8 +940,8 @@ end
938940

939941
@test result["termination_status"] == OPTIMAL
940942
#@test isapprox(result["objective"], 6827.34; atol = 1e0)
941-
@test isapprox(result["objective"], 6735.17; atol = 1e0)
942-
#@test isapprox(result["objective"], 6827.71; atol = 1e0)
943+
#@test isapprox(result["objective"], 6735.17; atol = 1e0)
944+
@test isapprox(result["objective"], 6827.71; atol = 1e0)
943945
end
944946
# too slow for unit tests
945947
# @testset "14-bus case" begin
@@ -953,8 +955,8 @@ end
953955

954956
@test result["termination_status"] == OPTIMAL
955957
#@test isapprox(result["objective"], 11580.8; atol = 1e1)
956-
@test isapprox(result["objective"], 11507.7; atol = 1e1)
957-
#@test isapprox(result["objective"], 11580.5; atol = 1e1)
958+
#@test isapprox(result["objective"], 11507.7; atol = 1e1)
959+
@test isapprox(result["objective"], 11580.5; atol = 1e1)
958960
end
959961
@testset "14-bus variable bounds" begin
960962
pm = instantiate_model("../test/data/matpower/case14.m", SDPWRMPowerModel, PowerModels.build_opf)
@@ -969,14 +971,16 @@ end
969971

970972
@test result["termination_status"] == OPTIMAL
971973
#@test isapprox(result["objective"], 5851.23; atol = 1e1)
972-
@test isapprox(result["objective"], 5818.00; atol = 1e1)
973-
#@test isapprox(result["objective"], 5852.51; atol = 1e1)
974+
#@test isapprox(result["objective"], 5818.00; atol = 1e1)
975+
@test isapprox(result["objective"], 5852.51; atol = 1e1)
974976

975977
@test haskey(result["solution"]["w_group"]["1"],"WR")
976978
@test haskey(result["solution"]["w_group"]["1"],"WI")
977-
@test isapprox(result["solution"]["bus"]["1"]["w"], 1.179, atol = 1e-2)
979+
#@test isapprox(result["solution"]["bus"]["1"]["w"], 1.179, atol = 1e-2)
980+
@test isapprox(result["solution"]["bus"]["1"]["w"], 1.209, atol = 1e-2)
978981
@test isapprox(result["solution"]["branch"]["1"]["wr"], 0.941, atol = 1e-2)
979-
@test isapprox(result["solution"]["branch"]["1"]["wi"], 0.269, atol = 1e-2)
982+
#@test isapprox(result["solution"]["branch"]["1"]["wi"], 0.269, atol = 1e-2)
983+
@test isapprox(result["solution"]["branch"]["1"]["wi"], 0.284, atol = 1e-2)
980984
end
981985
@testset "5-bus with asymmetric line charge" begin
982986
result = run_opf("../test/data/pti/case5_alc.raw", SparseSDPWRMPowerModel, sdp_solver)

0 commit comments

Comments
 (0)