Exemplo n.º 1
0
def evalOneMax(individual):  # defining the objective function
    psspy.case(casestudy)
    for i in range(len(busidx0)):
        ierr = psspy.shunt_data(busidx0[i],
                                ID=1,
                                INTGAR=1,
                                REALAR1=0,
                                REALAR2=individual[i])
    psspy.fdns(OPTIONS1=0, OPTIONS5=0, OPTIONS6=1)

    PLOSS = 0
    for i in areas[0]:  # evaluating sum of losses in all areas
        ierr, area_loss = psspy.ardat(iar=i, string='LOSS')
        PLOSS = PLOSS + area_loss.real

    ierr, vpu = psspy.abusreal(-1, string="PU")
    vpu0 = vpu[0]
    JV = 0
    for i in range(nbus):
        if busidx[0][i] in busidx0:
            JV = JV + min(0, Vmin - vpu0[i])**2 + max(
                0, vpu0[i] - Vmax
            )**2  # Adding voltage limit, Vmin < V < Vmax, as a part of objective function
    W1, W2 = 1, 10
    J = W1 * PLOSS + W2 * JV
    # Objective function
    # print("  Loss %s" % PLOSS)

    return J,
Exemplo n.º 2
0
def control_cap(combination):
    for m in range(0, len(combination)):
        if combination[0] == 1:
            psspy.shunt_data(34, r"""1""", 1, [_f, 50])
        if combination[1] == 1:
            psspy.shunt_data(44, r"""1""", 1, [_f, 50])
        if combination[2] == 1:
            psspy.shunt_data(45, r"""1""", 1, [_f, 50])
        if combination[3] == 1:
            psspy.shunt_data(48, r"""1""", 1, [_f, 100])
        if combination[4] == 1:
            psspy.shunt_data(74, r"""1""", 1, [_f, 100])
        if combination[5] == 1:
            psspy.shunt_data(105, r"""1""", 1, [_f, 20])
def switchOffCap(shunt_bus_num):
    psspy.shunt_data(shunt_bus_num,r"""1""",1,[_f, 0])
def switchOnCap(shunt_bus_num):
    psspy.shunt_data(shunt_bus_num,r"""1""",1,[_f, 24.38]) # This value is given by PSSE which is different from the design document
Exemplo n.º 5
0
def control_cap(combination):
    for m in range(0, len(combination)):
        if combination[0] == 1:
            psspy.shunt_data(117, r""" 1""", 1, [_f, 345])
        if combination[1] == 1:
            psspy.shunt_data(120, r""" 1""", 1,
                             [_f, 65])  # this bus cannot be higher than 65
        if combination[2] == 1:
            psspy.shunt_data(154, r""" 1""", 1,
                             [_f, 54.5])  # this bus cannot be higher than 65
        if combination[3] == 1:
            psspy.shunt_data(173, r""" 1""", 1,
                             [_f, 63])  # this bus cannot be higher than 64
        if combination[4] == 1:
            psspy.shunt_data(179, r""" 1""", 1,
                             [_f, 55])  # this bus cannot be higher than 65
        if combination[5] == 1:
            psspy.shunt_data(248, r""" 1""", 1,
                             [_f, 55.6])  # this bus cannot be to high
Exemplo n.º 6
0
def switchOnCap(shunt_bus_num):
    psspy.shunt_data(
        shunt_bus_num, r"""1""", 1, [_f, 24.38]
    )  # This value is given by PSSE which is different from the design document
Exemplo n.º 7
0
def switchOffCap(shunt_bus_num):
    psspy.shunt_data(shunt_bus_num, r"""1""", 1, [_f, 0])
Exemplo n.º 8
0
def control_cap(busNumber,MVAR):
    psspy.shunt_data(busNumber,"1",1,[_f, -1*MVAR])
Exemplo n.º 9
0
def set_capbank_breaker_value(bus_num, breaker_status):
    # Configure capacitor bank breaker value (Switching ON/OFF)
    for i in range(0, len(bus_num)):
        if breaker_status[i] == 0:
            if bus_num[i] == 34:
                psspy.shunt_data(bus_num[i], r"""1""", 1, [_f, 0])
            elif bus_num[i] == 39:
                psspy.shunt_data(bus_num[i], r"""1""", 1, [_f, 0])
            elif bus_num[i] == 44:
                psspy.shunt_data(bus_num[i], r"""1""", 1, [_f, 10])
            elif bus_num[i] == 45:
                psspy.shunt_data(bus_num[i], r"""1""", 1, [_f, 10])
            elif bus_num[i] == 48:
                psspy.shunt_data(bus_num[i], r"""1""", 1, [_f, 0])
            elif bus_num[i] == 74:
                psspy.shunt_data(bus_num[i], r"""1""", 1, [_f, 12])
            elif bus_num[i] == 105:
                psspy.shunt_data(bus_num[i], r"""1""", 1, [_f, 0])
        elif breaker_status[i] == 1:
            # Capacity value of capacitor bank is given by PSS/E
            if bus_num[i] == 34:
                psspy.shunt_data(bus_num[i], r"""1""", 1, [_f, 50])
            elif bus_num[i] == 39:
                psspy.shunt_data(bus_num[i], r"""1""", 1, [_f, 50])
            elif bus_num[i] == 44:
                psspy.shunt_data(bus_num[i], r"""1""", 1, [_f, 50])
            elif bus_num[i] == 45:
                psspy.shunt_data(bus_num[i], r"""1""", 1, [_f, 50])
            elif bus_num[i] == 48:
                psspy.shunt_data(bus_num[i], r"""1""", 1, [_f, 100])
            elif bus_num[i] == 74:
                psspy.shunt_data(bus_num[i], r"""1""", 1, [_f, 100])
            elif bus_num[i] == 105:
                psspy.shunt_data(bus_num[i], r"""1""", 1, [_f, 20])