PowerModelsDistribution.jl
PowerModelsDistribution.jl copied to clipboard
Four wire native pf
ADD native power flow solver
This PR is to support native power flow solver using a fixed-point iteration current injection method. This implementation was originally developed by @sanderclaeys and was finished in collaboration with @frederikgeth.
Key features and limitations:
- 4 wire supported, same unit tests as in PMD
en_pf_validation.jl
, identical results to OpenDSS - unit tests added in file
en_pf_native_validation.jl
- no automatic relaxation of the load model at low/high voltages (conversely to OpenDSS), which means convergence can be troubling in hard cases. If there is interest we can add it later, but tests don't break at this stage.
- Now uses KLU for factorization, adding LinearSolve.jl as a new dependency.
- Added test script (to be converted into Jupyter notebook) that calls ieee 13-34-123 and enwl (4-wire) test cases of nontrivial size
As part of the development we identified an issue in the impedance matrices for voltage sources which is inconsistent with OpenDSS. We opened issue #376. Note that the current PR does include a workaround for this issue.
We will share the draft technical report with algorithm details, and we are happy to merge this into the documentation if that's the preferred way of going forward.
Codecov Report
Merging #375 (e74d9b8) into main (ad76f69) will increase coverage by
0.90%
. The diff coverage is65.15%
.
@@ Coverage Diff @@
## main #375 +/- ##
==========================================
+ Coverage 72.49% 73.40% +0.90%
==========================================
Files 61 65 +4
Lines 15693 16248 +555
==========================================
+ Hits 11377 11927 +550
- Misses 4316 4321 +5
Impacted Files | Coverage Δ | |
---|---|---|
src/PowerModelsDistribution.jl | 100.00% <ø> (ø) |
|
src/core/data.jl | 68.61% <ø> (ø) |
|
src/core/types.jl | 100.00% <ø> (ø) |
|
src/data_model/units.jl | 87.39% <ø> (ø) |
|
src/data_model/transformations/misc.jl | 36.06% <36.06%> (ø) |
|
src/data_model/transformations/bounds.jl | 41.77% <41.77%> (ø) |
|
src/data_model/transformations/kron.jl | 49.39% <49.39%> (ø) |
|
src/data_model/transformations/initialization.jl | 89.33% <89.33%> (ø) |
|
src/prob/native_pf.jl | 93.69% <93.69%> (ø) |
|
src/data_model/math2eng.jl | 97.90% <100.00%> (ø) |
... and 4 files with indirect coverage changes
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
FWIW, I think the remaining test failure is independent of the changes in this PR. It's Ipopt finishing with ALMOST_LOCALLY_SOLVED instead of LOCALLY_SOLVED on MacOS only.
The problem with the unit test should be fixed, could you merge in the latest main branch to trigger the tests to run again?
the PR is updated from main and is ready for CI trigger.
The reason for fails are most likely the change in the short circuit MVA value of the testcase "gen_3ph_wye", which was 1E4, and I had to change it to 1E6 to pass the tests. It seems this may not be satisfactory for windows/ubuntu.
However, I have just tested all unit tests on a Windows machine (with MVASC1=1e6 MVASC3=1e6) and all unit tests pass.
The support for storage was now added. We're happy for you to merge, and then we'll post the report on arXiv and reference it here. We confirmed the IEEE test cases still have the same behavior as before your changes.
After the merge we'll move on to the remaining features, e.g. load model relaxation
One final issue I just found was that the new Enum ITERATION_LIMIT interferes with the one imported from MathOptInterface. My suggestion is that these Enums get changed to PF_CONVERGED and PF_ITERATION_LIMIT. If you are okay with this (or have a suggestion for a different name), I can make the change myself and merge it in.
No issues at all renaming the ENUMs. Go for it!