lanl-ansi / PowerModelsDistribution.jl

A Julia/JuMP Package for Unbalanced Power Network Optimization
https://lanl-ansi.github.io/PowerModelsDistribution.jl/stable/
Other
142 stars 42 forks source link

Debugging and validation: work in progress #47

Closed frederikgeth closed 6 years ago

frederikgeth commented 6 years ago

Warning: long post

I have some observations, after playing with the current implementation in a fork. You can run this script if you do a fix for https://github.com/lanl-ansi/ThreePhasePowerModels.jl/issues/45 in the latest master of PowerModels.jl, e.g.

function calc_branch_y(branch::Dict{String,Any})
    y = (branch["br_r"].values + im*branch["br_x"].values)^-1
    g = real(y)
    b = imag(y)
    return g, b
end

I largely followed [1], to develop the SDP BFM and the 'simplified' LP BFM. I also added a SOC formulation based on the SOC relaxation of the PSD constraints. I don't trust the SDP and SOC (both as NLP and as conic, for debugging) formulations at the moment. Nevertheless, the NLP solved in the script is consistent (losses, flows, voltages) with OpenDSS to <1e-5 and the LP correlates strongly, so I sort of trust those. The equations are developed using JuMP's vectorised syntax, therefore I also added a new problem type tp_opf_bf_mat.

Before I attempt at converting this to a PR, it would be nice to exchange ideas on the following:

Todos:

Comments welcome!

-- [1] Gan, L., & Low, S. H. (2014). Convex relaxations and linear approximation for optimal power flow in multiphase radial networks. PSSC

Reference results OpenDSS for case3_unbalanced:

Bus   (node ref)  Node       V (kV)    Angle    p.u.   Base kV
SOURCEBUS .. 1      0.22999 /_    0.0    0.9959     0.400        1-2    0.39836 /_   30.0    0.9959
   -         2      0.22999 /_ -120.0    0.9959     0.400        2-3    0.39836 /_  -90.0    0.9959
   -         3      0.22999 /_  120.0    0.9959     0.400        3-1    0.39836 /_  150.0    0.9959
PRIMARY .... 1      0.22654 /_   -0.2   0.98094     0.400        1-2    0.39384 /_   30.0    0.9846
   -         2      0.22848 /_ -120.1   0.98936     0.400        2-3    0.39481 /_  -90.0   0.98702
   -         3      0.22795 /_  120.1   0.98704     0.400        3-1    0.39428 /_  149.8   0.98571
LOADBUS .... 1      0.22252 /_   -0.5   0.96355     0.400        1-2    0.38859 /_   29.9   0.97148
   -         2      0.22673 /_ -120.2   0.98176     0.400        2-3    0.39068 /_  -90.1   0.97671
   -         3      0.22558 /_  120.3   0.97678     0.400        3-1    0.38954 /_  149.7   0.97385

   Bus       Phase     kW     +j   kvar           kVA           PF
ELEMENT = "Line.OHLINE"   
SOURCEBUS       1     9.2757 +j     3.1776        9.8048      0.9460
SOURCEBUS       2     6.0735 +j     3.0673        6.8041      0.8926
SOURCEBUS       3      6.132 +j     3.0278        6.8388      0.8967
 TERMINAL TOTAL       21.481 +j     9.2726        23.397      0.9181
ELEMENT = "Line.OHLINE"   
PRIMARY         1    -9.1485 +j    -3.0949        9.6578      0.9473
PRIMARY         2    -6.0396 +j     -3.036        6.7598      0.8935
PRIMARY         3     -6.071 +j    -3.0147        6.7783      0.8957
 TERMINAL TOTAL      -21.259 +j    -9.1456        23.143      0.9186

ELEMENT = "Line.QUAD"     
PRIMARY         1     9.1485 +j     3.0949        9.6578      0.9473
PRIMARY         2     6.0396 +j      3.036        6.7598      0.8935
PRIMARY         3      6.071 +j     3.0147        6.7783      0.8957
 TERMINAL TOTAL       21.259 +j     9.1456        23.143      0.9186
ELEMENT = "Line.QUAD"     
LOADBUS         1         -9 +j         -3        9.4868      0.9487
LOADBUS         2         -6 +j         -3        6.7082      0.8944
LOADBUS         3         -6 +j         -3        6.7082      0.8944
 TERMINAL TOTAL          -21 +j         -9        22.847      0.9191
ccoffrin commented 6 years ago

Sounds like some great progress. I suggest that we setup a call to discuss any details early next week.

Some initial questions

frederikgeth commented 6 years ago

[2] Kim, Kojima and Yamashita, Second Order Cone Programming Relaxation of a Positive Semidefinite Constraint, Optimization Methods and Software, 2003

frederikgeth commented 6 years ago

Yeah, and a call next week is a great idea!

frederikgeth commented 6 years ago

Some helper functions to consider for the line impedance matrices here.

The license of the test data is to be discussed before making it a part of this package, see:

frederikgeth commented 6 years ago

I will close this now, major issues are addressed or taken up in more targeted open issues.