Skip to content

Commit

Permalink
Fix #39
Browse files Browse the repository at this point in the history
  • Loading branch information
gplessm committed Sep 12, 2017
1 parent 718ba8c commit bfa7186
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions edisgo/tools/pypsa_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -957,8 +957,10 @@ def process_pfa_results(network, pypsa):
q1 = abs(pypsa.lines_t['q1'])
p0 = abs(pypsa.lines_t['p0'])
p1 = abs(pypsa.lines_t['p1'])
network.results.pfa_p = p0.where(p0 > p1, p1)
network.results.pfa_q = q0.where(q0 > q1, q1)
s0 = (p0 ** 2 + q0 ** 2).applymap(sqrt)
s1 = (p1 ** 2 + q1 ** 2).applymap(sqrt)
network.results.pfa_p = p0.where(s0 > s1, p1)
network.results.pfa_q = q0.where(s0 > s1, q1)

# process results at nodes
generators_names = [repr(g) for g in
Expand Down

0 comments on commit bfa7186

Please sign in to comment.