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

ADD: Transformer SOC relaxations #412

Merged
merged 5 commits into from
Dec 23, 2022
Merged

ADD: Transformer SOC relaxations #412

merged 5 commits into from
Dec 23, 2022

Conversation

keatsig
Copy link
Collaborator

@keatsig keatsig commented Dec 15, 2022

This PR adds (wye-wye and delta-wye) transformer SOC relaxations used by SOCNLPUBFPowerModel and SOCConicUBFPowerModel formulations.

CC @frederikgeth

@codecov
Copy link

codecov bot commented Dec 15, 2022

Codecov Report

Merging #412 (9ef2c71) into main (7188b0f) will increase coverage by 0.27%.
The diff coverage is 79.79%.

@@            Coverage Diff             @@
##             main     #412      +/-   ##
==========================================
+ Coverage   71.34%   71.61%   +0.27%     
==========================================
  Files          59       59              
  Lines       15090    15189      +99     
==========================================
+ Hits        10766    10878     +112     
+ Misses       4324     4311      -13     
Impacted Files Coverage Δ
src/form/bf_mx_soc.jl 83.78% <73.91%> (-16.22%) ⬇️
src/core/solution.jl 91.30% <83.33%> (-1.68%) ⬇️
src/form/bf_mx.jl 54.78% <100.00%> (+4.97%) ⬆️
src/form/shared.jl 51.21% <0.00%> (+6.82%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Collaborator

@pseudocubic pseudocubic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good to me, and is self-contained making it easy to review. However, it looks like a test is not passing. I suspect the test tolerance might need to be slightly relaxed?

@pseudocubic pseudocubic added Type: Enhancement New feature or request Category: Formulations Network Formulation labels Dec 15, 2022
@pseudocubic pseudocubic marked this pull request as ready for review December 15, 2022 19:02
va = LinearAlgebra.pinv(t)*[atan(bus["Wi"][2,1], bus["Wr"][2,1]);
atan(bus["Wi"][3,1], bus["Wr"][3,1]);
atan(bus["Wi"][3,2], bus["Wr"][3,2])]
bus["va"] = [va[findmin(abs.(va .- 0))[2]],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure it matters here, but the convential angle rotation order is phase a - 0 degrees, b -120 degrees, c -240=+120 degrees

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is correct. It looks like va could have multiple solutions since it is being calculated using off-diagonals of Wr and Wi (which only have information about angle differences). Without lines 82-84, the angles don't seem to follow conventional order of (0,-120deg, 120deg).

\end{align}
```
"""
function constraint_mc_transformer_power_dy(pm::SOCUBFModels, nw::Int, trans_id::Int, f_bus::Int, t_bus::Int, f_idx::Tuple{Int,Int,Int}, t_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, t_connections::Vector{Int}, pol::Int, tm_set::Vector{<:Real}, tm_fixed::Vector{Bool}, tm_scale::Real)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the alternative is to use the code path for the n-winding transformer decomposition, and do lifting to SW separately for the idealized single-phase transformer component (i.e. the wye model) and the internal losses (composable of normal branches/shunts in the SW variable space).

src/form/bf_mx_soc.jl Outdated Show resolved Hide resolved
@pseudocubic pseudocubic merged commit ce5187d into lanl-ansi:main Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Formulations Network Formulation Type: Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants