Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pypower/makeBdc.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ def makeBdc(baseMVA, bus, branch):
t = branch[:, T_BUS] ## list of "to" buses
i = r_[range(nl), range(nl)] ## double set of row indices
## connection matrix
Cft = sparse((r_[ones(nl), -ones(nl)], (i, r_[f, t])), (nl, nb))
Cft = sparse((r_[ones(nl), -ones(nl)], (i, r_[f, t]-1)), (nl, nb))

## build Bf such that Bf * Va is the vector of real branch powers injected
## at each branch's "from" bus
Bf = sparse((r_[b, -b], (i, r_[f, t])), shape = (nl, nb))## = spdiags(b, 0, nl, nl) * Cft
Bf = sparse((r_[b, -b], (i, r_[f, t]-1)), shape = (nl, nb))## = spdiags(b, 0, nl, nl) * Cft

## build Bbus
Bbus = Cft.T * Bf
Expand Down