pwrs.core.makePTDF#
- pwrs.core.makePTDF.makePTDF(baseMVA, bus=None, branch=None, slack=None, bus_idx=None)[source]#
Build the DC PTDF matrix for a given choice of slack.
- Parameters:
baseMVA (float or dict) – System base MVA, or an MATPOWER case dict containing
baseMVA,busandbranch.bus (array_like, optional) – MATPOWER bus matrix, or the slack specification when
baseMVAis a case dict.branch (array_like, optional) – MATPOWER branch matrix, or
bus_idx/ transfer specification whenbaseMVAis a case dict.slack (int or array_like, optional) – Slack specification. A scalar selects a single slack bus. A length
nbvector specifies distributed slack weights. For the full PTDF case only, annb x nbmatrix may be supplied to define a bus-specific slack distribution for each PTDF column.bus_idx (array_like, optional) – Either a vector of bus indices identifying specific PTDF columns to compute, or a transfer matrix whose columns each sum to zero.
- Returns:
DC PTDF matrix. The default shape is
nbr x nb. If a transfer matrix or subset of buses is supplied, the number of columns matches the requested transfers or selected buses.- Return type:
numpy.ndarray
Notes
Bus numbers must use internal ordering, i.e. be consecutive starting at 1. If
bus_idxis a transfer matrix, each column defines a slack- independent transfer with zero column sum.See also
makeLODF,makeBdc