-
Notifications
You must be signed in to change notification settings - Fork 43
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
Conversation
Codecov Report
@@ 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
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this 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?
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]], |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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).
This PR adds (wye-wye and delta-wye) transformer SOC relaxations used by SOCNLPUBFPowerModel and SOCConicUBFPowerModel formulations.
CC @frederikgeth