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

ENH: Expose the line series and shunt currents #99

Closed
alihamdan opened this issue Jul 20, 2023 · 0 comments · Fixed by #102 or #124
Closed

ENH: Expose the line series and shunt currents #99

alihamdan opened this issue Jul 20, 2023 · 0 comments · Fixed by #102 or #124
Assignees
Labels
enhancement New feature or request

Comments

@alihamdan
Copy link
Member

For a line with shunt elements, there is no public API that exposes the currents that flow in the series components and those in the shunt components. We have these values internally but we don't expose them yet.

To make them public we need to:

  • Add res_shunt_currents and res_series_currents properties to the Line class
  • Modify the res_lines_losses data frame on the electrical network to include the currents

For a simplified line with no shunt components, the series currents are equal to the currents from buses 1 & 2 and the shunt currents are zero.

@alihamdan alihamdan added the enhancement New feature or request label Jul 20, 2023
@alihamdan alihamdan self-assigned this Jul 20, 2023
alihamdan added a commit that referenced this issue Jul 27, 2023
Fixes #99

The `Line` class gained two new properties:
1. `res_series_currents`: An array of currents in the series components of the line
2. `res_shunt_currents`: A 2-tuple of arrays of currents in the shunt components from
   each side of the line

The `ElectricalNetwork` now has a `res_lines` property that replaces `res_lines_losses`.
The new property contains all columns from `res_branches` in addition to the columns
`series_losses` and `series_current`. The columns `shunt_losses` and `total_losses` have
been removed but can be easily computed.
```py
df = en.res_lines
total_losses = df["power1"] + df["power2"]
shunt_losses = total_losses - df["series_losses"]
```

In addition, the shunt currents can be computed with:
```py
shunt_currents1 = df["current1"] - df["series_current"]
shunt_currents2 = df["series_current"] + df["current2"]
```

The detailed shunt losses/currents always remain accessible on the line element itself.
alihamdan added a commit that referenced this issue Jul 27, 2023
Fixes #99

The `Line` class gained two new properties:
1. `res_series_currents`: An array of currents in the series components
of the line
2. `res_shunt_currents`: A 2-tuple of arrays of currents in the shunt
components from each side of the line

The `ElectricalNetwork` now has a `res_lines` property that replaces
`res_lines_losses`. The new property contains all columns from
`res_branches` in addition to the columns `series_losses` and
`series_current`. The columns `shunt_losses` and `total_losses` have
been removed but can be easily computed.
```py
df = en.res_lines
total_losses = df["power1"] + df["power2"]
shunt_losses = total_losses - df["series_losses"]
```

In addition, the shunt currents can be computed with:
```py
shunt_currents1 = df["current1"] - df["series_current"]
shunt_currents2 = df["series_current"] + df["current2"]
```

The detailed shunt losses/currents always remain accessible on the line
element itself.
@benoit9126 benoit9126 linked a pull request Aug 29, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
1 participant