Transient Stability Analysis Expert System Component Siva G. Narendra Northeast Parallel Architectures Center Syracuse University, Syracuse, NY Project Leader: Dr. Paul Coddington Advisor: Dr. Salim Hariri Transient Stability Analysis Expert System Component Siva G. Narendra Northeast Parallel Architectures Center Syracuse University, Syracuse, NY The NMPC/NPAC project has been proposed to address the issue of using parallel processing in electric utility industry. Currently, the process of transient stability analysis consumes a consider- able amount of man-hours in the NMPC. The stability analysis is done off-line following a stan- dard procedure which makes extensive use of heuristic knowledge of the human expert [1]. In this project the stability analysis will be improved by combining the power of parallel processing with expert systems. The role of parallel processing is to speed up the process of transient stability analysis. The role of the expert system is to automate the decision making process. This report explains how the data from the Output Analysis Program (OAP) is interpreted, and how the stabil- ity decision is made for a given set of parameters using the CLIPS expert system. 1.0 Implementation Overview According to the study conducted in phase 1 of this project, there exists a specific order in which a set of parameters should be analyzed. And if one of the parameter is unstable for a given power output, it will be considered unsafe--in which case the parameters will be studied for the next lower level of generated power. This is repeated until all the parame- ters under study are stable for a power output level. Under that condition the safe limit will be 10% below the stable power output level. The current implementation for the expert system component consists of two parts. The plot for study will be generated by the Output Analysis Program (OAP). This plot has to be mapped to expert facts and is done by a C++ utility called res2clip. C++ was used to make use of the elegant i/o streams. The used compiler was g++. The expert facts gener- ated by res2clip will be studied by the expert rules called analysis.clp. The inference engine used was CLIPS/XCLIPS v5.1. Res2clip utility allows the client/control program to specify the list of parameters to be analyzed in a specific order. Following this, running of expert rules on the facts generated by res2clip, the decision(s) will be inferred. The decisions are also stored in a file called feedbak, which will be used by the client program to feedback data into ETMSP and OAP. The method of data mapping and decision making is explained in Section 2. The usage of the utilities res2clip and analysis.clp is explained in Section 3. Further work is given in Section 4. Appendix A contains the listing for the res2clip.cc utility and Appendix B has the listing of analysis.clp. Commentary for a sample run is given in Appendix C. 2.0 OAP Data Interpretation and Decision Making The data generated by OAP has the time varying plot for a specific channel of choice. Translation of the plot data into a format that expert system can understand is essential. Following this mapping the expert system can make a decision on stability. The mapping and the decision making is explained below: o Figure 1(a) depicts a plot of sample data from OAP. o This mapped to a peak to peak variation first, and the resulting graph will be similar to the one in Figure 1(b). o Figure 1(c) shows the peak to peak variation for each cycle as a bar-graph. o We will refer to each bar in the graph of Figure 3(c) as a sample. FIGURE 1. DATA INTERPRETATION EXAMPLE (a) OAP output (b) Peak-to-peak variation of the OAP output (c) Peak-to-peak variation as a bar graph and the mapping function illustration for 3 samples/bucket. o Following this mapping a bucket-scheme is used for interpreting the data. o Let S represent the number of samples/bucket. For each bucket Bi:i=1 to N, let there be Si samples (where Si <= S). We perform a mapping function F(), to get one sample/ bucket from S samples/bucket. o Currently we have identified and implemented MAX and MEAN to be the choice on F(). o The bucket size is also left to the choice of the client program. o These options can be specified in the command-line of the res2clip utility. o All the above mapping functions are performed by the res2clip utility. o The decision making is done as follows. After the mapping we will have atmost N sam- ples of magnitude Ci:i=1 to N. If Ci <= Cj, for all i>j and i, j=1 to N, then the wave- form will be considered stable. It will be considered unstable, otherwise. 3.0 Usage of the Decision Making Utilities The flow of the implementation is given in Figure 4. res2clip maps OAP (v3.0/v3.1) plot files into expert system facts. Currently we assume there will be one channel plot per file. The syntax for invoking res2clip is given below: res2clip M B F G ... o M (integer) represents the MW o/p of the generators for which .. describes the plot of n different parameters. (MANDATORY) o B (integer) represents the bucket size in samples per bucket. (MANDATORY) o If F=max then MAX() will be used to transform the B samples in a bucket to 1 sample. If F=mean then MEAN() will be used to do the same. (MANDATORY) o If G=y, then xgraph will be plotted, if G=n then the graph will not be plotted (MAN- DATORY). o ... Represents the n input (*o.resref) files. The order of the input files signifies the order of analysis required at the expert system level. We assume there is 1 channel/parameter per input file file. (ATLEAST 1 i/p FILE IS MANDATORY) o Name of the file were the CLIPS data is to be stored. (MANDATORY) In the current version (v1.2) of res2clip is it assumed that there will be 1 channel/parame- ter plot in each i/p file and that all the i/p files represent the status of a parameter for 'M' MW power generation. All fields marked MANDATORY, SHOULD be present in the command-line. The ORDER of fields in the command-line SHOULD be as above. FIGURE 2. Execution flow As mentioned above the required set of parameters to be analyzed in a specific order should be given in the command line of res2clip. xgraph plots are optional. Though the graphs are not normalized before plotting--the magnification available in xgraph can be used to view sections of the plot. res2clip can read both v3.0 and v3.1 output formats of OAP. Once the facts generated by the res2clip are stored in the specified output file, the one can load both the output file and analysis.clp into CLIPS. To get the decision type (run), fol- lowed by an enter. The running commentary and the decision will be displayed. The result will also be appended to a standard file called feedbak. If XCLIPS is used, the execution time statistics can also be displayed, through the watch menu under execution main menu. It is also possible to invoke both res2clip and analysis.clp in a single step. For this, the cli- ent program shoukd generate a batch file that CLIPS can understand. And as any system command C can be invoked from the CLIPS shell using (system "C"), res2clip can also be invoked. The batch file can be tailored to fit any set of analysis. After the batch file is cre- ated, one can either do the run by typing clips < batchfilename or invoke xclips and load the batch file using (batch "batchfilename"). In the former case it will be necessary to include an (exit) statement at the end of the batch file if one needs to return back to the sys- tem prompt after the run. The result of all executions will be summarized into the feedbak file, which the client program can access to take further action. A sample run with commentary and sample batch & feedbak files are presented in Appen- dix C. 4.0 Further Work Further work includes the automation of contingency selection, and fixing a value or a range of values for the bucket size so that the decision made by the expert system matches with that of the experts. Appendix A. res2clip.cc Listing Appendix B. analysis.clp Listing Appendix C. Sample Run The following are the details of the sample run. o The run invoked both res2clip and analysis.clp in a single step using the batch files. o Two parameters were tested for stability. The plots were obtained from OAP for a sam- ple test case. The parameters analyzed were GENERATOR APPARENT IMPED- ANCE (REAL) / IOTA 118.0 1 / CH# 45 and GENERATOR APPARENT IMPEDANCE (REAL) / ALFA 132230. 1 / CH# 21 from a 450 bus system o The batch file used in the analysis is given below. Note that the italic characters are comments used for description and is not a part of the batch file. (system "rm feedbak") remove previous feedbak (optional) (clear) clear old facts and rules in clips (system "res2clip 2000 5 max y 1 2 output1.clp") run res2clip with the required options (load "analysis.clp") load the rules (load "output1.clp") load the facts created by res2clip (reset) make clips ready (run) run the rules (system "rm output1.clp") remove the generated "facts" file (system "rm graph.r2c") remove the generated xgraph file Start test 2, don not remove feedbak if the previous result(s) are needed All statements have the same meaning as above (clear) (system "res2clip 2000 5 mean n 1 2 output1.clp") (load "analysis.clp") (load "output1.clp") (reset) (run) (system "rm output1.clp") (system "rm graph.r2c") o The batch file was loaded after invoking XCLIPS. To do this type xclips in the unix prompt. And use the load batch option in the file menu, to load the batch file. o If clips is invoked through clips < batchfile &, then the batch file should have an (exit) at the end of the batch file to kill the clips process, after completion. The process can also be run in the foreground. o The above batch file had two tests is in it. It is advisable to use all the above statements that are not marked optional for tests unless the client knows the consequences. Using the concept of batch files, multiple parameters can be analyzed and multiple test cases can be run. The result will be displayed as a running commentary and the decision will be appended in the feedbak file. o The feedbak file for the above run was 2000MW 5smp/bckt MAX STABLE 1 (Safety Limit 1800.0) 2000MW 5smp/bckt MEAN UNSTABLE 0 o The meaning of the first line is that the set of parameters given for analysis at 2000MW, with 5 samples per bucket and MAX as the transformation/mapping function was found to be stable (the flag 1, after the word STABLE also indicates the decision was stable). The second line is the result of the second test in the above batch file, and it conveys that the specific test for the given parameter list was unstable (note the flag is a 0). If the test was stable the safety limit (10% below the operating power) will also be given. The format of each line in the feedbak file is standard and is as explained above. o The peak-to-peak xgraph plot of the two parameters considered is shown in Figure 3. The name of the waveforms in the xgraph also follows a standard, that being: POW- ER_ORDER. For e.g., 2000_1, correspond to the parameter that was analyzed first for the power output of 2000MW. FIGURE 3. Peak-to-peak plot of parameters considered in the sample run. o The running commentary generated by the rules, for the above run is given below. The commentary has the time statistics as well. For test cases which yield an unstable deci- sion, the commentary will be helpful in identifying which parameter introduced the unstable condition. STABILITY ANALYSIS COMMENTARY Power Output: 2000 Bucket Size: 5 Transformation Function: MAX 1..Parameter Name case450.bin_GENERATOR_APPAREN- T_IMPEDANCE..Analysing bucket number =0 1..Parameter Name case450.bin_GENERATOR_APPAREN- T_IMPEDANCE..Analysing bucket number =1 1..Parameter Name case450.bin_GENERATOR_APPAREN- T_IMPEDANCE..Analysing bucket number =2 2..Parameter Name case450.bin_GENERATOR_APPAREN- T_IMPEDANCE..Analysing bucket number =0 2..Parameter Name case450.bin_GENERATOR_APPAREN- T_IMPEDANCE..Analysing bucket number =1 2..Parameter Name case450.bin_GENERATOR_APPAREN- T_IMPEDANCE..Analysing bucket number =2 2..Parameter Name case450.bin_GENERATOR_APPAREN- T_IMPEDANCE..Analysing bucket number =3 RESULT: THE PARAMETER SET WAS STABLE AT 2000 MW The safety limit is 1800.0 MW 24 rules fired Run time is 0.2469999999993888 seconds 97.16599190307444 rules per second 12 mean number of facts (16 maximum) 1 mean number of activations (1 maximum) STABILITY ANALYSIS COMMENTARY Power Output: 2000 Bucket Size: 5 Transformation Function: MEAN 1..Parameter Name case450.bin_GENERATOR_APPAREN- T_IMPEDANCE..Analysing bucket number =0 1..Parameter Name case450.bin_GENERATOR_APPAREN- T_IMPEDANCE..Analysing bucket number =1 1..Parameter Name case450.bin_GENERATOR_APPAREN- T_IMPEDANCE..Analysing bucket number =2 2..Parameter Name case450.bin_GENERATOR_APPAREN- T_IMPEDANCE..Analysing bucket number =0 2..Parameter Name case450.bin_GENERATOR_APPAREN- T_IMPEDANCE..Analysing bucket number =1 RESULT: THE PARAMETER SET WAS UNSTABLE AT 2000 MW 16 rules fired Run time is 0.1520000000000437 seconds 105.2631578947066 rules per second 13 mean number of facts (16 maximum) 1 mean number of activations (2 maximum) o It is clear from the second test that parameter that was analyzed second was unstable, as the test stopped when analyzing bucket number 1 of parameter 2. Bibliography [1] IST Report No. 1, August 30, 1993. [2] Joseph Giarratano, "Expert Systems: Principles and Programming", Boyd & Fraser, 1989. [3] "CLIPS Conference Proceedings", NASA Conference Publications, 1991. [4] "High Performance Computing and Parallel Processing in Utility Industry", NPAC Proposal. [5] David Harrison, "Xgraph Manual Pages", Sun Release 4.1, February 1, 1989.