Ask Your Question
0

How to find zero impedance branch lists

asked 2017-11-29 01:29:24 -0500

Song gravatar image

Dear

I would like to find the zero impdedance branch lists (From bus number, To bus number and ID)

Only for using "psspy.brch_2" ????

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-11-29 15:33:25 -0500

perolofl gravatar image

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()
edit flag offensive delete link more

Comments

Oh~thank you very much!!!

Song gravatar imageSong ( 2017-11-30 05:34:35 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

1 follower

Stats

Asked: 2017-11-29 01:29:24 -0500

Seen: 630 times

Last updated: Nov 29 '17