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
An ideal source is represented by having infinite short circuit power (sk). However, the current implementation of the power-grid-model will raise a validation error when sk == inf:
This ticket is about supporting ideal sources for power flow and state estimation calculation types. (And undefined behavior for short circuit calculations.)
Background
When sk is extremely large but not infinite (e.g. sk == 10e50), the power flow and state estimation calculation types are already numerically stable, cfr. #458 . Unfortunately, this value is arbitrarily set. We currently require our users to provide such an arbitrarily large value when they desire an ideal source. Even more so, within the PGM, intermediate calculations may cause an arbitrarily large value to become infinite, e.g.:
10e200 * 10e200 = 10e400 > std::numeric_limits<double>::max() (~10e306) => 10e200 * 10e200 will result in inf
A single such inf value in the internal calculations will result in NaN values in the output, i.e. nonsense output.
Desired solution
Cap the sk to some fixed non-infinite value so that it does not results in NaN output values but still mimics ideal sources well enough for realistic/practical purposes. This allows users to provide inf to request an ideal source.
Create a static constexpr double ideal_source_sk = 10e50; constant.
Note that this is arbitrarily chosen (mention this in a comment)
This value is so large that it does not affect numerical stability for practical use cases, while still being small enough to never cause infinities and NaN values in the calculations. (please verify with simple examples)
In the constructor of the Source component type, set sk to the minimum of the user-specified sk and ideal_source_sk.
Note that this is only correct for power flow and state estimation
For short circuit calculations, the sk heavily influences the calculation result, and we consider this to be undefined behavior (UB; see below)
Update the validation cases
Support sk == inf for power flow and state estimation
Do not support sk == inf and sk > 10e50 for short circuit calculations due to deliberately UB
In the documentation on the Source component type :
Mention that unrealistically large sk (sk > 10e50) results in UB for short circuit calculations, because the sk heavily affects the short circuit calculation results.
The text was updated successfully, but these errors were encountered:
Describe the feature request
An ideal source is represented by having infinite short circuit power (
sk
). However, the current implementation of the power-grid-model will raise a validation error whensk == inf
:This ticket is about supporting ideal sources for power flow and state estimation calculation types. (And undefined behavior for short circuit calculations.)
Background
When
sk
is extremely large but not infinite (e.g.sk == 10e50
), the power flow and state estimation calculation types are already numerically stable, cfr. #458 . Unfortunately, this value is arbitrarily set. We currently require our users to provide such an arbitrarily large value when they desire an ideal source. Even more so, within the PGM, intermediate calculations may cause an arbitrarily large value to become infinite, e.g.:10e200 * 10e200 = 10e400 > std::numeric_limits<double>::max() (~10e306)
=>10e200 * 10e200
will result ininf
A single such
inf
value in the internal calculations will result inNaN
values in the output, i.e. nonsense output.Desired solution
Cap the
sk
to some fixed non-infinite value so that it does not results inNaN
output values but still mimics ideal sources well enough for realistic/practical purposes. This allows users to provideinf
to request an ideal source.static constexpr double ideal_source_sk = 10e50;
constant.sk
to the minimum of the user-specifiedsk
andideal_source_sk
.sk
heavily influences the calculation result, and we consider this to be undefined behavior (UB; see below)sk == inf
for power flow and state estimationsk == inf
andsk > 10e50
for short circuit calculations due to deliberately UBsk == inf
represents an ideal sourcesk
is capped at10e50
sk
(sk > 10e50
) results in UB for short circuit calculations, because thesk
heavily affects the short circuit calculation results.The text was updated successfully, but these errors were encountered: