First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!
1 | initial version |
Hi everyone,
I am doing contingency analysis using ACCC. After running ACCC, I would like to check the voltage magnitude of each monitored bus. My code goes as below:
# perform ACCC without dispatch model for branch contingency
accc_ierr = psspy.accc_with_dsp_2(0.6, [0,0,0,1,2,1,0,0,0,0], _s, conFileName1+'.dfx', conFileName1+'.acc', _o, _o)
# fetch summary of ACCC solution for debug purpose
smry = pssarrays.accc_summary(conFileName1+'.acc')
for lbl in smry.colabel:
# for each contingency case
soln = pssarrays.accc_solution(accfile=conFileName1+'.acc', colabel=lbl, stype='con', busmsm=0.6, sysmsm =5.0)
# skip some unregular contingencies
if (soln == None or soln.ierr != 0):
continue
# if solution converged, continue
if (soln.cnvflag):
# check voltage violations at buses
sum_UnderVoltVio = 0
numBuses_UnderVoltVio = 0
sum_OverVoltVio = 0
numBuses_OverVoltVio = 0
for k in range(smry.acccsize.nmvbus):
busVolt = soln.volts[k]
if(busVolt < volt_lb):
sum_UnderVoltVio = sum_UnderVoltVio + (volt_lb - busVolt)
numBuses_UnderVoltVio = numBuses_UnderVoltVio + 1
elif(busVolt > volt_ub):
#print "busVolt", busVolt
sum_OverVoltVio = sum_OverVoltVio + (busVolt - volt_ub)
numBuses_OverVoltVio = numBuses_OverVoltVio + 1
So basically, I know all voltages of all monitored buses are stored in soln.volts
array. And I am sure that smry.acccsize.nmvbus
is the number of voltage monitored buses. So I was assuming that size of soln.volts
array should be equal to smry.acccsize.nmvbus
. But this is not the case, the size of soln.volts
is actually twice as big as smry.acccsize.nmvbus
(see statistics below). And if I don't remember wrong, the values in soln.volts
just got repeated twice, which means, the first half is exactly the same the second half.
smry.acccsize.nmvbus
= 6244 # is the number of monitored buses.
smry.acccsize.nmvbusrec
= 12488 # is the number of voltage monitored bus records
len(soln.volts)
= 12488
Notice that smry.acccsize.nmvre
c= 2 # is the number of voltage monitored records
I don't why PSSE does this. Maybe it is a bug, but I wanted to make sure I am fetching the correct voltage for each monitored bus. Can anyone help explain why?
Thanks very much!