Skip to content

Derive the candidate-line Big-M from the nodal angle bound - #166

Merged
erikfilias merged 1 commit into
masterfrom
fix/bigm-angle-coupling
Aug 30, 2026
Merged

Derive the candidate-line Big-M from the nodal angle bound#166
erikfilias merged 1 commit into
masterfrom
fix/bigm-angle-coupling

Conversation

@erikfilias

@erikfilias erikfilias commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Change

The angle side of the candidate-line Big-M is a literal pi:

M_angle_lca = (1.0 + pMBigMEpsilon) * max(par['pLineNTCBck'][lca], math.pi * par['pSBase'] / par['pLineX'][lca])

and the nodal angle bound, a few lines below in the same function, is pi/2:

par['pMaxTheta'] = par['pDemandElec']*0.0 + math.pi/2

The angle difference across a line is bounded by twice the nodal bound, so pi is valid only while
the nodal bound is pi/2. Nothing ties the two together. This names the bound once and derives the
Big-M from it.

Effect

None on results. 2.0 * (math.pi/2) is bit-identical to math.pi in IEEE-754, so the Big-M is
unchanged for every line. No interface or input-data change.

Changing pMaxTheta currently leaves the Big-M at its old value, which is then too small for the
wider angle range and restricts flows on candidate lines without raising an error. After this
change the two move together.

Scope

Making pMaxTheta configurable is not included. If added later, oT_Data_Parameter would be the
natural place, and two things would need handling: a MaxTheta column there is read by the generic
parameter loader and then overwritten by the broadcast assignment in
openTEPES_DataConfiguration.py, and the near-binding warning in openTEPES_OutputResultsNetwork.py
hardcodes math.pi / 2.

The angle side of the candidate-line Big-M was a literal pi, and the nodal
angle bound a few lines below is pi/2. The angle difference across a line is
bounded by twice the nodal bound, so the two are related but nothing enforces
it: changing pMaxTheta leaves the Big-M unchanged and no longer valid.

The bound is now named once and the Big-M derived from it. 2.0 * (pi/2) is
bit-identical to pi in IEEE-754, so no result changes.
@erikfilias
erikfilias force-pushed the fix/bigm-angle-coupling branch from 919c580 to e03837c Compare August 29, 2026 21:31
@erikfilias
erikfilias merged commit 462edbb into master Aug 30, 2026
15 checks passed
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.

1 participant