Ask Your Question
0

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

Anonymous

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'

 psspy.bsys(1,0,[0.0,0.0],0,[],1,[126389],0,[],0,[])
 [ierr,totals,moto]=psspy.scal_2(1,0,1,[0,0,0,0,0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0])
 totals=[0,1,0,0,0,0,0,0,0,0,0]
 totalz=totals.real
 output='LOAD: {} MW'.format(round(totalz,0))
 print(output)
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

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
psspy.bsys(1,0,[0.0,0.0],0,[],1,[126389],0,[],0,[])

# 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

Stats

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

Seen: 862 times

Last updated: Aug 09 '18