Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I didn't find any API returning ZILs so I wrote my own:

def get_zil(sid=-1):
    """ Returns ibus, jbus and id for zero impedance lines in three lists
    """
    ierr, thrshz = psspy.prmdat('THRSHZ')
    ierr, iarray = psspy.abrnint(sid, string=['FROMNUMBER','TONUMBER'])
    ierr, carray = psspy.abrnchar(sid,entry=1, string='ID')
    ierr, cmplxarray = psspy.abrncplx(sid, string=['RX'])
    ibl = []
    jbl = []
    idl = []
    for ibus,jbus,id,z in zip(iarray[0],iarray[1],carray[0],cmplxarray[0]):
        if z.real==0. and abs(z.imag)<=thrshz:
            ibl.append(ibus)
            jbl.append(jbus)
            idl.append(id)
    return ibl,jbl,idl

Create lists with:

ibusl,jbusl,idl = get_zil()