Conversation
|
Hi @m-mirz, Nice that you have discovered this problem. I would like to first start with a validation case. It would be nice if you can re-produce a minimal validation meshed case where:
Please first create a separate PR for this, we can then first merge the validation case. |
|
Hi @m-mirz , next to what @TonyXiang8787 asked in his comment, we are also curious if the validation case could show that the linear method produces results that are indeed far away from the real solution to the extent that NR iterations diverge. We ask because by varying the starting point between said point and the real solution, we should be able to see a behavioral change if everything else is workign as they should. |
|
@TonyXiang8787 I have added #1610 to show where NR does not converge from a linear start. When #1610 is merged, I would rebase this one here. |
Hi @m-mirz, the other one is already merged and I have done a down merge for this PR. In this PR you can remove the |
|
@TonyXiang8787 as mentioned in #1610, it looks like the merge was not triggered yet since my GPG signature was missing on the commit. I fixed it and now I am waiting for #1610 to get merged. |
The linear voltage guess that Newton-Raphson starts from can make it diverge on meshed transmission grids that a flat start solves. The new power_flow_initialization option selects the start: linear (default, unchanged) or flat. See the new Initialization section in docs/algorithms/pf-algorithms.md for details. - C API: PGM_PowerFlowInitialization and PGM_set_power_flow_initialization, plus the C++ wrapper setter. - Python: PowerFlowInitialization enum; calculate_power_flow accepts power_flow_initialization as the enum or its name. - Tests: C++ solver tests for the flat start, including a voltage regulator case; Python test for each option value. Signed-off-by: Markus Mirz <16180422+m-mirz@users.noreply.github.com>
The MATPOWER IEEE 300-bus case converges from a flat start but diverges from the linear start, also with a stiff source. The case is added twice, with power_flow_initialization flat and linear; the linear one is marked xfail with IterationDiverge. The expected output is the MATPOWER power flow solution; see the case README for source and conversion. - Python and C++ validation tests read power_flow_initialization from params.json. - IterationDiverge can be named in xfail/raises of Python validation cases. Signed-off-by: Markus Mirz <16180422+m-mirz@users.noreply.github.com>
8c150ff to
5ae220b
Compare
|
Now that #1610 is merged, I have rebased and GPG signed the commits. I have also removed the xfail test so that only the passing test remains. |
The flat-start case now covers the MATPOWER IEEE 300-bus system, so the xfail linear-start case is removed and the flat-start case moves up to the case directory. The README keeps the note that Newton-Raphson diverges from the linear start on this case. Signed-off-by: Markus Mirz <16180422+m-mirz@users.noreply.github.com>
Generalize the Newton-Raphson start option so it can be reused by other calculation types and methods: - PowerFlowInitialization -> CalculationInitialization (C++, C API, Python) - power_flow_initialization -> calculation_initialization (options, PGM_set_calculation_initialization, Python keyword argument) - add a `default` value (0) that selects the default initialization of the calculation method (linear for Newton-Raphson); flat = 1, linear = 2 - `default` is a C++ keyword, so the C++ enumerator is named default_initialization, following CalculationMethod::default_method Signed-off-by: Markus Mirz <16180422+m-mirz@users.noreply.github.com>
3b2d3c1 to
43ceea9
Compare
|
@TonyXiang8787 and @mgovers I have accepted your changes and also applied similar changes in a few more places to make sure it is consistent. |
Use the source reference angle in the flat start. Signed-off-by: Markus Mirz <16180422+m-mirz@users.noreply.github.com>
|
Hi @m-mirz, Thanks for the update. Please fix the build errors, and then I think the PR is in good shape. |
Signed-off-by: Markus Mirz <16180422+m-mirz@users.noreply.github.com>
88e39a1 to
b01f5cc
Compare
|
@TonyXiang8787 I think that I've just fixed the CI issues but CI checks are awaiting approval. |
The linear voltage guess that Newton-Raphson starts from can make it diverge on meshed transmission grids that a flat start solves. The new power_flow_initialization option selects the start: linear (default, unchanged) or flat. See the new Initialization section in docs/algorithms/pf-algorithms.md for details.
Partially fixes #1595 and should be merged and rebased after #1610
Relates to #549