9.5 Forming Standard Power Systems Matrices

9.5.1 makeB

[Bp, Bpp] = makeB(mpc, alg)
[Bp, Bpp] = makeB(baseMVA, bus, branch, alg)

The makeB function builds the two matrices and used in the fast-decoupled power ﬂow. The alg, which can take values 'FDXB' or 'FDBX', determines whether the matrices returned correspond to the XB or BX version of the fast-decoupled power ﬂow. Bus numbers must be consecutive beginning at 1 (i.e. internal ordering).

9.5.2 makeBdc

[Bbus, Bf, Pbusinj, Pfinj] = makeBdc(mpc)
[Bbus, Bf, Pbusinj, Pfinj] = makeBdc(baseMVA, bus, branch)

The function builds the matrices, (Bbus) and (Bf), and phase shift injections, (Pbusinj) and (Pfinj), for the DC power ﬂow model as described in (3.29) and (4.15). Bus numbers must be consecutive beginning at 1 (i.e. internal ordering).

9.5.3 makeJac

J = makeJac(mpc)
J = makeJac(mpc, fullJac)
[J, Ybus, Yf, Yt] = makejac(mpc)

The makeJac function forms the power ﬂow Jacobian and, optionally, the system admittance matrices. Bus numbers in the input case must be consecutive beginning at 1 (i.e. internal indexing). If the fullJac argument is present and true, it returns the full Jacobian (sensitivities of all bus injections with respect to all voltage angles and magnitudes) as opposed to the reduced version used in the Newton power ﬂow updates.

9.5.4 makeLODF

PTDF = makePTDF(mpc)
LODF = makeLODF(mpc.branch, PTDF)

The makeLODF function forms the DC line outage distribution factor matrix for a given PTDF. The matrix is , where is the number of branches. See Section 4.5 on Linear Shift Factors for more details.

9.5.5 makePTDF

H = makePTDF(mpc)
H = makePTDF(mpc, slack)
H = makePTDF(baseMVA, bus, branch)
H = makePTDF(baseMVA, bus, branch, slack)

The makePTDF function returns the DC PTDF matrix for a given choice of slack. The matrix is , where is the number of branches and is the number of buses. The slack can be a scalar (single slack bus) or an column vector of weights specifying the proportion of the slack taken up at each bus. If the slack is not speciﬁed, the reference bus is used by default. Bus numbers must be consecutive beginning at 1 (i.e. internal ordering). See Section 4.5 on Linear Shift Factors for more details.

9.5.6 makeYbus

[Ybus, Yf, Yt] = makeYbus(mpc)
[Ybus, Yf, Yt] = makeYbus(baseMVA, bus, branch)

The makeYbus function builds the bus admittance matrix and branch admittance matrices from (3.11)–(3.13). Bus numbers in the input case must be consecutive beginning at 1 (i.e. internal indexing).