First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!
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: