How to determine bus or a plant code?
I want to determine whether a plant is hiting reactive limit or not..
add a comment
I want to determine whether a plant is hiting reactive limit or not..
The following python code will check the Q-limit state of a machine:
def maclimits(ibus,id):
  ierr, q    = psspy.macdat(ibus, id, 'Q')
  ierr, qmax = psspy.macdat(ibus, id, 'QMAX')
  ierr, qmin = psspy.macdat(ibus, id, 'QMIN')
  answer = 0                #machine is within reactive limits
  if   q >= qmax:
       answer = 1       #machine hits upper reactive limit
  elif q <= qmin:
       answer = -1  #machine hits lower reactive limit
  return answer         
#usage, having savnw loaded in PSSe:
qlimit = maclimits(3018,'1')
print qlimit
 
 
                
                whit loves you.      Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.