You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Anti-parallel branches are merged into one BranchesParallel group keyed by reverse_new_arc, but the group's orientation invariant is not preserved. The incoming branch is stored under the reverse direction without flipping its admittance block. This is correct for the DC path (BA/ABA/PTDF/LODF use the orientation-independent scalar get_series_susceptance, which is why the fix works there), but the AC equivalent path sums each member's 2x2 Y-block positionally and explicitly assumes all members share orientation:
@debug"Bus merge created anti-parallel collision: remapped arc $new_arc conflicts with existing $reverse_new_arc; promoting $(get_name(existing)) and $(get_name(val)) to a parallel group under $reverse_new_arc."
@debug"Bus merge created anti-parallel collision: remapped arc $new_arc conflicts with existing parallel group at $reverse_new_arc; adding $(get_name(val)) to that group."
(same pattern in the parallel→reverse cases at L1676-L1685). For symmetric lines Y11=Y22 and Y12=Y21, so the positional sum is unaffected. For asymmetric branches (transformers, phase shifters), Y11≠Y22 and Y12≠Y21, so the reverse-oriented member's tap/shunt admittance lands on the wrong port and get_equivalent_physical_branch_parameters returns an incorrect equivalent Ybus. Consider swapping the reverse member's (Y11,Y12,Y21,Y22) to (Y22,Y21,Y12,Y11) before grouping, or normalizing orientation, so the L478 invariant continues to hold.
- If this code review was useful, please react with 👍. Otherwise, react with 👎.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.