First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!

Ask Your Question
0

Get the dynamic response in the workspace

asked Sep 26 '19

maryam gravatar image

updated Sep 26 '19

jconto gravatar image
psspy.chsb(2,0,[-1,-1,-1,1,13,0])    #13=Volt
psspy.chsb(2,0,[-1,-1,-1,1,7,0])      #12=bus PU freq deviation , 7=speed
#psspy.chsb(0,1,[-1,-1,-1,1,16,0])    #16= flow P and Q
psspy.chsb(2,0,[-1,-1,-1,1,2,0])     #2=Machine P
psspy.chsb(2,0,[-1,-1,-1,1,3,0])     #3=Machine Q 
psspy.cong(0)
psspy.conl(0,1,1,[0,0],[ 100,0,0,100])
psspy.conl(0,1,2,[0,0],[ 100,0,0,100])
psspy.conl(0,1,3,[0,0],[ 100,0,0,100])
psspy.progress_output(6,'',[])  # turn off all screen messages
psspy.alert_output(6,'',[])     # turn off all screen messages
psspy.prompt_output(6,'',[])    # turn off all screen messages
# setup simulation time step = Resolution/N, where N=5
psspy.dynamics_solution_param_2([_i,_i,_i,_i,_i,_i,_i,_i],[_f,_f, Resolution/5,_f,_f,_f,_f,_f])
psspy.strt(0,OutFile)
psspy.run(0,150,1,1,0)
#psspy.run(0,2,1,1,0)
psspy.pssehalt_2()
ch = dyntools.CHNF(OutFile)  
short_title, chanid_dict, chandata_dict = ch.get_data()

Hi everyone, here is last part of my code and I run dynamic simulation for one generator. How can I get the P and Q of the generator( I don't need it in excel). I want to save the data in a matrix. Can anyone help me with this problem? Thank you so much

Comments

Which version is your PSSE?

Clarck gravatar imageClarck (Nov 14 '19)

2 answers

Sort by » oldest newest most voted
0

answered Oct 1 '19

maryam gravatar image

Thank you so much. It works for me.

link
0

answered Sep 27 '19

jconto gravatar image

A channel ID is needed to extract simulation data from the OUT file. The channel id allocation depends in the case and sequence of channel declaration. To keep the 'run process' and the 'output data extraction process' in the same python code, run twice, once to ID the target channels and second to create the data matrix. The code below will follow after the end of the run [it assumes that target channel ID are 3 and 5]:

psspy.run(0,150,1,1,0)     #the end of the run process
#psspy.pssehalt_2()         #commented to avoid PSSe quitting
import dyntools              #not needed if done 'above in your code'
ch = dyntools.CHNF(OutFile)  
short_title, chanid_dict, chandata_dict = ch.get_data()
#print chanid content to id target channels
for key,val in chanid_dict.items():
      print key, val
#retrieve selected channel data from chandata_dict
timevec= chandata_dict['time']
Pxvec  = chandata_dict[3]                   # update channel id as needed
Qxvec  = chandata_dict[5]                   # update channel id as needed
PQmat  = zip(timevec,Pxvec,Qxvec)
print "first 5 row of 'matrix'"
for i in range(5):
      print PQmat[i][0],PQmat[i][1],PQmat[i][2]
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.
Want to format code in your answer? Here is a one minute demo on Youtube

Add Answer

[hide preview]

Question Tools

2 followers

Stats

Asked: Sep 26 '19

Seen: 466 times

Last updated: Oct 01 '19