Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Okay, I found a workaround myself:

GREF_chan_number = 10
runUntill = 0.0
psspy.run(0, runUntill, 0, 1, 1)
ChfData = dyntools.CHNF(fileChan) 
short_title, chanid, chandata = ChfData.get_data()
GREF = chandata[GREF_chan_number ][-1]

What this code does is the following. You must have defined a channel that records the GREF variable in your output file and you must have initialized the dynamic simulation before running my code. In the code above we say that the GREF channel is number 10 (will be different for your situation). Then the simulation is run until 0.0 seconds. This will record a few integration iterations in the out file. Then you load the channel out file and just read the last value from the GREF channel.

This is a good solution because:

  1. It works for every possible governor model
  2. It does not mess your simulation because you only run the simulation until the 0.0 seconds. Have you noticed when working with the PSS/E GUI that when you initialize the dynamic simulation, the current simulation time is slightly negative? This is why running up until 0.0 seconds actually works.