Beispiel #1
0
def calc_power(V, Ybus, Ibus):
    """

    :param V:
    :param Ybus:
    :param Ibus:
    :return:
    """
    # S = V * np.conj(Ybus * V - Ibus)
    # Y = Ybus.tocsr()
    S = calc_power_csr_numba(n=V.shape[0], Yp=Ybus.indptr, Yj=Ybus.indices, Yx=Ybus.data, V=V, I=Ibus, n_par=500)

    return S
Beispiel #2
0
def calc_power(V, Ybus, Ibus):
    """
    Compute the power from a voltage solution
    :param V: Voltages Vector
    :param Ybus: Admittance Matrix
    :param Ibus: Currents vector
    :return: Power injections
    """
    # S = V * np.conj(Ybus * V - Ibus)
    # Y = Ybus.tocsr()
    # return S
    return calc_power_csr_numba(n=V.shape[0],
                                Yp=Ybus.indptr,
                                Yj=Ybus.indices,
                                Yx=Ybus.data,
                                V=V,
                                I=Ibus,
                                n_par=500)