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

Add properties to get the line series and shunt currents #102

Merged
merged 1 commit into from
Jul 27, 2023

Conversation

alihamdan
Copy link
Member

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.

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:

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.

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 alihamdan added the enhancement New feature or request label Jul 27, 2023
@alihamdan alihamdan requested review from benoit9126 and Saelyos July 27, 2023 15:10
@alihamdan alihamdan self-assigned this Jul 27, 2023
@alihamdan alihamdan merged commit a61ed85 into develop Jul 27, 2023
@alihamdan alihamdan deleted the line-currents branch July 27, 2023 15:45
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
Development

Successfully merging this pull request may close these issues.

ENH: Expose the line series and shunt currents
2 participants