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

Adding multiple contingencies in SensitivitiyAnalysis.add_postcontingency_branch_flow_matrix fails #858

Open
tso-martin opened this issue Oct 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@tso-martin
Copy link

Describe the current behavior

When I pass list with multiple contingency ids in
SensitivityAnalysis.add_postcontingency_branch_flow_factor_matrix I get an Exception:
PyPowsyblError: java.lang.ArrayIndexOutOfBoundsException: Index 444 out of bounds for length 444.

If I pass a list with a single contingency id it works.

Describe the expected behavior

The sensitivity analysis should be conducted for each contingency id.

Describe the steps

import pypowsybl.network as pn
from pypowsybl.sensitivity import create_dc_analysis
network = pn.create_ieee30()
gens = list(network.get_generators().index)
lines = list(network.get_lines().index)
contingencies = ["L8-28-1","L23-24-1"]
analysis = create_dc_analysis()
analysis.add_single_element_contingencies(contingencies)
analysis.add_precontingency_branch_flow_factor_matrix(branches_ids=lines, variables_ids=gens, matrix_id='precontingency')
analysis.add_postcontingency_branch_flow_factor_matrix(branches_ids=lines, variables_ids=gens, contingencies_ids=contingencies, matrix_id='postcontingency')
result = analysis.run(network)

Environment

PyPowSybl 1.7.0
Windows 10

Relevant Log Output

No response

Extra Information

No response

@tso-martin tso-martin added the bug Something isn't working label Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant