Ask Your Question

How do you output the load of the bus and store it as a variable

asked 2018-08-07 13:57:59 -0500

anonymous user


In the API manual, psspy.scal_2 controls the scalable load option in PSSE. I don't know how to output the value and store it as a variable? Like using an object/array totals.real. In the manual it says TOTALS(2) is associated with the load MW total. Is this right or is there another code that returns the value of the scabale load. Thank you. The error output is displayed below: AttributeError: 'list' object has no attribute 'real'

 output='LOAD: {} MW'.format(round(totalz,0))
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2018-08-09 11:45:38 -0500

EBahr gravatar image

The TOTALS(2) element is an output variable for the the OLD subsystem load value. If you would like to retrieve the NEW load MW total of your subsystem, use the psspy.alodbuscplx function.

For example:

import psspy
_i, _f = psspy.getbatdefaults()

# Setup subsystem

# Scale load to 20 MW using constant P/Q ratio
ierr, totals, motors = psspy.scal_2(1, 0, 0, [0,1,0,1,0],[20.0,_f,_f,_f,_f,_f,_f])

# Print old load value
print 'OLD LOAD: {} MW'.format(round(totals[1],0))

# Print new load value
ierr, load = psspy.alodbuscplx(1, 1, 'TOTALNOM')
print 'NEW LOAD: {} MW'.format(round(load[0][0].real,0))
edit flag offensive delete link more

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: 2018-08-07 13:57:59 -0500

Seen: 142 times

Last updated: Aug 09 '18