0

Extract Bus Voltage Magnitude and Angle from .sav case

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.

yugpatel22's avatar
7
yugpatel22
asked 2022-09-26 13:33:28 -0500, updated 2022-09-26 13:34:25 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

2 Answers

1

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

perolofl's avatar
3.8k
perolofl
answered 2022-09-26 15:16:25 -0500
edit flag offensive 0 remove flag delete 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's avatar yugpatel22 (2022-09-26 16:18:04 -0500) edit

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

yugpatel22's avatar yugpatel22 (2022-09-26 16:19:18 -0500) edit

API brnflo returns the complex power for a branch.

perolofl's avatar perolofl (2022-09-27 04:36:34 -0500) edit
add a comment see more comments
0

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?

jconto's avatar
2.9k
jconto
answered 2022-09-26 15:37:24 -0500
edit flag offensive 0 remove flag delete link

Comments

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

yugpatel22's avatar yugpatel22 (2022-09-26 16:15:59 -0500) edit
add a comment see more comments

Your Answer

Login/Signup to Answer