0

How to get branch power flow and their bus numbers.

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!!

anonymous user
asked 2018-02-12 18:18:28 -0500, updated 2018-02-12 18:20:02 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

4 Answers

0

You try the simple way:

  1. ierr, cmpval = brnflo(bus1,bus2,id)
  2. k1 = cmpval.real
  3. k2 = cmpval.imag...
jialink's avatar
1
jialink
answered 2020-04-12 16:46:27 -0500, updated 2020-04-12 16:48:11 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments
0

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

perolofl's avatar
3.8k
perolofl
answered 2018-02-13 02:01:56 -0500
edit flag offensive 0 remove flag delete 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's avatar camerond12 (2018-02-13 04:36:27 -0500) edit
add a comment see more comments
0

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.

Ali's avatar
26
Ali
answered 2018-02-23 00:30:08 -0500
edit flag offensive 0 remove flag delete link

Comments

Thank you!!

camerond12's avatar camerond12 (2018-03-26 00:03:52 -0500) edit
add a comment see more comments
0

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)]

jconto's avatar
2.9k
jconto
answered 2018-02-13 09:56:53 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Login/Signup to Answer