Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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

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