pandapower icon indicating copy to clipboard operation
pandapower copied to clipboard

rundcpp uses real(spsolve(A, b)) instead of spsolve(real(A), real(b))

Open nicow-elia opened this issue 1 year ago • 0 comments

Feature Checklist

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

nicow-elia avatar Aug 10 '23 13:08 nicow-elia