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

Ask Your Question
0

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

asked Mar 15 '3

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

2 answers

Sort by » oldest newest most voted
0

answered Mar 15 '3

perolofl gravatar image

updated Mar 16 '3

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

link

Comments

Thank you so much.

Shawn gravatar imageShawn (Mar 15 '3)
0

answered Mar 16 '3

Shawn gravatar image

updated Mar 16 '3

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

link

Comments

Well done! Nice solution.

perolofl gravatar imageperolofl (Mar 16 '3)

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

Stats

Asked: Mar 15 '3

Seen: 3,476 times

Last updated: Mar 16 '23