code: def _run_power_flow(self, Ybus, Sbus, V, pv, pq, pvpq, **kw_args):
          
          Va = angle(V)
          Vm = abs(V)
  
          # Initial evaluation of F(x0)...
          F = self._evaluate_function(Ybus, V, Sbus, pv, pq)
          # ...and convergency check.
          converged = self._check_convergence(F)
  
          # Perform Newton iterations.
          i = 0
          while (not converged) and (i < self.iter_max):
              V, Vm, Va = self._one_iteration(F, Ybus, V, Vm, Va, pv, pq, pvpq)
              F = self._evaluate_function(Ybus, V, Sbus, pv, pq)
              converged = self._check_convergence(F)
              i += 1
  
          if converged:
              if self.verbose:
                  logger.info("Newton's method power flow converged in %d "
                              "iterations." % i)
          else:
              logger.error("Newton's method power flow did not converge in %d "
                           "iterations." % i)
  
          return V, converged, i
docs: Solves the power flow using a full Newton's method.