Skip to content

Commit f5a3bbd

Browse files
committed
UPD: bank_transformers=false
1 parent 365ecd1 commit f5a3bbd

File tree

7 files changed

+23
-21
lines changed

7 files changed

+23
-21
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
## v4.0.0
88

9+
- Change `parse_file` to use `bank_transformers=false`, which seems to affect quality of solutions
910
- Upgrade to use new PowerModelsProtection fault study solver (breaking)
1011
- Upgrade to JuMP v1.23.2, to support new NL syntax (PMD v0.16, PMS v0.4.0, PMP v0.7.1) (breaking)
1112

src/io/network.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ ONM version of `PowerModelsDistribution.parse_file`, which includes some `dss2en
4848
function parse_file(network_file::String; dss2eng_extensions=Function[], transformations=Function[], import_all=true, kwargs...)
4949
eng = PMD.parse_file(
5050
network_file;
51+
bank_transformers=false,
5152
dss2eng_extensions=[
5253
_dss2eng_protection_locations!,
5354
dss2eng_extensions...

test/graphml.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77
@test length(graph.edge) == 6
88

99
save_graphml("../test/data/ieee13_nested.graphml", eng; type="nested")
10-
@test length(EzXML.nodes(EzXML.nodes(EzXML.readxml("../test/data/ieee13_nested.graphml").node)[1])) == 185
10+
@test length(EzXML.nodes(EzXML.nodes(EzXML.readxml("../test/data/ieee13_nested.graphml").node)[1])) == 177
1111
rm("../test/data/ieee13_nested.graphml")
1212
end
1313

1414
@testset "test unnested graph" begin
1515
graph = build_unnested_graph(eng)
1616
@test length(graph.node) == 57
17-
@test length(graph.edge) == 57
17+
@test length(graph.edge) == 59
1818

1919
save_graphml("../test/data/ieee13_unnested.graphml", eng; type="unnested")
20-
@test length(EzXML.nodes(EzXML.nodes(EzXML.readxml("../test/data/ieee13_unnested.graphml").node)[1])) == 185
20+
@test length(EzXML.nodes(EzXML.nodes(EzXML.readxml("../test/data/ieee13_unnested.graphml").node)[1])) == 177
2121
rm("../test/data/ieee13_unnested.graphml")
2222
end
2323
end

test/mld.jl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
r = optimize_switches!(args)
3636

3737
@test all(_r["termination_status"] == OPTIMAL for (n,_r) in r)
38-
@test isapprox(sum(Float64[_r["objective"] for _r in values(r)]), 176.86; atol=1)
38+
@test isapprox(sum(Float64[_r["objective"] for _r in values(r)]), 118.30; atol=1)
3939
end
4040

4141
@testset "test rolling-horizon optimal switching - lindistflow - traditional" begin
@@ -53,7 +53,7 @@
5353
r = optimize_switches!(args)
5454

5555
@test all(_r["termination_status"] == OPTIMAL for (n,_r) in r)
56-
@test isapprox(sum(Float64[_r["objective"] for _r in values(r)]), 176.86; atol=1)
56+
@test isapprox(sum(Float64[_r["objective"] for _r in values(r)]), 118.30; atol=1)
5757
end
5858

5959
@testset "test rolling-horizon optimal switching - nfa - block" begin
@@ -69,7 +69,7 @@
6969
r = optimize_switches!(args)
7070

7171
@test all(_r["termination_status"] == OPTIMAL for (n,_r) in r)
72-
@test isapprox(sum(Float64[_r["objective"] for _r in values(r)]), 109.94; atol=1)
72+
@test isapprox(sum(Float64[_r["objective"] for _r in values(r)]), 108.75; atol=1)
7373
end
7474

7575
@testset "test rolling-horizon optimal switching - nfa - traditional" begin
@@ -85,7 +85,7 @@
8585
r = optimize_switches!(args)
8686

8787
@test all(_r["termination_status"] == OPTIMAL for (n,_r) in r)
88-
@test isapprox(sum(Float64[_r["objective"] for _r in values(r)]), 109.94; atol=1)
88+
@test isapprox(sum(Float64[_r["objective"] for _r in values(r)]), 108.85; atol=1)
8989
end
9090
end
9191

@@ -102,7 +102,7 @@
102102
r = optimize_switches!(args)
103103

104104
@test first(r).second["termination_status"] == OPTIMAL
105-
@test isapprox(r["1"]["objective"], 82.06; atol=1)
105+
@test isapprox(r["1"]["objective"], 80.47; atol=1)
106106
end
107107

108108
@testset "test full-lookahead optimal switching - lindistflow - traditional" begin
@@ -138,7 +138,7 @@
138138
r = optimize_switches!(args)
139139

140140
@test first(r).second["termination_status"] == OPTIMAL
141-
@test isapprox(r["1"]["objective"], 80.64; atol=1)
141+
@test isapprox(r["1"]["objective"], 79.46; atol=1)
142142
end
143143

144144
@testset "test full-lookahead optimal switching - lindistflow - traditional - radial-disabled - inverter-disabled" begin
@@ -155,7 +155,7 @@
155155
r = optimize_switches!(args)
156156

157157
@test first(r).second["termination_status"] == OPTIMAL
158-
@test isapprox(r["1"]["objective"], 80.65; atol=1)
158+
@test isapprox(r["1"]["objective"], 79.46; atol=1)
159159
end
160160

161161
@testset "test full-lookahead optimal switching - nfa - block" begin
@@ -170,7 +170,7 @@
170170
r = optimize_switches!(args)
171171

172172
@test first(r).second["termination_status"] == OPTIMAL
173-
@test isapprox(r["1"]["objective"], 72.52; atol=1)
173+
@test isapprox(r["1"]["objective"], 71.32; atol=1)
174174
end
175175

176176
@testset "test full-lookahead optimal switching - nfa - traditional" begin
@@ -185,7 +185,7 @@
185185
r = optimize_switches!(args)
186186

187187
@test first(r).second["termination_status"] == OPTIMAL
188-
@test isapprox(r["1"]["objective"], 72.52; atol=1)
188+
@test isapprox(r["1"]["objective"], 71.32; atol=1)
189189
end
190190

191191
@testset "test robust switching - lindistflow - block" begin
@@ -244,7 +244,7 @@ end
244244
r = solve_block_mld(eng_s, LPUBFDiagPowerModel, solver)
245245

246246
@test r["solution"]["switch"]["680675"]["state"] == OPEN
247-
@test r["solution"]["switch"]["671692"]["state"] == OPEN
247+
@test r["solution"]["switch"]["671692"]["state"] == CLOSED
248248
@test length(filter(x->x.second["state"]==OPEN, r["solution"]["switch"])) == 2
249249
@test r["objective"] < 1.0
250250

@@ -253,7 +253,7 @@ end
253253

254254
r = solve_block_mld(eng_s, LPUBFDiagPowerModel, solver)
255255

256-
@test r["solution"]["switch"]["680675"]["state"] == OPEN
256+
@test r["solution"]["switch"]["680675"]["state"] == CLOSED
257257
@test r["solution"]["switch"]["671692"]["state"] == OPEN
258258
@test length(filter(x->x.second["state"]==OPEN, r["solution"]["switch"])) == 2
259259
@test r["objective"] < 1.0

test/nlp.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@
2626

2727
@test result["termination_status"] == LOCALLY_SOLVED
2828
@test length(filter(x -> x.second["state"] == CLOSED, get(get(result, "solution", Dict()), "switch", Dict()))) == 5
29-
@test isapprox(result["objective"], 6.96; atol=0.1)
29+
@test isapprox(result["objective"], 6.76; atol=0.1)
3030
end
3131

3232
@testset "test block mld - acr" begin
3333
result = solve_block_mld(eng, ACRUPowerModel, minlp_solver)
3434

3535
@test result["termination_status"] == LOCALLY_SOLVED
3636
@test length(filter(x -> x.second["state"] == CLOSED, get(get(result, "solution", Dict()), "switch", Dict()))) == 5
37-
@test isapprox(result["objective"], 6.96; atol=0.1)
37+
@test isapprox(result["objective"], 6.75; atol=0.1)
3838
end
3939
end

test/opf.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
@test isapprox(args["optimal_dispatch_result"]["objective"], 5.13; atol=2e-2)
4747
@test all(isapprox.(args["optimal_dispatch_result"]["solution"]["nw"]["7"]["bus"]["801"]["vm"] ./ vbase["801"], [1.013, 1.062, 1.025]; atol=1e-2))
4848
@test all(isapprox.(args["optimal_dispatch_result"]["solution"]["nw"]["7"]["bus"]["801"]["va"], [-3.36, -122.49, 117.39]; atol=1e0))
49-
@test all(isapprox.(args["optimal_dispatch_result"]["solution"]["nw"]["7"]["bus"]["675"]["vm"] ./ vbase["675"], [0.979, 1.085, 1.021]; atol=1e-2))
49+
@test all(isapprox.(args["optimal_dispatch_result"]["solution"]["nw"]["7"]["bus"]["675"]["vm"] ./ vbase["675"], [0.989, 1.082, 1.017]; atol=1e-2))
5050
@test all(isapprox.(args["optimal_dispatch_result"]["solution"]["nw"]["7"]["bus"]["675"]["va"], [-4.77, -123.13, 116.81]; atol=1e0))
5151
end
5252

test/stats.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@
5555
@testset "test microgrid stats" begin
5656
@test all(isapprox.(args["output_data"]["Storage SOC (%)"], [36.4, 34.8, 44.7, 46.5, 48.0, 48.0, 31.2, 16.8]; atol=1e0))
5757

58-
@test all(isapprox.(args["output_data"]["Load served"]["Bonus load via microgrid (%)"], [0.0, 0.0, 9.18339, 7.98514, 7.98514, 8.32841, 8.32841, 8.72574]; atol=1e-1))
59-
@test all(isapprox.(args["output_data"]["Load served"]["Feeder load (%)"], [93.7876, 93.7822, 84.6857, 85.7495, 85.7495, 85.4536, 85.4536, 85.101]; atol=1e-1))
58+
@test all(isapprox.(args["output_data"]["Load served"]["Bonus load via microgrid (%)"], [0.0, 0.0, 9.57997, 8.35485, 8.35485, 8.70728, 8.70728, 9.11343]; atol=1e-1))
59+
@test all(isapprox.(args["output_data"]["Load served"]["Feeder load (%)"], [93.7930, 93.7860, 84.2933, 85.3878, 85.3878, 85.0814, 85.0814, 84.7187]; atol=1e-1))
6060
@test all(isapprox.(args["output_data"]["Load served"]["Microgrid load (%)"], [14.2464, 17.9733, 51.9408, 64.7277, 61.1884, 53.4061, 82.2705, 81.8947]; atol=1e-1))
6161

62-
@test all(isapprox.(args["output_data"]["Generator profiles"]["Diesel DG (kW)"], [0.0, 0.0, 260.503, 272.498, 272.498, 268.22, 268.22, 264.266]; atol=1e0))
62+
@test all(isapprox.(args["output_data"]["Generator profiles"]["Diesel DG (kW)"], [0.0, 0.0, 271.752, 285.112, 285.112, 280.420, 280.420, 276.006]; atol=1e0))
6363
@test all(isapprox.(args["output_data"]["Generator profiles"]["Energy storage (kW)"], [75.0, 20.0016, 6.00045, -22.4995, -17.9993, -0.499176, 210.0, 180.0]; atol=1e0))
6464
@test all(isapprox.(args["output_data"]["Generator profiles"]["Solar DG (kW)"], [0.0, 0.0, 14.0, 35.0, 28.0, 10.5, 0.0, 0.0]; atol=1e0))
65-
@test all(isapprox.(args["output_data"]["Generator profiles"]["Grid mix (kW)"], [2300.61, 2385.48, 2402.26, 2926.25, 2926.25, 2752.07, 2752.07, 2577.35]; atol=1e1))
65+
@test all(isapprox.(args["output_data"]["Generator profiles"]["Grid mix (kW)"], [2300.74, 2385.57, 2391.12, 2913.88, 2913.88, 2740.06, 2740.06, 2565.76]; atol=1e1))
6666
end
6767

6868
@testset "test stability stats" begin

0 commit comments

Comments
 (0)