gausspf

gausspf(Ybus, Sbus, V0, ref, pv, pq, mpopt)

gausspf() - Solves the power flow using a Gauss-Seidel method.

[V, CONVERGED, I] = GAUSSPF(YBUS, SBUS, V0, REF, PV, PQ, MPOPT)
solves for bus voltages given the full system admittance matrix (for
all buses), the complex bus power injection vector (for all buses),
the initial vector of complex bus voltages, and column vectors with
the lists of bus indices for the swing bus, PV buses, and PQ buses,
respectively. The bus voltage vector contains the set point for
generator (including ref bus) buses, and the reference angle of the
swing bus, as well as an initial guess for remaining magnitudes and
angles. MPOPT is a MATPOWER options struct which can be used to
set the termination tolerance, maximum number of iterations, and
output options (see MPOPTION for details). Uses default options
if this parameter is not given. Returns the final complex voltages,
a flag which indicates whether it converged or not, and the number
of iterations performed.

See also runpf().