pandapower
pandapower copied to clipboard
rundcpp uses real(spsolve(A, b)) instead of spsolve(real(A), real(b))
Feature Checklist
-
[X] Searched the issues page for similar reports
-
[X] Read the relevant sections of the documentation
-
[X] Browse the tutorials and tests for usefull code snippets and examples of use
Issue
Looking at the dcpf
function in pandapower.pypower.dcpf, line 44, it says
Va[pvpq] = real(spsolve(pvpq_matrix, ref_matrix))
We ran some tests, the pvpq_matrix always comes with zeros in all imaginary components, whereas the ref_matrix (which is a vector, not a matrix - maybe change nomenclature?) has non-zero imaginary components. Our question is now, is this intended behaviour? The results differ only marginally. Wouldn't it make more sense to use spsolve on real numbers only, like:
Va[pvpq] = spsolve(real(pvpq_matrix), real(ref_matrix))
This way, the spsolve method is not burdened with complex numbers while the DC approximation per definition is in real-valued numbers.
Label
- [ ] Relevant labels are selected