Based on ExciterInit.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: tuple
        @return: Exciter initial conditions.

def exciterInit(self, Xexc, Vexc):
        """ Based on ExciterInit.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: tuple
        @return: Exciter initial conditions.
        """
        exciters = self.exciters

        Xexc0 = zeros(Xexc.shape)
        Pexc0 = zeros(len(exciters))

        typ1 = [e.generator._i for e in exciters if e.model ==CONST_EXCITATION]
        typ2 = [e.generator._i for e in exciters if e.model == IEEE_DC1A]

        # Exciter type 1: constant excitation
        Efd0 = Xexc[typ1, 0]
        Xexc0[typ1, 0] = Efd0

        # Exciter type 2: IEEE DC1A
        Efd0 = Xexc[typ2, 0]
        Ka = array([e.ka for e in exciters])
        Ta = array([e.ta for e in exciters])
        Ke = array([e.ke for e in exciters])
        Te = array([e.te for e in exciters])
        Kf = array([e.kf for e in exciters])
        Tf = array([e.tf for e in exciters])
        Aex = array([e.aex for e in exciters])
        Bex = array([e.bex for e in exciters])
        Ur_min = array([e.ur_min for e in exciters])
        Ur_max = array([e.ur_max for e in exciters])

        U = Vexc[typ2, 0]

        Uf = zeros(len(typ2))
        Ux = Aex * exp(Bex * Efd0)
        Ur = Ux + Ke * Efd0
        Uref2 = U + (Ux + Ke * Efd0) / Ka - U
        Uref = U

        Xexc0[typ2, :] = c_[Efd0, Uf, Ur]
        Pexc0[typ2, :] = c_[Ka, Ta, Ke, Te, Kf, Tf, Aex, Bex,
                            Ur_min, Ur_max, Uref, Uref2]

        # Exciter type 3:

        # Exciter type 4:

        return Xexc0, Pexc0