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

Ask Your Question
0

Return channel data during dynamic simulation

asked Jan 16 '5

Busbar gravatar image

Hi,

Is it possible to return channel data at the same time as dynamic calculations running? For now, the data is extracted from the .out file in the end of simulation which is not good option in my case. I am considering the following option: stop the simulation at each time step and transfer data from the formed .out file to the dataframe, but it seems a rather clumsy solution and will reduce the performance of calculations.

Comments

What is the reason to do this?

perolofl gravatar imageperolofl (Jan 16 '5)

I need to disconnect generator when it become out of step

Busbar gravatar imageBusbar (Jan 16 '5)

2 answers

Sort by » oldest newest most voted
1

answered Jan 16 '5

perolofl gravatar image

There is a dynamic option already for that, see below:

image description

link
0

answered Jan 17 '5

pjhoo2397 gravatar image

I usually do for loops to stop every time step if I want to return values while a simulation is still running.

For this instance, I return the bus frequency value for every timestep.

ini_time = 1
end_time = 60

# Freq Channel
psspy.bus_frequency_channel([1,6365],r"""6365_frequency""")
ierr, rval = psspy.chnval(1)

frequency = []

# Define time steps
time_step_psse = psspy.dsrval('DELT',)[1]
time_steps_pre_simul = int(math.ceil((ini_time)/(psspy.dsrval('DELT',)[1])))
time_steps_post_simul = int(math.ceil((end_time - ini_time)/(psspy.dsrval('DELT',)[1])))

for k in range(time_steps_pre_simul - 2):
    # simulation
    psspy.run(0, psspy.dsrval('DELT',)[1]*(k+1), 1,1,0)

    # read and write freq
    freq_val = psspy.chnval(1)[1]
    frequency.append(((freq_val+1)*60))

## Fault simulation
psspy.run(0, ini_time,1,1,0)
psspy.dist_machine_trip(trip_machine,r"""1""")

## Post fault simulation 
for i in range(time_steps_post_inject - 2):
    psspy.run(0, ini_time+psspy.dsrval('DELT',)[1]*(i+1), 1,1,0)
    freq_val = psspy.chnval(1)[1]
    frequency.append(((freq_val+1)*60))

This worked for me.

link

Comments

This is not what @Busbar wants to do!

perolofl gravatar imageperolofl (Jan 17 '5)

Basically, the answer is correct, except that I would write additional code that would evaluate the situation at each time step and disconnect devices according to the criteria I set.

Busbar gravatar imageBusbar (Jan 17 '5)

@Busbar Sorry, I misunderstood. I thought that my answer would solve your problem!

perolofl gravatar imageperolofl (Jan 19 '5)

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

1 follower

Stats

Asked: Jan 16 '5

Seen: 2,432 times

Last updated: Jan 16