pwrs.core.makeB#

pwrs.core.makeB.makeB_pair(baseMVA, bus=None, branch=None, alg=None)[source]#

Return (Bp, Bpp) with explicit Python semantics.

pwrs.core.makeB.makeB_matrix(baseMVA, bus=None, branch=None, alg=None)[source]#

Return Bp only with explicit Python semantics.

pwrs.core.makeB.makeB(baseMVA, bus=None, branch=None, alg=None, *, nargout=None)[source]#

Build fast-decoupled power flow B' and B'' matrices.

Mirrors MATPOWER’s makeB helper by constructing the susceptance matrices used by the FDXB or FDBX fast-decoupled power flow algorithms.

Parameters:
  • baseMVA (float or dict) – System base MVA, or a MATPOWER case struct.

  • bus (array_like or str, optional) – Bus matrix, or algorithm selector when baseMVA is a case struct.

  • branch (array_like, optional) – Branch matrix when baseMVA is not a case struct.

  • alg (str or numeric, optional) – Fast-decoupled variant, 'FDXB' or 'FDBX'.

  • nargout (int, optional) – MATLAB compatibility flag controlling whether both Bp and Bpp are returned.

Returns:

Bp alone, or (Bp, Bpp) when nargout > 1.

Return type:

scipy.sparse.spmatrix or tuple