Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible issue with SOCWRPowerModel #145

Closed
MartaVanin opened this issue Jun 25, 2019 · 3 comments
Closed

Possible issue with SOCWRPowerModel #145

MartaVanin opened this issue Jun 25, 2019 · 3 comments

Comments

@MartaVanin
Copy link
Contributor

Hello all,
I was trying to run an OPF with the SOCWR formulation and obtained unexpected results:

  • The objective (minimize fuel cost) returns a negative value, as the pg at the transformer is negative
    After checking the sum of the to and fr losses, it appears that it is a negative number.
    I wondered whether it is actually a bug in the code or a property of the relaxation that I fail to understand.
    The SOC conic formulation, on the other hand, returns results which are very close to those of the AC one and it seems fine.
    You can find a script that displays the issue below.

``
using PowerModels
using ThreePhasePowerModels
using InfrastructureModels
using Ipopt
using JuMP
using Mosek

data = ThreePhasePowerModels.parse_file(".\test\data\opendss\case3_unbalanced.dss")

result_ACOPF = run_tp_opf(data, ACPPowerModel, IpoptSolver())
result_SOCOPF = run_tp_opf(data, SOCWRPowerModel, IpoptSolver())
result_SOCOPF_conic = run_tp_opf_bf(data, SOCConicUBFPowerModel, MosekSolver())

print(result_ACOPF["objective"])
print("\n")
print(result_SOCOPF["objective"])
print("\n")
print(result_SOCOPF_conic["objective"])

result_ACOPF_obj = 0.021481101490431413
result_SOCOPF_obj = -2.851668441519614
result_SOCOPF_conic_obj = 0.02117942578643128

@sanderclaeys
Copy link
Contributor

Hey Marta,

What do you mean with 'pg at the transformer'? case3_unbalanced.dss does not contain a transformer. The relaxations have not been extended yet for transformers.

Greetings,
Sander

@frederikgeth
Copy link
Collaborator

The implemented SOC relaxations are not equivalent.

  • The SOCConicUBFPowerModel is the SOC relaxation of the SDP relaxation of the complex unbalanced BFM (i.e. where S_ij is a matrix)
  • The SOCWRPowerModel is a SOC relaxation of the (diagonal) NLP form, i.e. where you do the following substitutions. wr_i,j,p,q = Um_i,p*Um_j,q*cos(Ua_i,p - Ua_j,q) and wi_i,j,p,q = Um_i,p*Um_j,q*sin(Ua_i,p - Ua_j,q), w_i,p,q = Um_i,p*Um_i,q which satisfies (wr_i,j,p,q)^2 + (wi_i,j,p,q)^2 <= w_i,p,q*w_j,p,q . (double check the indices if you'd use this).

Because the implemented SOCWRPowerModel only considers at the diagonal of S_ij, a lot of structure is lost, therefore the relaxation is much weaker. A better BIM SOC relaxation (equivalent to the above BFM) can be developed, by starting from the unbalanced SDP BIM (e.g. the matrix form as published by Gan and Low '14) and then relaxing to the complex-value SDP constraints to SOCs.

As you may have noticed, solving polynomial equivalent of SOCConicUBFPowerModel, i.e. SOCNLPUBFPowerModel, with Ipopt is tricky. You may need to play with the baseMVA and Ipopt setting to obtain reliable results. Some old results (won't run if you have JuMP 0.19):

    Basemva = 0.1, IpoptSolver()
    run_tp_opf_bf("./test/data/opendss/case3_unbalanced.dss", SOCNLPUBFPowerModel, ipopt)
    0.0211792
    
    Basemva = 0.5, IpoptSolver()
    run_tp_opf_bf("./test/data/opendss/case3_unbalanced.dss", SOCNLPUBFPowerModel, ipopt)
    0.0211278
    
    Basemva = 1.0, IpoptSolver()
    run_tp_opf_bf("./test/data/opendss/case3_unbalanced.dss", SOCNLPUBFPowerModel, ipopt)
    0.0206002
    
    Basemva = 1.0, IpoptSolver(bound_relax_factor=1e-10)
    run_tp_opf_bf("./test/data/opendss/case3_unbalanced.dss", SOCNLPUBFPowerModel, ipopt)
    0.0211708
    
    Basemva = 5.0, IpoptSolver(bound_relax_factor=1e-10)
    run_tp_opf_bf("./test/data/opendss/case3_unbalanced.dss", SOCNLPUBFPowerModel, ipopt)
    0.0191603
    
    Basemva = 5.0, IpoptSolver(bound_relax_factor=1e-12)
    run_tp_opf_bf("./test/data/opendss/case3_unbalanced.dss", SOCNLPUBFPowerModel, ipopt)
    0.0211278
    
    Basemva = 10.0, IpoptSolver(bound_relax_factor=1e-12)
    run_tp_opf_bf("./test/data/opendss/case3_unbalanced.dss", SOCNLPUBFPowerModel, ipopt)
    0.02060

Does this help? Other than updating the documentation to clarify this, should we close the issue?

@MartaVanin
Copy link
Contributor Author

Thank you and sorry, I thought they were mathematically equivalent formulations. I'll close the issue :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants