Ask Your Question

Shawn's profile - activity

2023-03-18 13:19:10 -0500 received badge  Famous Question (source)
2023-03-17 07:53:27 -0500 received badge  Notable Question (source)
2023-03-16 03:14:56 -0500 received badge  Popular Question (source)
2023-03-15 19:15:28 -0500 received badge  Editor (source)
2023-03-15 19:13:53 -0500 answered a question Is it possible to retrieve machine electrical output (PELEC) during dynamic simulation without using channels?

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

2023-03-15 05:41:59 -0500 commented answer Is it possible to retrieve machine electrical output (PELEC) during dynamic simulation without using channels?

Thank you so much.

2023-03-14 22:00:10 -0500 asked a question 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