Skip to content

Commit

Permalink
fix unbalanced powerflow with out ouf service ext grids
Browse files Browse the repository at this point in the history
  • Loading branch information
dlohmeier committed Dec 7, 2023
1 parent 2da47f3 commit 690b0aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pandapower/auxiliary.py
Original file line number Diff line number Diff line change
Expand Up @@ -1242,8 +1242,8 @@ def SVabc_from_SV012(S012, V012, n_res=None, idx=None):
idx = np.ones(n_res, dtype="bool")
I012 = np.array(np.zeros((3, n_res)), dtype=np.complex128)
I012[:, idx] = I_from_SV_elementwise(S012[:, idx], V012[:, idx])
Vabc = sequence_to_phase(V012[:, idx])
Iabc = sequence_to_phase(I012[:, idx])
Vabc = sequence_to_phase(V012)
Iabc = sequence_to_phase(I012)
Sabc = S_from_VI_elementwise(Vabc, Iabc)
return Sabc, Vabc

Expand Down
3 changes: 2 additions & 1 deletion pandapower/results_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def _get_ext_grid_results(net, ppc):

return b, p, q


def _get_ext_grid_results_3ph(net, ppc0, ppc1, ppc2):
# get results for external grids
eg_is_mask = net["_is_elements"]['ext_grid']
Expand All @@ -124,7 +125,7 @@ def _get_ext_grid_results_3ph(net, ppc0, ppc1, ppc2):
* ppc["gen"][eg_idx_ppc, QG]) \
for ppc in [ppc0, ppc1, ppc2]])

Sabc, Vabc = SVabc_from_SV012(S012, V012/ np.sqrt(3), n_res=n_res_eg, idx=eg_idx_ppc)
Sabc, Vabc = SVabc_from_SV012(S012, V012 / np.sqrt(3), n_res=n_res_eg, idx=eg_idx_ppc)

pA, pB, pC = map(lambda x: x.flatten(), np.real(Sabc))
qA, qB, qC = map(lambda x: x.flatten(), np.imag(Sabc))
Expand Down

0 comments on commit 690b0aa

Please sign in to comment.