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

Ask Your Question
0

Do you know a better way to find an area's neighboring areas?

asked Aug 26 '14

ypwang gravatar image

updated Aug 28 '14

Hi all, I am thinking of using subsystem tie branch info to detect contiguous neighboring areas for a specified area and then check each tie branch to all neighboring areas for its "toBusId". Then find out which areas those "toBusID" reside.

1 answer

Sort by » oldest newest most voted
2

answered Aug 26 '14

ypwang gravatar image

updated Aug 26 '14

I just figured out a way to implement my idea above, let's say I want to find out all neighboring areas for area n:

# define subsystem n and let it only contains area n psspy.bsys(sid=n, usekv=0, numarea=1, areas=[n])

# fetch all tie branches for area n (i.e. subsystem n)
ierr, (frombus,) = psspy.abrnint(n, 1, 2, 3, 1, 'FROMNUMBER')
ierr, (tobus,) = psspy.abrnint(n, 1, 2, 3, 1, 'TONUMBER')

# combine fbus and tbus to one list
tiebuses = frombus + tobus
print "tiebuses", tiebuses

# fetch all bus numbers for entire system 
ierr, (busNums,) = psspy.abusint(-1, 1, 'NUMBER')
ierr, (busAreas,) = psspy.abusint(-1, 1, 'AREA')

# store area number for each toBusnum to a list
nbAreas = []    
for i in tiebuses:
    nbAreas.append(busAreas[busNums.index(i)])

# since nbAreas might contain duplicated area numbers, so remove duplications
nbAreas = list(set(nbAreas))
print "areasincludeCurrOne=", nbAreas

# remove area n itself
nbAreas.pop(nbAreas.index(n))
print nbAreas
link

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 26 '14

Seen: 403 times

Last updated: Aug 27 '14