Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #448 +/- ##
=======================================
Coverage 89.21% 89.21%
=======================================
Files 46 46
Lines 3172 3172
=======================================
Hits 2830 2830
Misses 342 342 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| # Quadratically Constrained Quadratic Program). | ||
| # | ||
| # TSSOS handles an equality constraint `h = 0` with a *free* polynomial | ||
| # multiplier. This is equivalent to enforcing `h ≥ 0` and `-h ≥ 0` with |
|
Hello Benoit, great work! This will be a useful tool when working on AC-OPF. It seems that the full CS-TSSOS method, meaning term sparsity + correlative sparsity, isn't implemented yet? It would also be nice to see some results from Pglib.jl, to compare against TSSOS. Similar to tables 7/8 from https://dl.acm.org/doi/pdf/10.1145/3569709 |
|
It is, correlative sparsity is here: https://github.com/jump-dev/SumOfSquares.jl/blob/main/src/Certificate/Sparsity/variable.jl and term sparsity is here: https://github.com/jump-dev/SumOfSquares.jl/blob/main/src/Certificate/Sparsity/monomial.jl |
Sorry I meant to say that, in this tutorial you do term sparsity and correlative sparsity independently: Basically:
But not the combination of term + correlative sparsity that CS-TSSOS offers. This is not supported by SoS.jl yet it seems |
d64bc36 to
ba7a9c4
Compare
|
Good point, this is now done in #482 |
Use the degree-two truncated ideal for balance equations, the reference
voltage and the three zero active generator powers. Match the normalization
and generator bounds of pop_opf_real. Retain all selected monomials for
one minimum-fill term-sparsity step.
Reference: TSSOS.jl 591f036e, example/modelopf.jl, PGLib 0.2.2,
PowerModels 0.21.7. Run pop_opf_real on pglib_opf_case14_ieee with
normal=true, AngleCons=true, LineLimit="relax". Run cs_tssos at order 1
with (CS, TS) = (false, false), ("MF", false), (false, "MF").
Use Clarabel in both packages and rescale the TSSOS objective as in runopf.jl.
| Pattern | TSSOS blocks / max | SOS blocks / max | TSSOS bound | SOS bound |
| --- | ---: | ---: | ---: | ---: |
| Dense | 1 / 39 | 1 / 36 | 2178.080019 | 2178.079324 |
| Correlative | 28 / 7 | 28 / 7 | 2178.080355 | 2178.079741 |
| Term | 28 / 6 | 25 / 6 | 2178.080416 | 2178.079061 |
Compared the coefficient maps of the objective, 115 inequalities and 32
equalities. Checked the multiplier bases and the clique labels. Projecting
out the three zero active powers gives identical maximal dense and term
cliques. For correlative sparsity, five fill edges differ in each direction.
Every one of the 123 required nonfixed moment entries occurs in both
patterns and both clique families satisfy running intersection. The
different fill variables therefore give equivalent PSD completions.
Run the real-voltage pglib_opf_case14_ieee model at order one with normal=true, AngleCons=true and LineLimit="relax". Use cs_tssos with CS="MF", TS="MF", MomentOne=false on TSSOS.jl 591f036e, scaling its objective as in example/runopf.jl. Use Clarabel for both solves. | Implementation | Lower bound | Gram blocks | Largest block | Nonnegative inequality multipliers | | --- | ---: | ---: | ---: | ---: | | CS-TSSOS | 2175.655968 | 80 | 5 | 211 | | SumOfSquares | 2175.655851 | 80 | 5 | 115 | Compared all 148 input polynomials by support and coefficient. Label the constant 0 and each linear monomial by its OPF variable index. Sorting the labels in each block and comparing the resulting multisets gives exact agreement with data.basis[i][1][b] for b in data.blocks[i][1] over all variable cliques i. Both SDPs specify the same 135 moments. The TSSOS equality rows have rank 35. They lie in the degree-two Macaulay row space, and restricting that row space to these moment coordinates also gives dimension 35. The 211 nonnegative scalar multipliers combine by inequality into 115.
Give Ipopt and SumOfSquares.Optimizer the same JuMP model. Compare the first-order bound with the explicit TSSOS formulation and explain how eliminating branch flows changes the thermal limits and the Gram basis. | PGLib case14 | Variables | Largest Gram block | Objective or bound | | --- | ---: | ---: | ---: | | PowerModels ACR, Ipopt | 118 | — | 2178.080412 | | PowerModels ACR, first-order SOS (SCS) | 118 | 119 | 2178.080436 | | TSSOS formulation, dense SOS (Clarabel) | 38 | 36 | 2178.079324 | SCS used absolute and relative tolerances of 1e-9. The numerical SOS bound exceeds the Ipopt objective by about 0.000024. The tutorial checks agreement of the two dense relaxation values to within 0.01 on case14.
We could also just give
SumOfSquares.Optimizerto the formulation produced by PowerModels.Preview https://jump-dev.github.io/SumOfSquares.jl/previews/PR448
Needs
cc @langestefan