Ask Your Question

Commands to output branch data in PSSE 32

asked 2013-08-19 09:22:10 -0500

SC gravatar image

updated 2017-08-02 10:07:20 -0500

I am comparing the branch data, bus data and other data in two different cases. Just tried to click the branch and bus to see what's there. For example,BRANCH_DATA,111111,222222. Are there any commands that I can output branch data from bus #111111 to bus #222222 and compare the differences? See the replies below.

edit retag flag offensive close merge delete


Check out the "DIFF" command in the API documentation. It's the API version of a powerflow case comparison.

nyga0082 gravatar imagenyga0082 ( 2013-08-19 11:55:29 -0500 )edit

@ nyga0082, thank you I checked "DIFF" seems it's not what I want. API should have a command to output the specific branch data or bus data, right?

SC gravatar imageSC ( 2013-08-19 16:25:49 -0500 )edit

@Shengen Specifically what sort of data are you looking to get (flows? voltages? line impedances? ratings?) If you want to get bus and branch data from only one case at a time (as opposed to both cases with DIFF), check out Chapter 7 of the API doc. Especially commands like BUSDAT, BRNDAT, & BRNMSC

nyga0082 gravatar imagenyga0082 ( 2013-08-19 20:37:49 -0500 )edit

@nyga0082 just care about line impedances, thank you, it really helps. Not familiar with PSSE and API.

SC gravatar imageSC ( 2013-08-20 07:46:09 -0500 )edit

Might be an overkill but see my command line case compare python utility PSSecompare Why reinvent the wheel.

mbong gravatar imagembong ( 2017-08-03 19:43:57 -0500 )edit

2 answers

Sort by ยป oldest newest most voted

answered 2013-08-21 20:12:52 -0500

J.Armstrong gravatar image

A useful tool native to PSS/E is the CASPY module which you can import whenever you import the PSSPY module.

I like to use CASPY whenever I need to evaluate certain aspects a cases/cases without trying to manipulate the data in place.

Run in IDLE the help(caspy) statement after importing the module for more information.

I know this isn't a lot of information, but hopefully it will be useful.

I will try to edit more when I am back at a computer where I can write meaningful code...

edit flag offensive delete link more


<p>@J.Amstrong thank you. It's very useful and helpful, have not used this module before, it should save my time to get desired data.

SC gravatar imageSC ( 2013-08-22 13:58:38 -0500 )edit
<p>@J.Amstrong Tried the simple code given by help(caspy), it works well. But do you have any more information about caspy module in PSSE docs? I can't find details to tell how to get data from a specific bus or branch.

SC gravatar imageSC ( 2013-08-22 16:27:09 -0500 )edit

@Shengen, I updated my previous answer with a different method using caspy. It's not too terribly apparent how to use it, but if you look at the PSSE Saved Case Data Extraction Subroutines document (SC.pdf), it will give you a good idea of what is available.

EBahr gravatar imageEBahr ( 2013-08-29 15:57:10 -0500 )edit

Caspy runs well even without a PSS/E installation.

JervisW gravatar imageJervisW ( 2013-08-29 20:56:19 -0500 )edit

@EBahr, thank you to point out the pdf file, your example works well. It's really helpful to read the document when using it.

SC gravatar imageSC ( 2013-08-30 10:18:15 -0500 )edit

answered 2013-08-20 11:44:43 -0500

EBahr gravatar image

updated 2013-09-05 16:17:55 -0500

Take a look at the BRNDT2 function in the API. For example:

ierr, line_rx = psspy.brndt2(113987,113973,'1','RX')

would give you a complex value for the line impedance. linerx.real and linerx.imag will then separate the resistance and reactance values of the impedance.

You were also interested in accessing the data from caspy. It is quite a bit different beast, and is a little more difficult to get the data you are requesting.

Here is the gist of how to get the same data:

rx = None
sav = 'c:/path/to/your/case.sav'
from_bus = '113987'
to_bus = '113973'
ckt_id = ' 1'

case = caspy.Savecase(sav)
# Look for from bus in FRMBUS list
for i in range(len(case.pssbrn.frmbus)):        
    if ((case.pssbrn.frmbus[i] == float(from_bus)) and (case.pssbrn.tobus[i]==float(to_bus)) and case.pssbrn.ckt[i].strip() == ckt_id.strip()):
        rx = case.pssbrn.rx[i]
# Look for from bus in TOBUS list
for i in range(len(case.pssbrn.tobus)):       
    if ((case.pssbrn.frmbus[i] == float(to_bus)) and (case.pssbrn.tobus[i]==float(from_bus)) and case.pssbrn.ckt[i].strip() == ckt_id.strip()):
        rx = case.pssbrn.rx[i]

if rx:
    print('%05f + %05fi' % (rx.real,rx.imag))
    print('Branch not found in case')
edit flag offensive delete link more



@EBahr, the only thing needs to modify is ckt = '1' should be ckt_id ='1', and run python file using windows batch without PSSE doungle.

SC gravatar imageSC ( 2013-09-03 11:32:28 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

1 follower


Asked: 2013-08-19 09:22:10 -0500

Seen: 115,144 times

Last updated: Aug 02 '17