pwrs.core.pfsoln#

pwrs.core.pfsoln.pfsoln(baseMVA, bus0, gen0, branch0, Ybus, Yf, Yt, V, ref, pv, pq, mpopt=None)[source]#

Update bus, gen and branch matrices to match a power flow solution.

Parameters:
  • baseMVA (float) – System base MVA.

  • bus0 (array_like) – Original MATPOWER bus matrix.

  • gen0 (array_like) – Original MATPOWER generator matrix.

  • branch0 (array_like) – Original MATPOWER branch matrix.

  • Ybus (array_like or sparse matrix) – Full system admittance matrix.

  • Yf (array_like or sparse matrix) – Branch admittance matrix for currents injected at the from end.

  • Yt (array_like or sparse matrix) – Branch admittance matrix for currents injected at the to end.

  • V (array_like) – Solved complex bus voltage vector.

  • ref (array_like) – Reference bus index vector.

  • pv (array_like) – PV bus index vector.

  • pq (array_like) – PQ bus index vector.

  • mpopt (dict, optional) – MATPOWER options dict.

Returns:

(bus, gen, branch) updated to reflect the solved voltage, generator dispatch and branch flow results.

Return type:

tuple