pwrs.core.gausspf#

pwrs.core.gausspf.gausspf(Ybus, Sbus, V0, ref, pv, pq, mpopt=None)[source]#

Solve an AC power flow using the Gauss-Seidel method.

Mirrors MATPOWER’s gausspf solver by iteratively updating PQ-bus and PV-bus voltages with Gauss-Seidel sweeps until the power mismatch meets the configured tolerance.

Parameters:
  • Ybus (array_like or sparse matrix) – Bus admittance matrix.

  • Sbus (array_like) – Complex bus power injections.

  • V0 (array_like) – Initial complex bus voltage vector.

  • ref (array_like) – One-based reference bus indices.

  • pv (array_like) – One-based PV bus indices.

  • pq (array_like) – One-based PQ bus indices.

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

Returns:

(V, converged, iterations).

Return type:

tuple