Skip to content

Create admittance helpers (old: PSI PM interface)#327

Open
acostarelli wants to merge 5 commits into
psy6from
ac/port-branch-admittance
Open

Create admittance helpers (old: PSI PM interface)#327
acostarelli wants to merge 5 commits into
psy6from
ac/port-branch-admittance

Conversation

@acostarelli

Copy link
Copy Markdown
Member

No description provided.

…ance, three_winding_arcs)

Promote the π-model admittance helpers that lived inline in PowerSimulations.jl's
PowerModels translator (get_branch_to_pm) and were later copied into
PowerOperationsModels.jl's native DCP/ACP builders as private `_*` helpers, into a
single public, reduction-aware home in PNM:

- branch_admittance(b) for lines / 2-winding transformers, and
  branch_admittance(segment, nr) for reduction-aggregated arcs
- reduced_arc_admittance(nr, from_no, to_no)
- winding_admittance(w) and three_winding_arcs(d) for 3-winding transformers
- branch_flow_limits(branch)

New file src/BranchAdmittance.jl (included after common.jl); exports added. Tests in
test/test_branch_admittance.jl ported from POM's native model tests plus a
three_winding_arcs decomposition check.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread src/BranchAdmittance.jl Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new public set of helpers for computing π-model branch admittances and directional flow limits (including reduction-aware equivalents and 3-winding transformer winding decomposition), aligning logic that previously lived in downstream translator/build paths into PowerNetworkMatrices.jl.

Changes:

  • Exports and includes a new BranchAdmittance.jl implementation providing branch_admittance, reduced_arc_admittance, winding_admittance, three_winding_arcs, and branch_flow_limits.
  • Adds a new test file covering the new helpers, including reduction-aware behavior and 3-winding transformer winding decomposition.
  • Wires the new file into the main module via include(...) and exports.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
src/PowerNetworkMatrices.jl Exports new helper APIs and includes the new implementation file.
src/BranchAdmittance.jl Implements new admittance/flow-limit helpers (including reduction-aware and 3W transformer support).
test/test_branch_admittance.jl Adds unit tests for the new helper APIs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/BranchAdmittance.jl
Comment on lines +26 to +34
function branch_admittance(b::PSY.ACTransmission)
ys = 1.0 / (PSY.get_r(b, PSY.SU) + PSY.get_x(b, PSY.SU) * im)
b_sh = PSY.get_b(b, PSY.SU)
return (
g = real(ys), b = imag(ys),
g_fr = 0.0, b_fr = b_sh.from, g_to = 0.0, b_to = b_sh.to,
tap = 1.0, shift = 0.0,
)
end

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is what get_branch_to_pm does

Comment thread src/BranchAdmittance.jl Outdated
Comment thread src/BranchAdmittance.jl
Comment thread src/BranchAdmittance.jl Outdated
Comment thread test/test_branch_admittance.jl Outdated
@acostarelli acostarelli requested a review from jd-lara June 17, 2026 02:45
@jd-lara jd-lara requested a review from m-bossart June 17, 2026 03:02
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

Successfully merging this pull request may close these issues.

2 participants