Skip to content

Apply the apparent power limit at both ends in bus injection solved as a non-linear program - #211

Merged
erikfilias merged 4 commits into
masterfrom
feat/bim-apparent-power-limit
Oct 9, 2026
Merged

erikfilias merged 4 commits into
masterfrom
feat/bim-apparent-power-limit

Conversation

@erikfilias

@erikfilias erikfilias commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Problem

IndACApparentPowerLimit limits the apparent power at both ends of each AC branch to its rating. It was read for every AC formulation but applied only in branch flow (IndACPowerFlow = 1). In bus injection (IndACPowerFlow = 2 and 3), the far end of a branch had no apparent power limit, and the near end only eBIMSLimit, the counterpart of the current limit, which admits up to the rating times V/Vmin. A case could turn the option on in bus injection and get branches above their rating, with no message.

Observed behaviour

9n_AC, first 12 hours, option on in every row:

Largest loading Branch-hours above the rating Generation cost
Rectangular coordinates, before 105.03 % 6 0.209405 MEUR
Branch flow with the AC recovery step 99.60 % 0 0.230587 MEUR

Solution

The constraints move from the branch flow block into one function, _ApparentPowerLimit, used by both formulations; both name their far-end flows vFlowElecBck and vFlowReactBck. Bus injection applies them as the circle where the model is solved as a non-linear program anyway: rectangular coordinates, W space with the loop condition (IndACCycle = 1), and IndACModelType = 2.

In the W-space cone solved with Gurobi, the option is not applied, and a warning says so. There the inscribed polygon made Gurobi's barrier stop with numerical trouble on 9n_AC after five iterations, although ipopt solved the same model with every branch within its rating, and BarHomogeneous = 1 did not help.

After the change

The same case:

Largest loading Branch-hours above the rating Generation cost
Rectangular coordinates, after 99.77 % 0 0.228961 MEUR

Notes

  • Branch flow is unchanged. On a 695-bus Nordic case, one hour in branch flow with the recovery step gives the same cost (2.4420 -> 2.5503 MEUR) and the same nodal prices to four decimals before and after.
  • On that Nordic case with the thinner conductor bundle, rectangular coordinates priced SE4 at 127.0 EUR/MWh at the evening peak without the limit and 226.6 with it, the value branch flow with the recovery step gives. Over a day solved hour by hour, rectangular coordinates now reach the branch flow optimum to four decimals (53.2777 against 53.2776 MEUR) in about a sixth of the solve time.
  • Three tests: the limit holds in rectangular coordinates and in W space with the loop condition on 9n_AC, and the W-space cone reports that it is not applied. tests/test_ac_input.py and tests/test_ac_hvdc_and_setpoints.py pass (112).
  • The CHANGELOG has an entry under 4.19.0rc.
  • The branch carries master as of 9 October (merge commit 8dca104). The one conflict was the option comment in
    openTEPES_InputData.py, where master added the IndACRestoreWarmStart line; both lines are kept. The two modules
    changed here are dated October 09, 2026. tests/test_ac_input.py and tests/test_ac_hvdc_and_setpoints.py pass on
    the merged tree (114).

…s a non-linear program

IndACApparentPowerLimit was read but applied in branch flow only, so in bus
injection the far end of a branch had no apparent power limit. The constraints
move into one function used by both formulations. Bus injection applies them,
as the circle, where the model is solved as a non-linear program anyway:
rectangular coordinates, W space with the loop condition, and the exact model
type. In the W-space cone solved with Gurobi the option is not applied and a
warning says so, because the inscribed polygon made the barrier stop with
numerical trouble on 9n_AC although ipopt solved the same model.

Three tests: the limit holds in both non-linear bus-injection models on 9n_AC,
and the cone reports that it is not applied. The AC test files pass (112).
The only conflict was the option comment in openTEPES_InputData.py: master
added the IndACRestoreWarmStart line below the IndACApparentPowerLimit one,
which this branch had reworded. Both lines are kept.
@erikfilias
erikfilias merged commit b201194 into master Oct 9, 2026
14 checks passed
@erikfilias
erikfilias deleted the feat/bim-apparent-power-limit branch October 9, 2026 21:44
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