First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!

Ask Your Question
1

How to create a N-1 generator contingency list that enumerates every single generator in a subsystem?

asked Aug 14 '14

ypwang gravatar image

Hello everyone,

I wanted to create a N-1 generator contingency list that enumerates every single generator in a subsystem in PSS\E GUI. But when creating .con file, the only relevant option "single contingency" just create a single branch contingency list for me. I don't know why it doesn't also give me a single generator contingency list. Did I miss checking some options while creating .con file?

After searching one manual called "POM.pdf", I found a useful command "SINGLE MACHINE IN SUBSYSTEM 'SUBSYSNAME' ". But the problem is that it only trip the generator with largest capacity in each bus in the specific subsystem, not tripping every single generator as I wanted.

Does anyone happen to know how to fix this problem?

Your advice and comment would be greatly appreciated. Sincerely, -YP

1 answer

Sort by » oldest newest most voted
1

answered Aug 16 '14

ypwang gravatar image

updated Aug 18 '14

JervisW gravatar image

I figured out a way to create all N-1 generator contingency list by writing commands "REMOVE MACHINE [MCID] FROM BUS [BUSID]" explicitly one by one to the .con file. But my module I used in my problem is based on the possibility that you know how to associated a GUI defined subsystem label to a valid subsystem id (0~11). Right now, I use the whole working case as a subsystem, so that the subsystem id is equal to -1.

def createConFile(psspy, conFileName, subsysID, subSysLabel):

    # manipute with working case data- all returned data are in the same order
    ierr, (allMachID,) = psspy.amachchar(subsysID, 4, 'ID')   # return total number of machines in working case
    print "machID =", allMachID

    ierr, (busNums,) = psspy.amachint(subsysID, 4, 'NUMBER') 
    print "list of bus numbers ", busNums

    conFile = open(conFileName, 'w')

    # .con file header
    conFile.write("/PSS(R)E 33\n")
    conFile.write("COM\n")
    conFile.write("COM CONTINGENCY description file entry created by PSS(R)E Config File Builder \n")
    conFile.write("COM\n")
    conFile.write("SINGLE BRANCH IN SUBSYSTEM '%s' \n\n" % subSysLabel)

    # contingencies for removing each specified machine 
    for machid, busnum in zip(allMachID, busNums): 
        conFile.write("CONTINGENCY 'MACHINE %d-BUS%d' \n" %( int(machid), busnum))
        conFile.write('REMOVE MACHINE %s FROM BUS %d \n' %(machid, busNum))
        conFile.write('END \n\n')

    conFile.write('END')
    conFile.close()

Hope someone will find this helpful.

link

Comments

Looks like a good solution! I hope that one day PSS/e provides a direct API for this rather than requiring us to write out physical files.

JervisW gravatar imageJervisW (Aug 18 '14)

I hope so too. This way will make PSS\E more friendly to users. And thanks so much for your neat editing of my code!

ypwang gravatar imageypwang (Aug 18 '14)

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.
Want to format code in your answer? Here is a one minute demo on Youtube

Add Answer

[hide preview]

Question Tools

Stats

Asked: Aug 14 '14

Seen: 4,846 times

Last updated: Aug 17 '14