power-grid-model icon indicating copy to clipboard operation
power-grid-model copied to clipboard

[FEATURE] Output correct automatic tap even when line drop compensation is large

Open mgovers opened this issue 9 months ago • 1 comments

During implementation of #588 , it was discovered that, when line drop compensation is large, there are cases where the assumption that the voltage on the controlled side decreases with increasing tap position doesn't hold anymore. The current optimization logic in the automatic tap optimizer strongly depends on that assumption.

The edge case arises when there is a phase angle between U and I, and $\underline{I} * \underline{Y}_{compensation}$ is relatively large compared to U.

NOTE: The outcome of this discussion may affect #594

Example toy model

As an example, consider a toy model of a source that is connected via a regulated transformer to a load with constant power, i.e., $\underline{U} * \underline{I}$ remains constant.

S ----/^-oo----- L

Consider U and I to be in phase (both real numbers) $U_{comp} = |U + (R + iZ) I|$ and everything is p.u., such that $U=1/t$ and $P = U I = 1$ , so that $I = t$ . The full equation now becomes $U_{comp}(t) = |1/t + (R + iZ) t|$

For ease of illustration, now consider the (extreme) case where $Z=0$ and $R=0.1$, so that $U_{comp}(t) = |1/t + 0.1 t| = |(1 + 0.1 t²)/t|$. For integer $t$, $U_{comp}$ is decreasing for $0 < t <= 3$ (as per the assumption), but it is increasing for $t >= 4$.

This function is plotted in https://www.wolframalpha.com/input?i=abs%281%2Ft+%2B+%280.1%29+*+t%29

mgovers avatar May 13 '24 09:05 mgovers

The max_iter of the outer loop (per rank) can be automatically determined by the difference between tap_min and tap_max of all transformers in this rank.

TonyXiang8787 avatar May 13 '24 12:05 TonyXiang8787

Conclusion of discussion:

  • Edge cases like this are rare in real grid scenarios.
  • They can theoretically happen for generators but we don't expect them to.
  • It is OK to just let the algorithm diverge in these cases, and call it undefined behavior (UB).
  • No changes need to happen in the short term.
  • The following check may be implemented as an input validation function in the long term.

IMG_20240516_110246

mgovers avatar May 16 '24 11:05 mgovers