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

Ask Your Question
2

How do I find all in-service branches connected to out of service buses?

asked Mar 22 '12

Daniel_Hillier gravatar image

While trying to solve a case PSSE presented me (rather quietly) with:

ERROR:  1 IN-SERVICE BRANCHES CONNECTED TO TYPE  4 BUS  65960 [CNOR011E    11.000]

So it is pretty obvious what I have done wrong here: I have an in-service branch connected to an out of service bus.

My question is how do I find the branch (and preferably any other offending buses and branches) using Python?

Comments

1

looks good

JervisW gravatar imageJervisW (Apr 3 '12)

2 answers

Sort by » oldest newest most voted
1

answered Mar 23 '12

chip gravatar image

Here's what I did:

  1. Find All buses
  2. Find In-Service buses
  3. Calculate Out-of-service buses using steps 1,2
  4. Create subsystem of out-of-service buses
  5. Find all in-service branches attached to subsystem

To test it, I created a system with 4 InService buses, 4 out-of-service buses, and a branch between every bus pair.

1. Find all buses

I'm abusing the basekv filter below just to select all buses.

# Find all buses
sid = 1
ierr = psspy.bsys(sid=sid, usekv=1, basekv=[0,1000]) 
ierr, all_buses = psspy.abusint(sid=sid, 
                                string=["NUMBER"], flag=2)
all_buses = all_buses[0]

2. Find in-service buses

# Find in-service buses
ierr, in_service_buses = psspy.abusint(sid=sid, string=["NUMBER"], flag=1)
in_service_buses = in_service_buses[0]

3. Calculate out-of-service buses

Steps 1-3 are just to find the out-of-service buses. It seems like a lot of work, but I couldn't find a better way.

# Find not in-service buses
out_service_buses = list(set(all_buses) - set(in_service_buses))

4. Subsystem with only out-of-service buses

# Make a subsystem from out-of-service buses
sid = 2
ierr = psspy.bsys(sid=sid, numbus=len(out_service_buses), 
                 buses=out_service_buses)

5. InService Branches on subsystem

# Find in-service, non-transformer branches
ierr, branches = psspy.abrnint(sid=sid, string=["FROMNUMBER", "TONUMBER"], 
                               flag=1, ties=3)

6. Check your work

# Report
for i in range(len(branches[0])):
    print "There's a problem with branch from %s to %s" % (branches[0][i],
                                                           branches[1][i])

And you should get something like:

There's a problem with branch from 1 to 10
There's a problem with branch from 1 to 11
There's a problem with branch from 1 to 12
There's a problem with branch from 2 to 10
<snip>
link

Comments

Thanks @chip. I really like the way you solved this!

Daniel_Hillier gravatar imageDaniel_Hillier (Mar 23 '12)
0

answered Sep 28 '16

perolofl gravatar image

PSSE has actually an activity to find this kind of topology errors. You find activity TREE under Power Flow menu and Check Data. The corresponding API is psspy.tree(1,0)

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: Mar 22 '12

Seen: 4,391 times

Last updated: Sep 28 '16