Ask Your Question
0

Get the dynamic response in the workspace

asked 2019-09-26 14:30:38 -0500

maryam gravatar image

updated 2019-09-26 15:10:36 -0500

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

edit retag flag offensive close merge delete

Comments

Which version is your PSSE?

Clarck gravatar imageClarck ( 2019-11-14 10:43:03 -0500 )edit

2 answers

Sort by ยป oldest newest most voted
0

answered 2019-10-01 09:09:45 -0500

maryam gravatar image

Thank you so much. It works for me.

edit flag offensive delete link more
0

answered 2019-09-27 13:22:24 -0500

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]
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

2 followers

Stats

Asked: 2019-09-26 14:30:38 -0500

Seen: 452 times

Last updated: Oct 01 '19