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

feat: add substation transmission capacity calculation #500

Merged
merged 2 commits into from
Jun 15, 2021

Conversation

danielolsen
Copy link
Contributor

Pull Request doc

Purpose

Add a feature to calculate the maximum transmission capacity into or out of a substation. This can be helpful e.g. when working to troubleshoot feasibility for a new grid model, when designing a Grid for a new scenario, or when investigating capacity expansion candidates.

What the code is doing

In substations.py:

  • We create a copy of the grid.branch data frame which has additional columns for from_sub and to_sub.
  • We group on these from_sub and to_sub columns, and sum the branch capacities for branches 'from' and 'to' each substation, excluding branches which are 'from' and 'to' the same substation.
  • We reindex so that all substation IDs are present in each of the 'from' and 'to' summations.
  • Now that the indices are aligned, we sum the 'from' and 'to' summations and return.

Testing

New unit test added. It features branches which have opposite to/from bus IDs (summed appropriately), and one branch with to/from buses within the same substation (not counted in any substation's capacity).

Usage Example/Visuals

>>> from powersimdata.design.transmission.substations import calculate_substation_capacity
>>> from powersimdata import Grid
>>> grid = Grid("Western")
Reading bus.csv
Reading plant.csv
Reading gencost.csv
Reading branch.csv
Reading dcline.csv
Reading sub.csv
Reading bus2sub.csv
Reading zone.csv
>>> calculate_substation_capacity(grid)
sub_id
35000    453.21
35001    492.76
35002    584.01
35003    465.77
35004    662.52
          ...
41078    100.00
41079    100.00
41080    100.00
41081    100.00
41082    100.00
Length: 4786, dtype: float64

Time estimate

15 minutes.

@danielolsen danielolsen self-assigned this Jun 14, 2021
@BainanXia BainanXia requested a review from ywang303 June 15, 2021 00:04
@danielolsen danielolsen force-pushed the daniel/substation_capacity branch from 18bfcbf to 9648fca Compare June 15, 2021 19:05
Copy link
Collaborator

@BainanXia BainanXia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and thanks for adding tests!

@danielolsen danielolsen force-pushed the daniel/substation_capacity branch from 9648fca to b8d58f2 Compare June 15, 2021 19:33
@danielolsen danielolsen merged commit 40f302c into develop Jun 15, 2021
@danielolsen danielolsen deleted the daniel/substation_capacity branch June 15, 2021 19:38
@ywang303
Copy link
Contributor

looks great! Do we have zone level calculate_capacity built-in method?

@danielolsen
Copy link
Contributor Author

looks great! Do we have zone level calculate_capacity built-in method?

Not yet, no. I believe it would be relatively straightforward to implement in the same way: we would just replace the substation lookup with a zone lookup.

@ywang303
Copy link
Contributor

ywang303 commented Jun 15, 2021 via email

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

Successfully merging this pull request may close these issues.

4 participants