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

Ask Your Question
0

Commands to output branch data in PSSE 32

asked Aug 19 '13

SC gravatar image

updated Aug 2 '17

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.

Comments

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

nyga0082 gravatar imagenyga0082 (Aug 19 '13)

@ 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 (Aug 19 '13)

@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 (Aug 20 '13)

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

SC gravatar imageSC (Aug 20 '13)

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 gravatar imagembong (Aug 4 '17)

2 answers

Sort by » oldest newest most voted
2

answered Aug 22 '13

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

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 gravatar imageSC (Aug 22 '13)
<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 (Aug 22 '13)
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 gravatar imageEBahr (Aug 29 '13)
1

Caspy runs well even without a PSS/E installation.

JervisW gravatar imageJervisW (Aug 30 '13)

@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 (Aug 30 '13)
4

answered Aug 20 '13

EBahr gravatar image

updated Sep 5 '13

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')
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 gravatar imageSC (Sep 3 '13)

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

1 follower

Stats

Asked: Aug 19 '13

Seen: 125,847 times

Last updated: Aug 02 '17