Ask Your Question
0

Multiple ACCC results to Excel

asked 2016-12-16 15:33:03 -0600

jeremy.harris.ee gravatar image

For reference, I'm using PSSE v33, but have access to v34.

I've been trying to refine some processes and use some of the API functions that PSSE offers to send ACCC results to an Excel spreadsheet. I typically run multiple cases (various seasons/years) and would like to be able to run one python file and have it spit out all of my branch overload violations to a single worksheet, all of my voltage violations to a second worksheet, and all of my non-converged contingencies to a third worksheet. In each of these worksheets I would want to insert a column on the left that specifies what case the results came from. Setting up the spreadsheet doesn't seem to be very difficult, but I'm struggling to find a way to pull all of my violations from the .acc files.

The psssexcel.accc function is very brute and does not give very many options for customizing the information the user would want to see as well as the placement. In my case, I don't need the column headers, or some of the fields that are reported, and I would want to append it to the end of my worksheets. In the interim, I am using this method and using copy and paste to put all of my results into one spreadsheet. However, this does not report non-converged contingencies.

The pssarrays module seems to be lacking in order to pull all violations into an array, and be able to append them to a single file with other results.

The problem with the accc_violations_report is that it only reports the worst violation and associated contingency. I want to do my due diligence and make sure that I'm reviewing all potential violations. Another problem is that it spits the results to a report file, rather than an array.

I can use the accc_solution function, but I would have to specify each contingency, which could be completed through a loop of all my contingencies. The problem here is I have 1000+ contingencies to look through for N-1, and many more (on the order of 60k+) if I'm considering the multi-level AC contingency analysis. Not only that, this would return every monitored branch and bus voltage, where I'm only interested in the violations. In my mind this is overkill for what I am trying to do.

For those of you familiar with NERC Reliability Standard TPL-001-4, I am also running analysis on our "long-lead time equipment" gaps by: 1) taking an outage to a specific transformer 2) running ACCC analysis 3) looking at results I have 7 cases (4 seasonal cases, as well as 3 sensitivity cases), and am performing these 3 steps for 20+ equipment gaps. That's 140 acc files! It would be amazing if I could get some functions such as accc_branch_violations, accc_voltage_violations, and accc_non-converged to be able to return different arrays of violations with associated information: Branch overloads: From Bus #, From Bus Name, To ... (more)

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2016-12-22 10:40:29 -0600

ddhungana gravatar image

updated 2016-12-22 10:45:48 -0600

I wrote a similar python script to export all branch and voltage violations in an excel sheet. You can extract the list of contingencies from .acc file using acccsummary function. You can then loop through each contingency using acccsolution to get the branch and voltage violation flows. You are right, this will give all the flows in all the monitored branches and volts in monitored buses, but you can do some filtering later to just keep the violations. Finally, you can dump the results in an excel sheet using xlwt or a csv writer function. Its a little complicated, but trust me all your dreams will come true at the end.

edit flag offensive delete link more
0

answered 2016-12-17 11:42:26 -0600

mjinli gravatar image

I wanted to post this as a comment, but it was too long. I think it should still give you what you're looking for though.

While it may be possible to do what you're saying directly with PSS/E API functions, I believe it would be much easier to do it with Python spreadsheet post-processing. Using a library like openpyxl or xlrd/xlwt you can insert things like case names or combine excel files quite easily.

What will make this a generalized solution (and reduce your workload) is writing the following scripts in a way that lets them automatically find all cases/.accc files. This will find all .sav cases located in the same folder as the script itself:

dirname = os.path.dirname(os.path.realpath(__file__))
for file in os.listdir(dirname):
    if file.endswith(".sav"):

Then, you can do the following:

  1. Write a python script which runs ACCC on each of your cases and outputs "casename.accc"
  2. Write a python script which goes through your ACCC files (or pssexcel excel outputs) and outputs the results in the format you want to an excel spreadsheet.
edit flag offensive delete link more

Comments

Thanks for the feedback. I'm not concerned with finding all of my cases and running ACCC. I've got python files that do that already. What I'm most interested in is how to do #2: go through the ACCC files and output the results in the format I want.

jeremy.harris.ee gravatar imagejeremy.harris.ee ( 2016-12-19 09:18:25 -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

1 follower

Stats

Asked: 2016-12-16 15:33:03 -0600

Seen: 2,075 times

Last updated: Dec 22 '16