makeBdc

makeBdc(baseMVA, bus, branch)

makeBdc() - Builds the B matrices and phase shift injections for DC power flow.

[BBUS, BF, PBUSINJ, PFINJ] = MAKEBDC(MPC)
[BBUS, BF, PBUSINJ, PFINJ] = MAKEBDC(BASEMVA, BUS, BRANCH)

Returns the B matrices and phase shift injection vectors needed for
a DC power flow. The bus real power injections are related to bus
voltage angles by
    P = BBUS * Va + PBUSINJ
The real power flows at the from end the lines are related to the bus
voltage angles by
    Pf = BF * Va + PFINJ
Does appropriate conversions to p.u.
Bus numbers must be consecutive beginning at 1 (i.e. internal ordering).

Example:
    [Bbus, Bf, Pbusinj, Pfinj] = makeBdc(baseMVA, bus, branch);

See also dcpf().