Ask Your Question
0

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

asked 2023-03-14 22:00:10 -0600

Shawn gravatar image

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
edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2023-03-15 03:07:52 -0600

perolofl gravatar image

updated 2023-03-16 03:44:43 -0600

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."

edit flag offensive delete link more

Comments

Thank you so much.

Shawn gravatar imageShawn ( 2023-03-15 05:41:59 -0600 )edit
0

answered 2023-03-15 19:13:53 -0600

Shawn gravatar image

updated 2023-03-15 19:15:28 -0600

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()

edit flag offensive delete link more

Comments

Well done! Nice solution.

perolofl gravatar imageperolofl ( 2023-03-16 03:34: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

Stats

Asked: 2023-03-14 22:00:10 -0600

Seen: 3,209 times

Last updated: Mar 16 '23