0

Commands to output branch data in PSSE 32

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.

SC's avatar
30
SC
asked 2013-08-19 09:22:10 -0500, updated 2017-08-02 10:07:20 -0500
edit flag offensive 0 remove flag close merge delete

Comments

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

nyga0082's avatar nyga0082 (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's avatar SC (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's avatar nyga0082 (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's avatar SC (2013-08-20 07:46:09 -0500) edit

Might be an overkill but see my command line case compare python utility PSSecompare https://github.com/sbhowmik7/PSSEcompare/tree/pyV27. Why reinvent the wheel.

mbong's avatar mbong (2017-08-03 19:43:57 -0500) edit
add a comment see more comments

2 Answers

4

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))
else:
    print('Branch not found in case')
EBahr's avatar
420
EBahr
answered 2013-08-20 11:44:43 -0500, updated 2013-09-05 16:17:55 -0500
edit flag offensive 0 remove flag delete link

Comments

1

@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's avatar SC (2013-09-03 11:32:28 -0500) edit
add a comment see more comments
2

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

J.Armstrong's avatar
68
J.Armstrong
answered 2013-08-21 20:12:52 -0500
edit flag offensive 0 remove flag delete link

Comments

<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's avatar SC (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's avatar SC (2013-08-22 16:27:09 -0500) edit
3

@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's avatar EBahr (2013-08-29 15:57:10 -0500) edit
1

Caspy runs well even without a PSS/E installation.

JervisW's avatar JervisW (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's avatar SC (2013-08-30 10:18:15 -0500) edit
add a comment see more comments

Your Answer

Login/Signup to Answer