Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I have found that looping through the contingencies in the .acc file, then looping through the branches for each contingency, then comparing to the "BASE CASE" contingency is the best approach. if you find that one of the distribution factors satisfies some criteria, then you can do what you like with the branch, outage, flow, df, information. (version 34) Here is a snippet that effectively does this. 3phaseee.com

# -- GET CONTINGENCY LABELS, BRANCHES AND BUSES FROM SUMMARY ------------------------------
accobject = arrbox.accc_pp.CONTINGENCY_PP(n1accfnames[j])
accsummary = accobject.summary()
conlabels = accsummary.colabel
branches = list(accsummary.melement)
buses = list(accsummary.mvbuslabel)

# -- GET N-0 RESULTS ----------------------------------------------------------------------
n0results = accobject.solution('BASE CASE')
n0volts = n0results.volts
n0flows = list(n0results.ampflow)

# -----------------------------------------------------------------------------------------
# -- CHECK N-1 RESULTS FOR IMPACTED BUSES AND BRANCHES ------------------------------------
# -----------------------------------------------------------------------------------------
for prilabel in conlabels[1:]:
    results = accobject.solution(prilabel)
    pridesc = list(results.codesc)
    n1volts = results.volts
    n1flows = list(results.ampflow)

    if not results.cnvflag: continue
    for f in range(len(branches)):
        getcon = False
        if n1flows[f] == 0.0:
            continue
        df = abs((n1flows[f] - n0flows[f]) / n0flows[f])
        if df > screenDF:
            getcon = True
        if not getcon:
            getcon = True in [abs(n1volts[v] - n0volts[v]) > screenVF for v in range(len(buses))]
        if getcon:   ....................