Parameter Variation Studies (Extracted from Can/Am EMTP News Oct/1998) POCKET CALCULATOR VARIES PARAMETERS ( PCVP ) is a new request word that will result in a family of simulations. There is some similarity to the ancient SYSTEMATIC data cases in that the result usually will be predictable rather than random. But the new PCVP offers much greater flexibility. Reliance upon the new pocket calculator allows the user to modify any parameter of input data according to the formula of his choice as the program loops over the solutions. The already-explained $PARAMETER statement is used to specify the rules of parameter variation as a function of loop index KNT and any other program variables the user may want to involve. Parametric studies are not new. The concept dates to the early days of ATP when SPY was being enhanced to work well on Apollo workstations with their high-speed, scrollable, simultaneous windows and graphics. Unfortunately, Apollo no longer is with us. The Salford version does support SPY, but not as well as Apollo because display is limited to one window at a time, and windows are not integrated with the operating system. Nonetheless, Salford users can find parameter variation in INCLSPY5.DAT (for simulation) and INCLSPY6.DAT (for LINE CONSTANTS). Better than words, examples such as these explain the concept. However, use of SPY APPEND for arithmetic and data-card modification was primitive. The significance of new PCVP is that it has replaced APPEND programming in assembly language by FORTRAN programming of the new pocket calculator. Also, it avoids the need to locate and specify in detail all points of modification. Instead, reliance upon high-level $PARAMETER is used --- comparable to the way the user locates parameters for $INCLUDE use (see rules of DATA BASE MODULE). To conclude, the new PCVP is much easier to use, particularly for large data cases that might require simultaneous variation of several or many parameters in many locations. Prof. Mustafa Kizilcay of FH Osnabrueck in Germany wrote about parametric studies in E-mail dated August 16 th . No doubt, thinking about this message provided important impetus for the development of PCVP during the second half of August rather than later. About parametric studies, Prof. Kizilcay wrote: "sometimes similar to STATISTICS switch option, it is needed to execute the same data case repetitively, each time with a different value of a certain element in the network. As an example, the influence of a short-circuit reactance of the source network to energization overvoltages can be investigated in a convenient way, if the reactance is changed automatically and the data case is executed several times using different values at each run. This feature would be also interesting for repetitive phasor solutions. My idea is to specify parametric values of a circuit element between two (starting and ending) cards like ...." Apparently unaware of SPY use for the task, Prof. Kizilcay had envisioned his own dedicated extension to ATP. It was while thinking of problems associated with such dedicated code that your Editor envisioned a better alternative: reliance upon a general tool, the new pocket calculator. PCVP modeling was the result. It should be far better for production use than either rigid, dedicated code or the low-level SPY APPEND of years past. .PL4 plot files are handled differently for a PCVP study. Naming that is parallel with the input data file seems to be the only practical alternative for Salford DBOS, which limits file names to the eight characters of MS-DOS. I.e., there generally is not room to append serialization as part of the 8-character name. Besides, parallel naming generally is endorsed as a concept for non-PCVP cases, so it is natural to try to employ it for the new PCVP data cases, too. The following convention has been adopted: the usual file type .PL4 has been sacrificed in favor of 3-decimal-digit serialization. So, the .PL4 file of the first shot will have file type .001, the 2 nd will have .002, etc. No problem as long as the total number of shots MAXKNT is inferior to 1000. This should satisfy nearly everyone (handling a thousand disk files of consequence is a huge endeavor). But, there always will be some clown who will want more, so overflow into the file name has been allowed. I.e., the right-most byte of the file name will be overlaid by the thousands digit when it becomes nonzero, the byte preceding it by the ten thousands digit, etc., for as many bytes as might be required. No practical limit in sight. Using 8 + 3 = 11 decimal digits this way, the limit exceeds that of the 32-bit integer that is used to store the number of shots! Extrema of extrema is a new table for the .LIS file of PCVP studies. It will be seen at the end, after the final shot, provided the user requests the output of extrema by positive MAXOUT (the punch in column 40 of the integer miscellaneous data card). The rows of maxima and minima appear exactly as for normal extrema output, but the times that followed such output have been replaced by rows of corresponding energization numbers. These integers allow the user to identify the shot that produced the most extreme values of all output variables. If the user wants the corresponding time of the simulation, and parameter values associated with the data, these can be found by consulting the preceding output for the shot that is referenced, of course. Because the final table is fundamentally different from the preceding tables that look similar, it is distinguished by separator lines as demonstrated by the new 4 th subcase of DCNEW-25. Timing as reported by case-summary statistics at the end of the .LIS file deserves explanation. What has been done is the following. Times reported for the first four phases of execution will dominate, since these are the sums of the corresponding figures for all of the MAXKNT shots. The fifth phase is only traversed once, so should be relatively small, typically. All five are scaled uniformly in order that their total agrees with the known, actual time since the start of the first shot. Typically the reported total is slightly less than the total reported to the screen by Robert Schultz at the end of execution ("Total Execution Time was xxxx seconds") because it takes time to halt the program. For example, the output buffer may need to be flushed. IOPCVP is a new control variable that allows the user to suppress printout (the .LIS file) during the second and later shot. Value zero corresponds to full, normal ATP output (no suppression). This is the way parameter studies using SPY worked: the same output was produced over and over again, once for each shot. But the new PCVP is similar to STATISTICS or SYSTEMATIC in that it allows the limitation of output to extrema only. This is the effect of value unity, as illustrated by the 4 th subcase of DCNEW-25. It is the recommended, normal mode of operation when the user is not debugging or verifying procedures. Extrema are preceded by two special new lines of output: 1) A line documenting shot number KNT; 2) a line documenting the replacement symbols being used. Both should be self-explanatory, and the first of these two will be seen on the screen if DISK is used. Just as with STATISTICS or SYSTEMATIC, one status line will reassure the user of progress at the start of each energization. MAXOUT is the miscellaneous data parameter that requests the output of extrema. Normally, this is optional. But for PCVP simulation, extrema are the only output, normally. So, benevolent ATP will set MAXOUT to unity if the user fails to define a positive value. This illustrates one of several mandatory choices. Another is the plot frequency IPLOT. If the user is not saving .PL4 files (i.e., if ICAT is not positive), ATP will set IPLOT equal to -1 in order to suppress the accumulation of plot data points in RAM as well as on disk. Use of $PARAMETER with wide data formats began August 30 th . For years, R, L, and C have been varied using the old, narrow, 6-column alternative. But practical engineering sometimes requires more precision. Even if six significant digits might be plenty, there sometimes is loss of precision due to the need for either scientific notation or leading zeros of a number less than unity. So, the procedure was modified to allow wider data fields. Of most common interest should be $VINTAGE, 1, with its width of 16 for each parameter of a series R-L-C element. In surprisingly short order, your Editor made this work. That 4 th subcase of DCNEW-25 has been generalized to illustrate both wide and narrow formats. There are two parallel, disconnected circuits that give the same answer. Parameter Variation Studies by PCVP (Extracted from Can/Am EMTP News Jan/1999) POCKET CALCULATOR VARIES PARAMETERS ( PCVP ) is a request word that will result in a family of 12 simulations. For background, see the beginning of this story in the preceding issue. The feature evolves. Statistical tabulation of extrema is a concept familiar to those who perform Monte Carlo simulation. As illustrated by standard test cases DC-24 and DC-40, extrema not only can be tabulated, extrema also can be saved on disk for later combination and tabulation. Well, this concept of STATISTICS studies was extended to PCVP studies on August 29 th , and the 4 th subcase of DCNEW-25 was enhanced to illustrate such output. There are no new rules of data input since all the old ones of STATISTICS use continue to apply. Included among alternatives are the use of FIND and EXCLUDE to locate extrema that are not the worst (the only ones revealed by the extrema of extrema output). Batch-mode plotting was added to the PCVP data structure on August 30 th . How practical or popular this will prove to be is not known, however. One problem is that ATP screen graphics can not be scrolled today as they could using Apollo workstations of a decade ago. In any case, graphics now exist, giving data the same structure as a STATISTICS data case that includes a base case solution. Plot cards are to appear after the blank card ending node voltage (and possibly other) output requests, and before any request for statistical tabulation. Provided the user has not disabled plotting with negative IPLOT, the interpretation of plot cards will be seen in the .LIS file following the output of extrema. If the user has requested a PRINTER PLOT, this output, too, will be seen in the .LIS file. But, for the CALCOMP PLOT alternative, nothing more will be seen on the .LIS file, although plots will be seen on the screen if BOTH is used. For the user who disables plotting, nothing of plot cards or the blank card terminating them will be seen in the .LIS file. For an illustration, see the ever-changing DCNEW-25. Use of PCVP for frequency scans began September 12 th . This was in response to Gabor Furst's reaction to the preceding use for time-domain simulation. Quoting from his E-mail dated September 11 th : This raises an exciting possibility. Why not use it in HFS? We can then vary the value of a resistor as a function of harmonic number h using a user defined function.” The message from your Editor the following day began as follows: "I have put in about 6 hours, adapting PCVP to loop over frequency. I have my first results, and will attach them. Note that I vary both frequency and inductance using the pocket calculator. I do believe there is going to be yet another type of F-scan for you to illustrate at your course in Prague!" DCNEW-26 entered the set of standard test cases on September 19 th in order to document three different types of PCVP usage related to phasor solutions. By design, all three have comparable output. The first subcase creates its own loop over frequency whereas the second relies upon a familiar FREQUENCY SCAN declaration, and the third upon a HARMONIC FREQUENCY SCAN declaration, to do the looping. This is in addition to a PCVP declaration. Plotting as a function of frequency is permitted, of course, and the associated .PL4 file can be saved for later use by another program. For the F-scan user, the past 3 months have brought an important expansion of capability. Supporting programs are the third class of PCVP studies. Operation began October 2 nd , with only details differing from usage of the other two classes. A new 10 th subcase has been added to DC-59 to illustrate use with LINE CONSTANTS to vary the height of a transmission line. About differences, there is printout control IOPCVP, which has only limited effect as initially coded. Of course, full output requires no explanation. But reduced output is not reduced as much as for the other classes of PCVP use. Only printout outside the supporting program in question will be suppressed. About the .PCH file (punched output), DC59J.PCH will contain the card images for all passes concatenated in a single file. I.e., such output is unified. As usual, comment cards document which geometry produced which set of branch cards. Two-dimensional parameter variation is possible for LINE CONSTANTS, and probably also for CABLE CONSTANTS or CABLE PARAMETERS, if one of the two parameters to be varied is frequency. This innovative idea came from BPA's Dr. Tsu-huei Liu. Upon seeing the just-described variation of conductor height, she suggested the switch from a single, fixed frequency to a scan of frequency as used by the JMARTI SETUP fitter. It worked perfectly on the first try, and is illustrated by a new 11 th subcase of DC-59. Note that variation of the raw data (geometry) is the outer loop whereas variation of frequency is the inner loop. Both the .LIS file and the .PCH file will include all results in this same order, with comment cards of the latter clearly delineating the start of each new pass of the outer loop. Any STATISTICS or SYSTEMATIC data case is incompatible with the PCVP declaration. This observation about your Editor's programming came from BPA's Dr. Tsu-huei Liu during debugging of PCVP use with LINE CONSTANTS. It is true: at least one variable ( KNT ) is used by both features, but with different meanings. Is this limitation worth removing? It seems to your Editor that simultaneous use would be impractical. It would be placing too many eggs in one basket. By itself, STATISTICS or SYSTEMATIC is enough of a challenge, generally. What reader disagrees, and why? Timing of PCVP use with a supporting program passed through simulation formulas prior to correction on October 25 th . Sometimes it died on DC-59, with division by zero time. This was using BPA's shared, 90-MHz Pentium across the hall. Why the trouble was not seen at home on your Editor's 133-MHz Pentium, or on Dr. Liu's 486 at BPA, is not known. Salford DBOS is newer, of course. If one symbol contains another, the shorter one must follow the longer one rather than precede it. This was a new restriction beginning October 23 rd , when the illustration of DCNEW-25 was changed. This became necessary following permission of one or more blanks preceding the equal sign. When such a blank was part of the symbol, it distinguished MILLIH from MILLIHENRIES, for example. But once this distinction ended (once trailing blanks were ignored, as they should be), the shorter symbol would be located where the longer was intended. In fact, both would be found if the shorter had been declared first. ATP now checks for such conflicts, and will issue a message such as the following: "++++ Notice. Symbol 1 is contained within symbol 2. Swap these two and try again." Use of FMTPL4 = widexx with a PCVP loop over simulation resulted in missing heading lines of the 2 nd and later .PL4 files. I.e., the .001 file was correct and complete whereas the .002, etc. files were missing the first 3 lines. This was prior to corrections in TSHEAD and PLTFIL late on December 3 rd . Orlando Hevia of Universidad Tecnologica Nacional in Santa Fe, Argentina, first reported the problem in E-mail early that same day.