Ask Your Question
0

Same data repeat in dynamic simulation

asked 2023-11-22 05:11:28 -0600

Zhnoob gravatar image

updated 2023-11-24 00:37:59 -0600

I am aiming to observe the dynamic simulation result of changing the VAR of the BESS model, so I want to use a loop in python whenever the VAR value changed, let the dynamic simulation run to the same time step, but the problem occur when the simulation pause at 1 sec by using :

psspy.run(0,1,1,1,1)

Then continue run to 3 second by :

psspy.run(0,3,1,1,1)

(I have commented the "psspy.changewnmodvar" in my script, but it still happened, so I'll assume the problem is relate to "psspy.run")

According to the API document, the second parameter is the tpause(value of simulated time at which the simulation should next pause), in my case, the result data in outfile(1.output bar and 2.right click the figure>show editor>Data ) will be t=0~1(s) the continue to 1~3(s), the data at 1 sec will repeat, if the pause time is 1 、1.5、2(s), the data will repeat at all of this three points.

Compare with the dynamic simulation I have done before, the normal output file is suppose to have t=0~1(s) then continue to 3(s) the result at 1 (s) will not repeat.

(The code editor is vscode and the python version is 2.7, psse is V34, the delta time for dynamic simulation is 0.001(s) setting by "psspy.dynamicssolutionparam_2")

Any suggestion will be much appreciate! Thanks!


Edit:

I think the flat run means not considering the disturbance in the dynamic simulation, but I am going to change the VAR value in the model, is it still belongs to the "flat run"?

In the simulation, I want to use a loop to first change the var value in the model then run the dynamic simulation to certain time step, then change var of the model to another value, then run the dynamic simulation again, the code I except is as follow:

for i in range(1,3): 
    psspy.change_wnmod_var(rnbus,r"""1""",r"""REECCU1""",6, x[i])
    psspy.run(1, t[i],1,1,1)
    psspy.change_wnmod_var(rnbus,r"""1""",r"""REECCU1""",6, x[i+1])
    psspy.run(1, t[i+1],1,1,1)

But right now, even I use only the following code will have the same problem:

   for i in range(1,3): 
        psspy.run(1, t[i],1,1,1)
        psspy.run(1, t[i+1],1,1,1)

t[0]=0.00244140625, t[1]=0.0048828125, t[2]=0.00732421875, delta time is 0.001

The output table is:(# is the Text number, X is time, Y value is not here because the value can be correspond active power or anything measured)

# X

0 0

1 0.001

2 0.002

3 0.003

4 0.003

5 0.004

6 0.005

7 0.005

8 0.006

9 0.007

10 0.008

When the simulation ...

(more)
edit retag flag offensive close merge delete

Comments

The problem is not clear. Please elaborate further. Print statement is wrong; the right-paranthesis should be at the end.

perolofl gravatar imageperolofl ( 2023-11-22 10:38:28 -0600 )edit

Sorry for the unclear explanation, I have update the problem, thanks for your time!

Zhnoob gravatar imageZhnoob ( 2023-11-23 01:20:45 -0600 )edit

Do you mean that the channel values are constant, i.e. a flat run?

perolofl gravatar imageperolofl ( 2023-11-23 03:48:35 -0600 )edit

Can you show the change_wnmod_var statement. What are you changing?

perolofl gravatar imageperolofl ( 2023-11-23 03:52:17 -0600 )edit

1 answer

Sort by » oldest newest most voted
1

answered 2023-11-24 11:32:42 -0600

perolofl gravatar image

When making a pause in the simulation there will be double time values written to the out-file. The last time step before the pause is called t- and the first value after a pause is called t+. See Chapter 13.5.4 in Program Application Guide, Vol 2.

In your example the time step is 0.001 s, i.e. 1 ms. Starting with t = -0.002 the simulation is paused at times t=0.00244140625 and t=0.0048828125 s

The simulation runs up till the actual time is >= tpause.

The first run command to t=0.00244140625 will print the following time values to the channel file:

-0.002 t+
-0.001
0.000
0.001
0.002
0.003  t-

i.e., the simulation is paused at t=0.003 s.

The second run command to t=0.0048828125 s will print the following time values to the channel file:

0.003 t+
0.004
0.005 t-

i.e., the simulation is paused at t=0.005 s.

The last run command t=0.0.00732421875 will print the following time values to the channel file:

0.005 t+
0.006
0.007
0.008 t-

There is nothing wrong with your results, this is how PSSE works!

It shall be noted that the simulation will only be stopped at an simulation step. It is not possible to halt the simulation at t=0.0.00732421875 s.

edit flag offensive delete link more

Comments

Thank you for the clear explanation! This is exactly the result that appeared in my simulation. Thanks once again for addressing my doubts. Have a nice day.

Zhnoob gravatar imageZhnoob ( 2023-11-27 02:35:21 -0600 )edit

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

1 follower

Stats

Asked: 2023-11-22 05:11:28 -0600

Seen: 257 times

Last updated: Nov 24 '23