Based on AugYbus.m from MatDyn by Stijn Cole, developed at
        Katholieke Universiteit Leuven. See U{http://www.esat.kuleuven.be/
        electa/teaching/matdyn/} for more information.

        @rtype: csr_matrix
        @return: The augmented bus admittance matrix.

def getAugYbus(self, U0, gbus):
        """ Based on AugYbus.m from MatDyn by Stijn Cole, developed at
        Katholieke Universiteit Leuven. See U{http://www.esat.kuleuven.be/
        electa/teaching/matdyn/} for more information.

        @rtype: csr_matrix
        @return: The augmented bus admittance matrix.
        """
        j = 0 + 1j
        buses = self.case.connected_buses
        nb = len(buses)

        Ybus, _, _ = self.case.getYbus()

        # Steady-state bus voltages.

        # Calculate equivalent load admittance
        Sd = array([self.case.s_demand(bus) for bus in buses])
        Yd = conj(Sd) / abs(U0)**2

        xd_tr = array([g.xd_tr for g in self.dyn_generators])

        # Calculate equivalent generator admittance.
        Yg = zeros(nb)
        Yg[gbus] = 1 / (j * xd_tr)

        # Add equivalent load and generator admittance to Ybus matrix
        for i in range(nb):
            Ybus[i, i] = Ybus[i, i] + Yg[i] + Yd[i]

        return Ybus