fix(backend): diagram-path LF outer-loop cap 20→100 + RONCI/BEON reproducibility docs#179
Merged
Merged
Conversation
…N reproducibility docs The N-1 diagram / overload path runs create_olf_rte_parameter() (lib make_env_utils), which keeps OpenLoadFlow's stock maxOuterLoopIterations=20. On the full French grid the IncrementalTransformerVoltageControl outer loop needs ~40-50 iterations to settle after tripping P.SAOL31RONCI, so slow-mode AC returned MAX_ITERATION_REACHED / null flows. _run_ac_with_fallback now forces maxOuterLoopIterations=100 -- the single choke point behind every create_olf_rte_parameter() call site (_get_n_variant, _get_contingency_variant, diagram_mixin) -- mirroring the lib analysis path's _create_default_lf_parameters (already 100). Convergence-only: grids that already converged are unchanged and the grid2op analysis path is untouched. Slow mode now converges (BEON L31CPVAN 95.84%, was null flows); fast mode unchanged (95.38%). Docs/script: - docs/architecture/ronci-beon-reproducibility.md: reference values per grid (reduced 98.75% / full 96.10%), the parameters_hades2 SecurityAnalysis recipe, fast/slow modes, the 95.84->96.10% decomposition (LF params / contingencyPropagation / Hades2 solver), the CHALOY631 remedial action, and the pypowsybl-rte / native-Hades2 situation. - scripts/reproduce_ronci_overload.py: reproduces all three references via the Hades2 SecurityAnalysis recipe to <0.04 A. - simulation-pipeline.md + docs/README.md: cross-links and a diagram-path caveat. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What
maxOuterLoopIterationsto 100 on the backend's diagram / overload load-flow path.P.SAOL31RONCI→BEON L31CPVANoverload case (small + full French grid, incl. theCHALOY631remedial action).Why
The N-1 diagram / overload path runs
create_olf_rte_parameter()(libmake_env_utils), which keeps OpenLoadFlow's stockmaxOuterLoopIterations=20. On the full French grid theIncrementalTransformerVoltageControlouter loop needs ~40–50 iterations to settle after trippingP.SAOL31RONCI, so slow-mode AC returnedMAX_ITERATION_REACHED/ null flows (the "diverges, null flows everywhere" the operator hit when running without fast mode). The lib's grid2op analysis path (_create_default_lf_parameters) already raises this to 100 — only the diagram path was left at 20.The change
recommender_service._run_ac_with_fallbacknow forcesmaxOuterLoopIterations=100. This is the single choke point behind everycreate_olf_rte_parameter()call site (_get_n_variant,_get_contingency_variant,diagram_mixin×2), so one edit covers all of them.Verification
P.SAOL31RONCI:scripts/reproduce_ronci_overload.pyreproduces all three reference values via the Hades2 SecurityAnalysis recipe to < 0.04 A (reduced N-1 98.75 %, full N-1 96.10 %, full + CHALOY631 96.03 %).Reviewer notes
pypowsybl-rteprovides the bridge (and registers theHades2provider) but the native Hades2 module is not configured here, so the converged OpenLoadFlow value lands at 95.84–96.08 %. The remaining ~0.1 % betweenrun_ac(95.99 %) and the SecurityAnalysis reference (96.08 %) is entirely the SA-onlycontingencyPropagationflag — a SecurityAnalysis-internal effect that is not reproducible by opening breakers inrun_ac(tested; documented in the doc's factor-2 section).config_small_grid) is intentionally left as-is — it is a 93-VL Dijon reduction whose post-contingency redistribution doesn't preserve the full-grid flow.docs/architecture/ronci-beon-reproducibility.md.🤖 Generated with Claude Code