Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deliver i and v values on DC loadflows #907

Open
nicow-elia opened this issue Dec 3, 2024 · 0 comments
Open

Deliver i and v values on DC loadflows #907

nicow-elia opened this issue Dec 3, 2024 · 0 comments

Comments

@nicow-elia
Copy link

Describe the current behavior

When running DC loadflows, powsybl currently returns NaN for net.get_branches()["i1"] and net.get_buses()["v_mag"]

Describe the expected behavior

While it's correct that the DC loadflows don't return q values, v and i values are actually defined in the DC loadflow framework. v is defined to be just v_nominal and hence I can be computed through i = p / (sqrt(3) * v_nominal).

It would be nice if these values are returned, both for the normal loadflows and for the security analysis, as it makes comparing with current limits easier. Especially the i value is important there but logically the v_mag value could also be returned.

Describe the motivation

No response

Extra Information

A simple implementation in python could look like this

injections = pd.merge(
    left=net.get_injections(),
    right=net.get_voltage_levels()["nominal_v"],
    left_on="voltage_level_id",
    right_index=True,
)
injections["i"] = (
    injections["p"] / (injections["nominal_v"] * math.sqrt(3) * 1e-3)
).abs()
del injections["nominal_v"]

and

branches = pd.merge(
    left=net.get_branches(),
    right=net.get_voltage_levels()["nominal_v"].rename("nominal_v_1"),
    left_on="voltage_level1_id",
    right_index=True,
)
branches = pd.merge(
    left=branches,
    right=net.get_voltage_levels()["nominal_v"].rename("nominal_v_2"),
    left_on="voltage_level2_id",
    right_index=True,
)
branches["i1"] = (
    branches["p1"] / (branches["nominal_v_1"] * math.sqrt(3) * 1e-3)
).abs()
branches["i2"] = (
    branches["p2"] / (branches["nominal_v_2"] * math.sqrt(3) * 1e-3)
).abs()
del branches["nominal_v_1"]
del branches["nominal_v_2"]
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

No branches or pull requests

1 participant