Skip to content

Conversation

@vmouradian
Copy link
Member

@vmouradian vmouradian commented Sep 29, 2025

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce?

Bug fix

Context
During AIC outerloop active power is distributed over each area until the mismatch (interchange mismatch + slack of the area) is below 'areaInterchangePMaxMismatch'.
When all areas match this condition, it can happen that the slack remaining on the slack bus is above 'slackBusPMaxMismatch'.

This slack mismatch is then distributed over all areas -> the way that this distribution is done is the bugfix here.

What is the current behavior?

The mismatch is distributed in one activePowerDistribution run on all buses.

This causes a bug. Due to the reset at the begining of the distribution.
Generators are reset to their initial state at the begining, then the mismatch is distributed equally over all generators.
This means all the interchange mismatch distribution is undone and just the slack lislatch is distributed.
This adds a lot of iterations utill the AIC is complete and even leads to reach the iteration limit making the LF fail.

What is the new behavior (if this is a feature change)?
The distributed individually on each area with a dedicated ActivePowerDistribution run, so the previous distributions are kept.

To attribute the participation of each area this logic has been added :

This distribution will affect each area's interchange and will not necessarily make it closer to its target.
The distribution factor of each area will be computed in a way that minimises chances of having areas increase their interchange mismatch up to more than areaInterchangePMaxMismatch in absolute value.
So the factor is proportional to the "margin" that the area can distribute while keeping
-areaInterchangePMaxMismatch < area_total_mismatch < areaInterchangePMaxMismatch.

It is computed like this:
factor = sign(slack_bus_mismatch) * area_total_mismatch + areaInterchangePMaxMismatch
Then factors are normalized to have sum of factors equal to 1.

The distribution is done starting by the areas with the higher factor to the lowest.
In case the power to distribute for an area is under P_RESIDUE_EPS, then P_RESIDUE_EPS is distributed.
The distribution stops when the remaining mismatch to distribute is under P_RESIDUE_EPS.

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

@vmouradian vmouradian self-assigned this Sep 29, 2025
@vmouradian vmouradian changed the title Split remaining slack mismatch into one distribution per area Split AIC remaining slack mismatch into several distributions, one per area Sep 29, 2025
@jeandemanged jeandemanged marked this pull request as draft September 29, 2025 10:39
Signed-off-by: vmouradian <[email protected]>
@vmouradian vmouradian marked this pull request as ready for review October 15, 2025 12:45
@vmouradian vmouradian marked this pull request as draft October 22, 2025 08:08
Signed-off-by: vmouradian <[email protected]>
Signed-off-by: vmouradian <[email protected]>
Signed-off-by: vmouradian <[email protected]>
Signed-off-by: vmouradian <[email protected]>
Signed-off-by: vmouradian <[email protected]>
@vmouradian vmouradian marked this pull request as ready for review October 23, 2025 08:05
@jeandemanged jeandemanged moved this from TODO to Waiting for review in Release 12/2025 Nov 7, 2025
@jeandemanged
Copy link
Member

the 3 sonar issues should be resolvable

Signed-off-by: vmouradian <[email protected]>
@sonarqubecloud
Copy link

@github-project-automation github-project-automation bot moved this from Waiting for review to Approved in Release 12/2025 Nov 27, 2025
@jeandemanged jeandemanged added the bug Something isn't working label Nov 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Release 12/2025

Projects

Status: Approved

Development

Successfully merging this pull request may close these issues.

4 participants