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

Ask Your Question
0

Extract Bus Voltage Magnitude and Angle from .sav case

asked Sep 26 '2

yugpatel22 gravatar image

updated Sep 26 '2

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.

2 answers

Sort by » oldest newest most voted
1

answered Sep 26 '2

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

link

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 (Sep 26 '2)

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

yugpatel22 gravatar imageyugpatel22 (Sep 26 '2)

API brnflo returns the complex power for a branch.

perolofl gravatar imageperolofl (Sep 27 '2)
0

answered Sep 26 '2

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?

link

Comments

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

yugpatel22 gravatar imageyugpatel22 (Sep 26 '2)

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: Sep 26 '2

Seen: 438 times

Last updated: Sep 26 '22