Ask Your Question
1

Get power output

asked 2013-05-09 07:22:16 -0600

bennettl gravatar image

I'm using python to set certain generators to Pmax one at a time, how can I achieve this?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-05-15 04:36:13 -0600

rimux gravatar image
#List of generatorts for investigation:
Gen=[[bus1,id1],
     [bus2,id2],
     [bus3,id3]] #and so on

#Loop through all generators:
for g in Gen:

  bus=g[0]
  id=g[1]

  #remember initial generation:
  e1, Pold = psspy.macdat(bus, id, 'P')

  #getting generator Pmax:
  e2, Pmax = psspy.macdat(bus, id, 'PMAX')

  #changing generation to Pmax
  e3 = psspy.machine_data_2(bus,id,[_i,_i,_i,_i,_i,_i],[Pmax,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f])

  e4 = psspy.fnsl() #solving

  #some code here - doing something, output results, etc.
  #...

  #restore initial generation:
  e5 = psspy.machine_data_2(bus,id,[_i,_i,_i,_i,_i,_i],[Pold,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f]) 

  e6 = psspy.fnsl() #solving again

  if (e1+e2+e3+e4+e5+e6)!=0: print "got some errors ! ",g
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

Stats

Asked: 2013-05-09 07:22:16 -0600

Seen: 1,325 times

Last updated: May 15 '13