Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Same data repeat in dynamic simulation

I'm using python script instead of GUI, I am trying to do the dynamic simulation, because I want to run the simulation with loop to change some value inside the model. The problem I encounter is, the output for the psse will have the exactly same value at t[i], the code I use is similar as attached:

psspy.run(0,t[i],1,1,1)
print("run till %s")%t[i]
psspy.run(0,t[i+1],1,1,1)
print("run till %s")%t[i+1]

The code I get by recording the step in GUI is :

psspy.run(1, t1,1,1,1)
psspy.run(1, t2,1,1,1)

If t[i]=1, then the result at t=i will have two same data. Which means whenever I pause the simulation by using the code above, the problem will occur. Is the problem relate with the delta time in the dynamic parameter setting or anything else?

Any suggestion will be much appreciate! Thanks!

Same data repeat in dynamic simulation

I'm using python script instead of GUI, I am trying to do the dynamic simulation, because 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 the simulation with loop to change some value inside the model. The to the same time step, but the problem I encounter is, the output for the psse will have the exactly same value at t[i], the code I use is similar as attached:occur when the simulation pause at 1 sec by using :

psspy.run(0,t[i],1,1,1)
print("run till %s")%t[i]
psspy.run(0,t[i+1],1,1,1)
print("run till %s")%t[i+1]
psspy.run(0,1,1,1,1)

The code I get Then continue run to 3 second by recording the step in GUI is :

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

If t[i]=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 t=i will have two same data. Which means whenever I pause the simulation 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 using the code above, the problem will occur. Is the problem relate with the delta time in the dynamic parameter setting or anything else?"psspy.dynamicssolutionparam_2")

Any suggestion will be much appreciate! Thanks!

Same data repeat in dynamic simulation

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 stopped, the output will be repeat in the output table.

Also in the output bar(take the data around t=0.003 for example):

TIME X- VALUE --X X--------- IDENTIFIER ---------X X- VALUE --X X--------- IDENTIFIER ---------X
0.0030  0.50000     POWR     1[MACHINE     230.00]1    0.0000     POWR     2[ESS         230.00]1
3    4.82619E-11 POWR      1 TO      2 CKT '1 '   -4.82619E-11 POWR      2 TO      1 CKT '1 '
5   -4.29973E-10 FREQ      1 [MACHINE     230.00] -3.87927E-10 FREQ      2 [ESS         230.00]
7     1.0000     VOLT      1 [MACHINE     230.00]   1.0000     VOLT      2 [ESS         230.00]`

Channel output file is "SMIBBESSfault.out"

1 0.12E-08 2 [ESS 230.00] 0.2764E-13 0.1120E-12

TIME X- VALUE --X X--------- IDENTIFIER ---------X X- VALUE --X X--------- IDENTIFIER ---------X
0.0030  0.50000     POWR     1[MACHINE     230.00]1    0.0000     POWR     2[ESS         230.00]1
3    1.12007E-11 POWR      1 TO      2 CKT '1 '   -1.12007E-11 POWR      2 TO      1 CKT '1 '
5   -4.29973E-10 FREQ      1 [MACHINE     230.00] -3.87927E-10 FREQ      2 [ESS         230.00]
7     1.0000     VOLT      1 [MACHINE     230.00]   1.0000     VOLT      2 [ESS         230.00]

Will the time in t[0]~t[3] be the problem if it can't be divisible by the delta time in the setting?

Same data repeat in dynamic simulation

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 stopped, the output will be repeat in the output table.

Also in the output bar(take the data around t=0.003 for example):example, the output will print two times):

TIME X- VALUE --X X--------- IDENTIFIER ---------X X- VALUE --X X--------- IDENTIFIER ---------X
0.0030  0.50000     POWR     1[MACHINE     230.00]1    0.0000     POWR     2[ESS         230.00]1
3    4.82619E-11 POWR      1 TO      2 CKT '1 '   -4.82619E-11 POWR      2 TO      1 CKT '1 '
5   -4.29973E-10 FREQ      1 [MACHINE     230.00] -3.87927E-10 FREQ      2 [ESS         230.00]
7     1.0000     VOLT      1 [MACHINE     230.00]   1.0000     VOLT      2 [ESS         230.00]`

Channel output file is "SMIBBESSfault.out"

1 0.12E-08 2 [ESS 230.00] 0.2764E-13 0.1120E-12

TIME X- VALUE --X X--------- IDENTIFIER ---------X X- VALUE --X X--------- IDENTIFIER ---------X
0.0030  0.50000     POWR     1[MACHINE     230.00]1    0.0000     POWR     2[ESS         230.00]1
3    1.12007E-11 POWR      1 TO      2 CKT '1 '   -1.12007E-11 POWR      2 TO      1 CKT '1 '
5   -4.29973E-10 FREQ      1 [MACHINE     230.00] -3.87927E-10 FREQ      2 [ESS         230.00]
7     1.0000     VOLT      1 [MACHINE     230.00]   1.0000     VOLT      2 [ESS         230.00]

Will the time in t[0]~t[3] be the problem if it can't be divisible by the delta time in the setting?