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

Ask Your Question
0

How to get branch power flow and their bus numbers.

asked Feb 13 '18

anonymous user

Anonymous

updated Feb 13 '18

Hello,

I am using the API command psspy.aflowreal to get active power flow of branches in a subsystem. Problem is, using this command does not indicate which value belongs to which 'to and from' bus number.

For example, aflowreal returns:

[10, -9, 20, -21, 30, -29]

Where I'm trying to get:

[ [10, (bus1, bus2)], [-9, (bus2, bus1)], [20, (bus2, bus3)], .... ]

Does anybody have an idea of how I can implement this in my script??

Thanks!!

4 answers

Sort by » oldest newest most voted
0

answered Feb 23 '18

Ali gravatar image

You need to use aflowint and aflowreal as others mentioned. These two commands return line values in the same order so you should be able to match them. Once you have the output of these two API commands, you can convert them to the format you are asking. I would do something like this:

istrings = ['fromnumber', 'tonumber']
ierr, idata = psspy.aflowint(sid=-1, 1, 5, 1,istrings)

idata will contain the tuple you are looking for. Another call to aflowreal and a zip command will do the rest for you.

link

Comments

Thank you!!

camerond12 gravatar imagecamerond12 (Mar 26 '18)
0

answered Apr 12 '0

jialink gravatar image

updated Apr 12 '0

You try the simple way:

  1. ierr, cmpval = brnflo(bus1,bus2,id)
  2. k1 = cmpval.real
  3. k2 = cmpval.imag...
link
0

answered Feb 13 '18

jconto gravatar image

The script "pout_report.py" in the "example" folder of the PSSe installation directory, contains code showing the use of aflowint and aflowreal API calls.

I would add the ckt id to the branch identifier as [10, (bus1, bus2, ckt)]

link
0

answered Feb 13 '18

perolofl gravatar image

API aflowreal only returns real values. Use aflowint to return from and to bus number.

link

Comments

Definitely agree with you. However, using aflowint to return from/to bus number's seems to give the bus numbers in a random order, i.e. using aflowreal will give you (1, 2, 3, 4) however the bus numbers returned from aflowint will be (d, c, a, b). Is there a way to appropriately link the two?

camerond12 gravatar imagecamerond12 (Feb 13 '18)

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

3 followers

Stats

Asked: Feb 13 '18

Seen: 2,920 times

Last updated: Apr 12 '20