Repository navigation
Conversation
Signed-off-by: Benjamin Petrick <170433522+BenjPetr@users.noreply.github.com>
Signed-off-by: Benjamin Petrick <170433522+BenjPetr@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Reactance regularization corrupts valid negative reactances and tap susceptances while leaving DC-flow corrections inconsistent with the solver’s modified model.
3 open issues
What changed in this PR
This PR adds configurable reactance flooring to the Powsybl preprocessing backend to keep zero-reactance branches from producing undefined DC solver results.
Changes:
- Adds a nonnegative reactance threshold, defaulting to
1e-6, and passes it into the backend. - Floors branch reactances below the configured threshold.
- Adds a regression test checking finite susceptances and PTDF values for a zero-reactance line and transformer.
| File | Description |
|---|---|
packages/interfaces_pkg/src/toop_engine_interfaces/messages/preprocess/preprocess_commands.py |
Defines and documents the threshold parameter. |
packages/dc_solver_pkg/tests/preprocessing/test_powsybl_backend.py |
Tests zero-reactance branch handling and finite PTDF results. |
packages/dc_solver_pkg/src/toop_engine_dc_solver/preprocess/powsybl/powsybl_backend.py |
Accepts the threshold and applies reactance flooring. |
packages/dc_solver_pkg/src/toop_engine_dc_solver/preprocess/convert_to_jax.py |
Passes the preprocessing threshold to the Powsybl backend. |
Review effort: Balanced
| ) | ||
| branches[["p_max_mw", "p_max_mw_n_1"]] = get_p_max(self.net) | ||
| if self.zero_reactances_threshold > 0.0: | ||
| branches.loc[branches["x"] < self.zero_reactances_threshold, "x"] = self.zero_reactances_threshold |
Comment on lines
+225
to
+226
| if self.zero_reactances_threshold > 0.0: | ||
| branches.loc[branches["x"] < self.zero_reactances_threshold, "x"] = self.zero_reactances_threshold |
| ) | ||
| branches[["p_max_mw", "p_max_mw_n_1"]] = get_p_max(self.net) | ||
| if self.zero_reactances_threshold > 0.0: | ||
| branches.loc[branches["x"] < self.zero_reactances_threshold, "x"] = self.zero_reactances_threshold |
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.





Signed-off-by: Benjamin Petrick 170433522+BenjPetr@users.noreply.github.com
Checklist
Please check if the PR fulfills these requirements:
Does this PR already have an issue describing the problem?
Closes #838
What is the new behavior and why?
introduction of a zero reactance threshold parameter to handle data issues
Does this PR introduce a breaking change?