Ask Your Question

Chris.R's profile - activity

2018-05-22 13:11:01 -0500 received badge  Famous Question (source)
2018-05-21 16:57:19 -0500 received badge  Notable Question (source)
2018-05-21 16:36:27 -0500 commented answer Returning Dynamic simulation data.

The objective is to run a single time step in PSSE, take the output values of the dynamic simulation and use them in Matlab to run Kalman Filter. Then apply the result of KF in PSSE simulation and run the next PSSE time step. In short I want to run KF in every time step of PSSE dynamic simulation.

2018-05-20 16:24:50 -0500 received badge  Popular Question (source)
2018-05-19 18:50:51 -0500 received badge  Organizer (source)
2018-05-19 18:36:41 -0500 asked a question 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.