Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Returning Dynamic simulation data.

Hello,

I am trying to run a dynamic simulation and return the data from each time step rather than outputting it to the .out file so that it can be used in Matlab. Is there a function or way that I would be able to do that?

dryfile, Outfile, and subsystem 2 are all defined earlier in the code and are working fine.

#initiate DYR    
psspy.dyre_new([1,1,1,1],dyrfile)
psspy.chsb(2,1,[-1,-1,-1,1,13,0]) #voltage at bus

#convert loads and generators    
psspy.cong(0) 
psspy.conl(-1,1,1)
psspy.conl(-1,1,2,[0,0],[0,100,0,100])
psspy.conl(-1,1,3)

psspy.ordr()
psspy.fact()
psspy.tysl()

psspy.strt(0,OutFile)
psspy.run(0,5,1,1,0)
psspy.dist_bus_fault(5,3, 0.0, [.1,0]); #SET Fault at bus 5
psspy.run(0,5.1,1,1,0)
psspy.dist_clear_fault(1)

t = 5.1

for TS in range(600): #runs to roughly 10 seconds
    t=t+0.0087
    psspy.run(tpause=t)
    #output voltage (or other CHSB data) as a variable for matlab use at each pause point. 
    pausePoint = input('pause here for Matlab to be run')

I want to set it up so that bus voltage is returned at each time step in the loop after the fault occurs so that some math can be done on with it before initiating the next time step.

Returning Dynamic simulation data.

Hello,

I am trying to run a dynamic simulation and return the data from each time step rather than outputting it to the .out file so that it can be used in Matlab. Is there a function or way that I would be able to do that?

dryfile, Outfile, and subsystem 2 are all defined earlier in the code and are working fine.

#initiate DYR    
psspy.dyre_new([1,1,1,1],dyrfile)
psspy.chsb(2,1,[-1,-1,-1,1,13,0]) #voltage at bus

#convert loads and generators    
psspy.cong(0) 
psspy.conl(-1,1,1)
psspy.conl(-1,1,2,[0,0],[0,100,0,100])
psspy.conl(-1,1,3)

psspy.ordr()
psspy.fact()
psspy.tysl()

psspy.strt(0,OutFile)
psspy.run(0,5,1,1,0)
psspy.dist_bus_fault(5,3, 0.0, [.1,0]); #SET Fault at bus 5
psspy.run(0,5.1,1,1,0)
psspy.dist_clear_fault(1)

t = 5.1

for TS in range(600): #runs to roughly 10 seconds
    t=t+0.0087
    psspy.run(tpause=t)
    #output voltage (or other CHSB data) as a variable for matlab use at each pause point. 
    pausePoint = input('pause here for Matlab to be run')

I want to set it up so that bus voltage is returned at each time step in the loop after the fault occurs so that some math can be done on with it before initiating the next time step.