0

Is it possible to retrieve machine electrical output (PELEC) during dynamic simulation without using channels?

I have tried using agenbusreal and amachreal APIs to get the machine outputs for each time steps but it is not working. I was wondering if there is an easy approach to get the machines data without assigning channel to each individual machine. My code is as follows:

while t <= 30:
    psspy.run(0, t, 0, 24, 0)
    ierr, rarray = psspy.agenbusreal(0, 4, 'PGEN')
    #ierr, rarray = psspy.amachreal(0, 4, 'PGEN')
    df_mach[i] = rarray[0]
    # pgen_array.append(rarray[0])
    i += 1
    t += 0.1
Shawn's avatar
1
Shawn
asked 2023-03-14 22:00:10 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

2 Answers

0

This is a redundant question. It has already been explained in post aBusReal and aMachReal behaving weirdly.

EDIT:

@Shawn found the solution!!!

API powerflowmode() is equivalent to the old activity LOFL.

POM, Chapter 16.8 (rev 35) says about activity LOFL:

"Allow examination of the network conditions existing at any instant during the system disturbance being simulated. When run during a state-space or extended term dynamic simulation calculation, activity LOFL sets the plant and machine power output arrays in the working case to correspond to those contained in the dynamics data arrays PELEC and QELEC. Thus, the machine powers at that point in the simulation will be recognized in any power flow reporting activities which are executed while the power flow linkage is in effect."

perolofl's avatar
3.8k
perolofl
answered 2023-03-15 03:07:52 -0500, updated 2023-03-16 03:44:43 -0500
edit flag offensive 0 remove flag delete link

Comments

Thank you so much.

Shawn's avatar Shawn (2023-03-15 05:41:59 -0500) edit
add a comment see more comments
0

was able to figure out a way to retrieve the machine output by using the powerflow model "amachreal" API. It will work only if we return PSSE to powerflow mode from the dynamics mode. Following code will help you to understand this logic.

psspy.run(0, t, 0, 24, 0)

psspy.powerflowmode()

ierr, rarray = psspy.amachreal(0, 4, 'PGEN')

df_mach[i] = rarray[0]

i += 1

t += 0.1

psspy.dynamicsmode()

Shawn's avatar
1
Shawn
answered 2023-03-15 19:13:53 -0500, updated 2023-03-15 19:15:28 -0500
edit flag offensive 0 remove flag delete link

Comments

Well done! Nice solution.

perolofl's avatar perolofl (2023-03-16 03:34:21 -0500) edit
add a comment see more comments

Your Answer

Login/Signup to Answer