Skip to content

[FEATURE] Ideal source handling #733

Closed

Description

@mgovers

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 when sk == inf:
image

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.

Activity

  1. added
    featureNew feature or request
    good first issueIndicates a good issue for first-time contributors
    on Sep 24, 2024
  2. VITA2aishu commented on Sep 14, 2026

    @VITA2aishu
    Contributor

    Hi, I’m interested in working on this issue. I’d be happy to implement the ideal source handling along with the required validation tests and documentation updates. Please let me know if I can take this up.

  3. Jerry-Jinfeng-Guo commented on Sep 17, 2026

    @Jerry-Jinfeng-Guo
    Member

    Hi @VITA2aishu , thank you for your interest in this feature. It is indeed available. Please let us know if you need any help in the process. As a reminder, please make sure that your commits are signed and certified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or requestgood first issueIndicates a good issue for first-time contributors

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions