Ask Your Question
0

Total generation and power load

asked 2025-04-07 00:59:18 -0500

Vlad gravatar image

Hello,

When I use B (bus based reports on a subsystem) it gives a lot of summarized info like this:

                    X------ ACTUAL ------X X----- NOMINAL ------X
                            MW        MVAR         MW        MVAR
                    FROM GENERATION               57.4     -174.9        57.4     -174.9
                    TO CONSTANT POWER LOAD       166.0       56.1       166.0       56.1

Is there a way in Python to obtain exactly that values (57.4MW and 166MW) and export them in excel?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2025-04-07 04:01:03 -0500

perolofl gravatar image

updated 2025-04-08 11:07:35 -0500

Use GENDAT and BUSDT2 to obtain the total PGEN and PLOAD at the bus.

EDIT:

I didn't find any API returning bus subsystem totals. However, it is possible to use API scal for this. Example: A bus subsystem defined with sid=0.

ierr, totals, moto = psspy.scal_4(0,0,0,[],[])

The totals for the selected subsystem are returned in a tuple. Here, totals[1] contains the total MW load and totals[2] the total MW generation. See PAG manual for the rest of the content in totals.

edit flag offensive delete link more

Comments

Is a subsystem, many buses and generators, so I need a python function that returns the sum of the power of generators in that subsystem... exactly what the B button does

Vlad gravatar imageVlad ( 2025-04-07 06:27:24 -0500 )edit

thank you. I managed to obtain the exact value.

Vlad gravatar imageVlad ( 2025-04-08 14:14:22 -0500 )edit

can you share your solution?

jconto gravatar imagejconto ( 2025-04-09 17:25:49 -0500 )edit

psspy.bsysrcl(0,r"""mysubsystem.sbsxml""")
psspy.subs(0,0)
ierr,totals,moto=psspy.scal_2(0,0,1,[0,0,0,0,0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0])
psspy.scal_2(0,0,2,[0,0,0,0,0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0])
print "Subsystem Load", totals[1]
my PSSEv33 does't have scal_4

Vlad gravatar imageVlad ( 2025-04-10 03:52:55 -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

Stats

Asked: 2025-04-07 00:59:18 -0500

Seen: 103 times

Last updated: Apr 08