pwrs.core.get_losses#

pwrs.core.get_losses.get_losses_full(baseMVA, bus=None, branch=None)[source]#

Return (loss, fchg, tchg, dloss_dV, dchg_dVm).

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

Compute branch series losses and charging injections.

It returns complex series losses for each branch, and optionally the line charging injections and their voltage derivatives.

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

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

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

  • nargout (int, optional) – MATLAB compatibility flag controlling how many auxiliary outputs are returned.

Returns:

Complex branch loss vector, optionally followed by charging terms and derivative dictionaries.

Return type:

numpy.ndarray or tuple