Ask Your Question

Extract Bus Voltage Magnitude and Angle from .sav case

asked 2022-09-26 13:33:28 -0600

yugpatel22 gravatar image

updated 2022-09-26 13:34:25 -0600

I have these converged Power Flow cases as .sav files. I want to extract the Bus Voltage Magnitude and Angle, Current Magnitude and Angle data. I am using the ABUSREAL function from the PSSE API to get the values of 'PU', 'KV', 'ANGLE', and 'ANGLED'. However, this is the error message from my script:

ierr, [PU, KV, ANGLE, ANGLED] = psspy.abusreal(sid = -1, flag = 2, string = ['PU', 'KV', 'ANGLE', 'ANGLED']) TypeError: cannot unpack non-iterable NoneType object

Also, for getting the current magnitude and angle data, I believe I may have to extract the admittance matrix data using output_y_matrix and I may be able to get the Current related data based on the obtained Voltage and Admittance data. Any suggestions for this would be helpful.

If anyone has encountered this or similar types of issues while extracting this data from PSSE to excel, I would appreciate feedback or suggestions to resolve this error and get the required output.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2022-09-26 15:16:25 -0600

perolofl gravatar image

The error is caused by no data in memory. The saved case is not opened. Perform first.

Current magnitude and angle can be calculated from the power injection (P+jQ) for each connected object (branch, transformer, load, shunt, generator, etc).

edit flag offensive delete link more


Okay, this was helpful. I initially used the .raw case and hence I had ```,RAWFILE)```. Now, I am getting the required Voltage magnitude and Angle based on suggested change: ``` ```

yugpatel22 gravatar imageyugpatel22 ( 2022-09-26 16:18:04 -0600 )edit

Can you please share, how can I extract the Power Injection data? Thanks!

yugpatel22 gravatar imageyugpatel22 ( 2022-09-26 16:19:18 -0600 )edit

API brnflo returns the complex power for a branch.

perolofl gravatar imageperolofl ( 2022-09-27 04:36:34 -0600 )edit

answered 2022-09-26 15:37:24 -0600

jconto gravatar image

I tried the python script on the savnw.sav and got no error.

On the error: "TypeError: cannot unpack non-iterable NoneType object", a NoneType object is related to non defined data, so it could be that the basecase is not being read.

Can you share why you need the bus current?

edit flag offensive delete link more


I want to get the Voltage and Current data to further perform state estimation

yugpatel22 gravatar imageyugpatel22 ( 2022-09-26 16:15:59 -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


Asked: 2022-09-26 13:33:28 -0600

Seen: 91 times

Last updated: Sep 26