Ask Your Question
0

Extract Bus Voltage Magnitude and Angle from .sav case

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

yugpatel22 gravatar image

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

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
1

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

perolofl gravatar image

The error is caused by no data in memory. The saved case is not opened. Perform psspy.case() 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

Comments

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

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

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

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

API brnflo returns the complex power for a branch.

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

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

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

Comments

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

yugpatel22 gravatar imageyugpatel22 ( 2022-09-26 16:15:59 -0500 )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: 2022-09-26 13:33:28 -0500

Seen: 285 times

Last updated: Sep 26 '22