You are on page 1of 37

GTPPLOT: Plotting Program for ATP Output Files

Orlando P. Hevia
Canadian/American EMTP User Group

Gorostiaga 1483
3000 Santa Fe
Argentina
ohevia@ieee.org

1. Introduction.
GTPPLOT is a plotting program for ATP output, compiled with the GNU FORTRAN, and
makes use of the graphical package DISLIN. The program is available for DOS-djgpp
extender, Windows 32, and Linux. It has the following capabilities and limitations.

2. Capabilities and Limitations


File format:
The present version of GTPPLOT can read widenn, formatted graphics files (FMTPL4 =
10Fnn.) both with nn arbitrary, C-like binary files, including the new format obtained with
NEWPL4=2 (called PISA), and FORTRAN (DOS-djgpp, Mingw32, Linux, and SALFORD)
unformatted files. The extension of the graphic file must be .PL4 for convenience, but the
user can choose other extensions. If the extension is .cfg, the program will regard the file as
a COMTRADE file, and will read the pair .cfg and .dat, converting them to a .pl4 file. The
program detects automatically the format of the file. If the extension is .pss, the program will
regards the file as a PSSPLT ASCII file. PSSPLT is the stability plotter program of PSS/E 26
package (Power Technologies Inc.)

Number of points:
The GTPPLOT can process graphics files with up to 1000000 points (100000 for DOS djgpp
version) and up to 1000 variables, sufficient for the usual application. The program writes all
the data in a binary file and maintain in memory only the time values and up to 20 variables.
The program uses all the points, there are no smoothing.

Number of curves:
The program can plot graphics with 1 to 20 curves. The curves can be distinguished by
color, line type, or symbols, or the combinations of them.

Mouse and screen control:


The program cannot control the mouse. The user must use the keyboard for all the input
operations. The command may be in upper or lower case. The screen scrolls continuously.
1

The Mingw32 and Linux versions use the right button mouse or <enter> key to escape from
graphic mode. The pointer must be in the plot. The DOS version, uses <enter> key only.

Output Formats:
The program can generate graphics files in six different formats: HP-GL (Hewlett-Packard
Graphic Language), CGM (Computer Graphics Metafile), WMF (Windows Meta File), PNG,
JAVA, PCX, PostScript, PPM (Portable PixMap), PDF, BMP (Windows Bit Map), MATLAB,
MATHCAD and GNUPLOT. Some options are limited with GNUPLOT format.
The screen plot can be in various formats, in color or black and white, and the screen
resolutions supported are 640*480, 800*600, and 1024*768. The Mingw32 and Linux version
uses the screen resolution as defined by the operative system.

Available Commands:
GTPPLOT obeys the following commands:
CHOICE: To show the variables in the graphic file.
STOP: To stop the program execution.
# : To choose the variables to plot by number. $ and / are synonyms of #.
GO: To do the plot.
MENU: Shows the available commands.
LABEL: To set the labels for the plot. The y label can be 15 bytes long, the title lines can be
four, and 60 bytes long, as the x label.
FACTOR: To scale each variable (multiply by FACTOR).
OFFSET: To displace each variable (sum OFFSET).
RESCALE: To delete the effect of FACTOR and OFFSET.
LIMITS: To set the limits on the y-axis.
TIME: To set the limits on the x-axis. The units must be in agreement with TIME UNITS
command.
ALL TIME: To set the time limits to original.
TYPE: Show in screen formatted files: Uses LESS freeware program.
TIME UNITS: To choose time units different from seconds.
EXTREMA: To search the extreme values of each selected variable.
X-Y PLOT: To plot one or more variables versus another, not versus time.
SET: The user can set one parameter, read a complete setting file, or edit the setting file
with the text editor of his preference.
VECTOR: To return to normal plot from X-Y PLOT.
MS-DOS (OS, LINUX, ! are synonymous): go to Operative System shell. If followed by a legal
command, this command is executed. ! command is a short form.
PL4: Send the dir *.pl4 DOS command.
@ : Reads a GTPPLOT commands file, cannot be nested.
HELP: Lists the gtpplot.hlp with LESS freeware program. This ASCII file explains in detail
this commands. A gtpplot command can follow HELP, to be searched for in
gtpplot.hlp. ? is a synonym of HELP.
FILE: Shows HP-GL files with PRINTGLD shareware program or HP2XX freeware program.
DICE: Plot STATISTICS cases reading the text output of ATP (extension .lis).
FOURIER: GTPPLOT calculates the Fourier components of the selected variable, calculates
the most common Power Quality Indices, and creates a plot with the derating of a
2

transformer as function of Pce-r (ANSI 57.110), with K (derating factor) as parameter. It


can create a family of Fourier series as time function. For a FREQUENCY SCAN or
HARMONIC FREQUENCY SCAN case, FOURIER plots the time function of the variable
(inverse Fourier). For HFS, sub and inter harmonics are allowed.
NAME: To choose the variables to plot by name, not by number.
SHAFT: To calculate generator shaft fatigue. See Appendix 5.
CACHE: To plot variables from different files in the same figure.
SCAN PL4: To show the values in .pl4 file as text
SCAN PLOT: To show the selected variables as text.
LEVEL: To search for the first level crossing of selected variables.
PAUSE: To stop momentarily the text screen, useful for demonstrations.
BODE: To plot a frequency function as Bode plot.
AUTO SCALE: To scale all the selected variables to the same size in plot.
JOIN: To create a new graphic file with variables of two different files.
COMTRADE: To generate IEC COMTRADE files from graphic files.
RELAY: To generate formatted files with up to 20 variables plus time, or all the variables if
RELAY ALL is sent.
PEAKS: To search a selected variable for peaks.
ZEROES: To search a selected variable for zero crossing and slope calculation.
KIZILCAY: To generate data of KIZILCAY F-DEPENDENT from FREQUENCY SCAN cases.
MATLAB: To generate MATLAB binary files with up to 20 variables plus time, or all the
variables if MATLAB ALL is sent.
MATHCAD: To generate MATHCAD CSV files with up to 20 variables plus time, or all the
variables if MATHCAD ALL is sent.
MATKA: To generate MATHEMATICA ASCII files with up to 20 variables plus time, or all
the variables if MATKA ALL is sent.
ADF: To read ASCII Data Files with PLOTXY format. Up to 20 variables plust time are
allowed.
LOGY: To plot with logarithmic y-axis.
LOGX: To plot with logarithmix x-axis.
AGFPLOT: To plot ARMAFIT .agf graphic files.
SLOPE: To calculate the derivative of all chosen variables.
I2T: to calculate the i 2 t for all the chosen variables.
RMS: to calculate the RMS of all the chosen variables, with the frequency FPOWER.
INTEGRATE: to calculate the integral of all the chosen variables.
PLOT: to access some mathematical operations with variables. The following operations are
allowed:
VAR(n): plots the variable without changes.
RMS(n): plots the RMS of the variable.
INT(n): plots the integral of the variable.
DER(n): plots the derivative of the variable.
I2T(n): plots the i 2 t of the variable.
POWER(n1,n2): plots the power as v(n1)*i(n2)
ENERGY(n1,n2): plots the energy as the integral of v(n1)*i(n2)
HSOURCE: To generate HFS sources from time functions harmonics.
IMPEDANCE: To calculate impedance from Voltage-Current variables pair.
PARAM: To plot parameters as function of frequency of lines/cables as calculated by CABLE
CONSTANTS, CABLE PARAMETERS, LINE CONSTANTS, JMARTI SETUP and
SEMLYEN SETUP auxiliary routines of ATP.
DIBCLP: To draw the data for CABLE CONSTANTS, CABLE PARAMETERS and LINE
3

CONSTANTS cases.
PHASOR: To plot steady state solution as phasors.
PSS: To send data to a PSSPLT ASCII file.
TRV: To draw IEC 56 lines superimposed to TRV voltages.
PCVP: To plot a 3-D family of curves as obtained with PCVP. For multiple HFS cases, a table
of principal PQI is generated in gtpplot.log
THD: To plot the THD as time function of a variable.
FILTER: To calculate RLC filters from FREQUENCY SCAN .pl4 files
AVERAGE: Toggles on or off the average of data to plot. It is the equivalent of AVERAGE
OUTPUT of ATP.

3. How to use the program:


The program can be invoked with the filename (for a .pl4 file) or @@filename for a command
file (batch process). If the graphic file has a different extension, this extension must be sent
too.
If the user does not send a filename, the program lists all the .pl4 files on the screen, and a
explanation about that can be done.
With the program running, the user can send the commands as listed.
The first command the user generally sends is CHOICE: the screen shows all the available
variables, with a number.
The user sends the pound symbol (#), followed by the variable number as desired, ended by
<enter>.
The program shows the variable names, as control.
If the user sends the command GO, the program creates all the files as enabled by the
gtpplot.ini file indicates, and then plots the graphics on the screen.
The files are serialized as follows:
gtpplo01.ext, gtpplo02.ext... with ext= plt for HP-GL format, cgm for CGM format, wmf for
WMF, png for PNG, jav for JAVA, eps for Postscript format, pcx for PCX format, ppm for
PPM format, pdf for PDF, bmp for Windows Bit Map, and gnu for GNUPLOT format.
The program can generate a log file, with the responses to the commands. The usefulness of
the log file is for the programmer, of course, but the general user can find some results, as
the Fourier series, in the log file. This file is called gtpplot.log.
The KIZILCAY command allows generate data in ARMAFIT format, to obtain the coefficients
of KIZILCAY F-DEPENDENT elements. The user must choice the adequate Magnitude and
Angle of an Admittance variable.
The output will be written in kizil0nn.aft files.
The MATLAB command allows generate data in MATLAB binary format. The node names
are respected, a v or an i added for voltage or current variables, respectively. The space
and minus characters are changed to underscore, as MATLAB requires. The MATLAB files
are serialized using the name of plot file with last two bytes replaced by nn increasing from
01 in the same gtpplot session, with extension .mat.
If the user send # command to choose variables, only the variables selected will be in the
MATLAB file, up to 20 plus time. If the user sends the command followed by ALL, all the
variables in plot file will be in the MATLAB file.
The MATHCAD command allows generate data in MATHCAD CSV format. The MATHCAD
5

files are serialized using the name of plot file with last two bytes replaced by nn increasing
from 01 in the same gtpplot session, with extension .prn. A parallel file, with node names
and variable types description is generated, with the same name, and extension .cfg.
If the user send # command to choose variables, only the variables selected will be in the
MATHCAD file, up to 20 plus time. If the user sends the command followed by ALL, all the
variables in plot file will be in the MATHCAD file.
The MATKA command allows generate data in MATHEMATICA ASCII format. The
MATHEMATICA files are serialized using the name of plot file with last two bytes replaced
by nn increasing from 01 in the same gtpplot session, with extension .m.
If the user send # command to choose variables, only the variables selected will be in the
MATHEMATICA file, up to 20 plus time. If the user sends the command followed by ALL, all
the variables in plot file will be in the MATHEMATICA file.
The AGFPLOT command allows to plot the graphic output files as produced by Taku Noda
fitter ARMAFIT. A series of files agfplnnn.ext is generated, with all the available graphic
formats.
The HSOURCE command allows to produce HFS sources from time function harmonics. The
output files are serialized hsourc01.pch, etc.
The IMPEDANCE command is to toggle on or off the impedance calculation from a VoltageCurrent variables pair. The beginning time and frequency are requested, with (0.0, FPOWER)
as default.
The PARAM command allows produce plots of parameters as function of frequency. The
output is serialized parame01, parame02, etc.
The PHASOR command allows to plot the steady state solution as wrote in .lis file by ATP.
The following few subcommands are allowed:
CHOICE, NAME, #, GO, END, STOP. The output will be in phasornn.ext files.
The TRV command allows draw IEC 56 lines superimposed to TRV plots. The output is
serialized trvplo01, trvplo02, etc. For details, see gtpplot.hlp.
The PCVP command allows draw a family of time simulations as result of a PCVP case. The
user must open the first file of the series (file.001), to allow gtpplot to know the file name of
the series, and the file type. Only a variable at time can be plotted. Up to 127 files for
DOS/DJGPP version, up to 511 files for Mingw and Linux versions.
The THD command allows plot Total Harmonic Distortion as time function for one variable.
THD allows to be followed by an optional number: it is the window for THD calculation. The
default (no number passed) is 1/8 cycle.
The FILTER command allows calculate RLC filters from FREQUENCY SCAN .pl4 files. The
output must be POLAR, RECTANGULAR or BOTH. It is responsibility of the user to choose
impedance (voltages for 1 A current) variables.
6

The command FILTER can be followed by a number 1 (default) is for homopolar filter, 3 for
direct sequence filter. The filters can have up to 20 RLC branches.
The output is filternn.dat for use with an external program, filternn.pch to insert in ATP. The
frequency response is plotted for each filter, serialized filtpnnn.ext (polar coordinates),
filtrnnn.ext (rectangular coordinates). The extension includes adf (ASCII DATA FILE).
The program rejects the calculation if a negative resistance appears in .pl4 file.

4. The gtpplot.ini file


The different options for some features of GTPPLOT can be selected from the gtpplot.ini file.
This ASCII file can (and must) be edited with the users preferred editor, to adapt all the
parameters to the user needs.
The sense of the variables is the same as the STARTUP: the 1 enables the NOxxxx. With the
values shown, the user obtains HPGL output, screen output, a grid is added, the curves are
with different line types, and with different colors. As sample, the gtpplot.ini file follows:
FPOWER
FREQFR
PROP
TBEFORE
50.0
50.0
1.0
0.0
SKIZIL
Y0
YINF
ORDMIN
1.0
9999.0
9999.0
1.0
NOHPGL
NOCGM
NOGNU
NOPOST
0
1
1
0
NOCOLOR
NFORSP
NSHADF
NSHADS
0
32
0
0
NODERATE NOPERC
NOZERO
NOBOX
0
0
0
0
NOREV
NOWMF
NOJAVA
NSTATI
1
1
1
0
IFOUR
NOSYMM
JX
JY
0
1
5
50
NOBMP
NOTIT
KPHASOR
NOSAVE
1
0
1
1
PRINT
GRAPHIC VIEWER PROGRAM COMMAND
PRINTGLD /FV^ /LR /CKBRGVK /P
EDITOR
ASCII TEXT EDITOR
EDIT
FONT
SIMPLX

TAFTER
0.0
ORDMAX
15.0
NOSCREEN
0
NOLOG
0
NOWINDO
0
NODATE
1
NX
795
NRM
22

CSIZE
1.0
ERROR
5.0
NOGRID
0
NOCROSS
1
NOPCX
1
NOFILE
1
NY
550
N5
0

SSIZE
1.0
WITER
0.0
NODASH
0
NOFRAME
0
NTIME
3
NOPNG
1
NOPDF
1
N6
0

THRES
0.0001
GAIN
1.0
NSYMBOL
0
NOBARS
0
NOCLEAN
1
L4FULL
0
NOPPM
1
N7
0

PARAMETER
FPOWER
FREQFR
PROP
TBEFORE
TAFTER
CSIZE
SSIZE
THRES
SKIZIL
Y0
YINF
ORDMIN
ORDMAX
ERROR
WITER
NOHPGL
NOCGM
NOPOST
NOGNU
NOSCREEN
NOGRID
NODASH
NOSYMBOL
NOCOLOR
NFORSP
NSHADF
NSHADS
NOLOG
NOCROSS
NOFRAME
NOBARS
NODERATE
NOPERC
NOZERO
NOBOX
NOWINDO
NRPCX
NTIME
NOCLEAN
NOREV
NOWMF
NOJAVA
NSTATI
NODATE
NOFILE
NOPNG
NOBMP
NOTIT
KPHASOR
NOSAVE
L4FULL
IFOUR
JX, JY
NX, NY
NOSYMM
NOPDF
NOPPM
NOGIF
NRM
PRINT
EDITOR
FONT

Description
Frequency for time scales and RMS calculation
Frequency for Fourier Analysis
Proportion for the plot
Waiting time (in seconds) before screen plot (batch mode only)
Waiting time (in seconds) after screen plot (batch mode only)
Character size multiplier (0.5CSIZE1.0)
Symbol size multiplier (0.5SSIZE1.0)
Threshold value for harmonic source inclusion.
Key to produce 'S' ARMAFIT files (1.0) or 'Z' (0.0)
Admittance for zero frequency. 9999. for use the admittance for minimum frequency.
Admittance for infinite frequency. 9999. for use the admittance of maximum frequency.
Minimum order for ARMAFIT fitting
Maximum order for ARMAFIT fitting
Maximum error for ARMAFIT use.
Maximum number of iterations for ARMAFIT use.
Key to enable (0) or disable (1) the plot in HP-GL format
Key to enable (0) or disable (1) the plot in CGM format
Key to enable (0 or -1), or disable (1) the plot in PostScript format .-1 is for portrait, 0 for landscape
Key to enable (0) or disable (1) the plot in GNUPLOT format
Key to enable (0) or disable (1) the plot in screen
Key to enable (0) or disable (1) the plot the grid
Key to enable (0) or disable (1) the line dashes
Key to enable (0) or disable (1) the symbol marks
Key to enable (0) or disable (1) the colors
Number of Fourier components
Shading of barcharts (Fourier Analysis)
Shading of barcharts (Statistics DICE option)
Key to enable (0) or disable (1) log file generation
Key to enable (0) or disable (1) the cross in X-Y PLOT
Key to enable (0) or disable (1) the frame plot
Key to enable (0) or disable (1) the barchart for FS or HFS
Key to enable (0) or disable (1) the plot of transformer derating (ANSI 57.110)
Key to enable (0) or disable (1) the barchart in percent for FS and HFS cases.
Key to enable (0) or disable (1) the zero-axys
Key to enable (0) or disable (1) the bow around axis
Key to enable (0) or disable (1) the multiplot feature
Key to choice the pcx format resolution. 0 disables .pcx format output.
Key to choice the time unit. The values are the same as TIME UNITS command.
Key to enable (0) or disable (1) the deletion of graphic files at start time
Key to enable (0) or disable (1) the reverse screen
Key to enable (0) or disable (1) the plot in WMF format
Key to enable (0) or disable (1) the plot in JAVA format
Key to choose the x-axis variable: 0: interval, 1: P.U. 2: Physical units
Key to enable (0) or disable (1) the inclusion of date in plot
Key to enable (0) or disable (1) the inclusion of graphic (.pl4) filename in plot
Key to enable (0) or disable (1) the plot in PNG format
Key to enable (0) or disable (1) the plot in BMP format
Key to enable (0) or disable (1) title lines in RELAY output
Key to enable (1) or disable (0) the division by sqrt(2) of PHASOR values before plot
Key to save (0) or no save (1) the data of surface plots for other applications usage.
Key to read REAL*4 (0) or REAL*8 (1) pl4 files (CUSTOM PLOT FILE)
Key to COS inverse Fourier (0) or SIN inverse Fourier series (1)
Coordinates of upper-left corner of screen, in pixels. JX=-1 disables the screen size.
Width and height of screen, in pixels
Key to plot with symmetric Y axis (0), or natural Y axis (1)
Key to enable (0 or -1), or disable (1) the plot in PDF format.
Key to enable (0 or -1), or disable (1) the plot in PPM format -1 is for portrait, 0 for landscape
Key to enable (0) or disable (1) the plot in GIF format
Number of lines before on screen a <CR> is required to continue (peaks and zeroes commands)
HP-GL program viewer command
Text editor, as user preference
Font for all the plot

Note

3
4
5

9
111

Notes:
1. Proportion width to height for the plots (from 0.2 to 1.0)
2. All the components greater that this threshold value, relative to maximum component, will be added to HSOURCE list.
3. The number of components can be between 1 and 3000.
4. The shading can be between 0 (blank box) and 17. 16 is a black box. For multiple barcharts (HFS), this is the initial
shading pattern. -1 plots all the bars as filled boxes, -2, plots all the bars as empty boxes.
5. The shading can be between 0 (blank box) and 17. 16 is a black box.
6. If the fundamental component is zero, the plot is done in absolute values, not percent.
7. For NSTATI =1 or NSTATI=2, a probability plot will be obtained. If 10 is added to NSTATI, a stair plot will be obtained.
for probability.
8. C-like, PISA, gnu and Salford UNFORMATTED .pl4 files allowed.
9. The command must include the program call with the needed parameters. Both PRINTGLD (shareware) and HP2XX
(freeware) were tested.
10. A text editor is used to change permanently some parameters in gtpplot.ini file. It must be in the path.
11. The fonts can be DISALF, SIMPLX, COMPLX, DUPLX, TRIPLX, SERIF, HELVE. The fonts are not available for
GNUPLOT format. The default font is SIMPLX.

10

5. Samples
The following are samples of graphics obtained with GTPPLOT. All the figures are imported
from the .plt files and have SIMPLX font.
Sample of time functions.

11

Sample of DICE command.

Sample of FOURIER command.

Sample of BODE command.

12

13

Sample of HARMONIC FREQUENCY SCAN and derating plots.

Sample of X-Y PLOT command.

14

Sample of multiplot (SET NOWINDO=0)

Sample of normal and LOGY plots

15

Sample of impedance calculation

16

Sample of AGFPLOT
The following is an example from a single conductor aerial line.

17

Sample of functions

18

Sample of PARAM. It corresponds to three conductors into a pipe. The last figure is the
corresponding DIBCLP sample.

19

Sample of PHASOR command

Sample of TRV command.

20

21

Sample of PCVP command.

Sample of THD command

22

Sample of FILTER command

Data for a external program follows:


REAC-----+FREAC----+FREF-----+-FMIN----+FMAX-----+ANP------+BUS1--+BUS2--+
45.3989
60.00
0.00
0.00
1500.00
10000.00 FROM
TO
R--------+F0-------+Foo------+
5.0000
0.00
340.00
46.6591
430.00
490.00
29.3390
585.00
697.00
164.6515
730.00
781.00
80.8262
862.00
906.00
74.3589
987.00
1101.00
3.8218
1500.00
0.00
END

23

The filter as calculated by gtpplot follows:


C ------------------------------------------C #####
DIRECT SEQUENCE NETWORK
#####
C DATA FROM
hingofs.pl4
C VALUES IN mH- uF
C ------------------------------------------C BUS1 BUS2
RRRRRRRRRRRRRRRRLLLLLLLLLLLLLLLLCCCCCCCCCCCCCCCC
$VINTAGE, 1
$UNITS,
0.00000000,
0.00000000
FROM ATO
A
5.00000000
118.00487407
0.00000000
FROM BTO
B
5.00000000
118.00487407
0.00000000
FROM CTO
C
5.00000000
118.00487407
0.00000000
FROM ATO
A
46.65910000
506.61645951
0.27041081
FROM BTO
B
46.65910000
506.61645951
0.27041081
FROM CTO
C
46.65910000
506.61645951
0.27041081
FROM ATO
A
29.33900000
235.47103977
0.31433376
FROM BTO
B
29.33900000
235.47103977
0.31433376
FROM CTO
C
29.33900000
235.47103977
0.31433376
FROM ATO
A
164.65150000
1141.58267052
0.04163774
FROM BTO
B
164.65150000
1141.58267052
0.04163774
FROM CTO
C
164.65150000
1141.58267052
0.04163774
FROM ATO
A
80.82620000
542.62035353
0.06282459
FROM BTO
B
80.82620000
542.62035353
0.06282459
FROM CTO
C
80.82620000
542.62035353
0.06282459
FROM ATO
A
74.35890000
271.72630607
0.09569170
FROM BTO
B
74.35890000
271.72630607
0.09569170
FROM CTO
C
74.35890000
271.72630607
0.09569170
FROM ATO
A
3.82180000
27.95230273
0.40275427
FROM BTO
B
3.82180000
27.95230273
0.40275427
FROM CTO
C
3.82180000
27.95230273
0.40275427
C BUS1 BUS2
RRRRRRRRRRRRRRRRLLLLLLLLLLLLLLLLCCCCCCCCCCCCCCCC
$VINTAGE,-1
$UNITS,
-1.00000000,
-1.00000000

24

References
[1] GNU FORTRAN Info V 0.5.21., Free Software Foundation.
[2] DISLIN 8.0 , A Data Plotting Library, by Helmut Michels.
[3] TPPLOT Help file and output screens.
[4] gnuplot An Interactive Plotting Program, by Dick Crawford.
[5] Development of a Transmission-Line Model considering the Skin and Corona Effects for
Power Systems Transients Analysis, by Taku Noda.
[6] Electric Power Quality, by G. T. Heydt
[7] Post Processing Measured Transient Data using MODELS in the ATP-EMTP, by
Mustafa Kizilcay and Laurent Dub, EEUG News May 1997.
[8] Simulation of AC System Impedance in HVDC System Studies, by Narain G. Hingorani,
TPAS Vol. 89, May-June 1970, pp.820-828.

25

Appendix 1
The program is easily installed copying all the files in the same directory, included in the
PATH definition.
DOS version

Graphics modes.
The graphics modes for the GTPPLOT can be set as follows setting the environment variable
GRX20DRV
The following modes can be available by some video cards:
GRX20DRV=VESA gw 640 gh 480 nc 256
GRX20DRV=VESA gw 800 gh 600 nc 256
GRX20DRV=VESA gw 1024 gh 768 nc 256
With the DOS command set, the variable GRX20DRV can be set to the adequate value.

Memory manager.
The CWSDPMI.EXE program is the memory manager. Must be in the path. The program
runs automatically when runs GTPPLOT.
WINDOWS 95-98-NT and Linux versions
This versions require only to copy the package to a directory included in the path. For
Linux, /usr/local/bin is a good location.
For Windows NT, the environmental variable GTPPLOT must be set equal to the directory
where gtpplot is installed.

Appendix 2
A sample of fonts follows.
For COMPLX font all the lower accented Spanish vowels and tilded N () are allowed in
titles. German special characters are allowed in all fonts.

26

Appendix 3
Shading patterns for histograms.

Appendix 4
Fourier and interference determination.
The Fourier option calculates the Fourier decomposition of a cycle of the selected wave. The
GTPPLOT, as TPPLOT, determines the RMS (root mean square), and THD (Total Harmonic
Distortion). These are calculated as
N

RMS = I 02 + 21

h= N

I
h=1

THD =

2
hpeak

I
h=2

2
h

I1

The GTPPLOT determines another quality factors, as the even and odd, the total, balanced
and residual THD, and TIF (Telephone Influence Factor), the total, balanced and residual
C message index and IT product, and the K factor (Transformer derating).
The Telephone Influence Factor
h= N

TIF =

V
h =1

Wh2

Vtotal

where
Vh = the node voltage at the harmonic h
Vtotal = V12 + V22 + V32 + VN2

and the weighting factor Wh is

Wh = pfCh = 5fCh
Ch is the C message weighting factor as defined by the International Commission of
Telecommunications (CCIT), it expresses the relative psophometric annoyance level at
various frequencies. The factor pf was added to simulate coupling with an adjacent
27

telephone line. p=5 has traditionally been used and is standardized by IEER Std. 519 for
power system applications.
The C message index
The C message index is calculated by
h= N

V
h =1

C message index =

Ch2

Vtotal

The factor Wh or generally Wf is also called the Single Frequency TIF and is listed in the
table below on a 60 Hz base. For 50 Hz systems one would interpolate.
Freq

Wh

Freq

Wh

Freq

Wh

Freq

Wh

60

0.5

1020

17

5100

1860

31

7820

3000

50

9670

180

30

1080

18

5400

1980

33

8330

3180

53

8740

300

225

1140

19

5630

2100

35

8830

3300

55

8090

360

400

1260

21

6050

2160

36

9080

3540

59

6730

420

650

1380

23

6370

2220

37

9330

3660

61

6130

540

1320

1440

24

6560

2340

39

9840

3900

65

4400

660

11

2260

1500

25

6680

2460

41

10340

4020

67

3700

720

12

2760

1620

27

6970

2580

43

10600

4260

71

2750

780

13

3360

1740

29

7320

2820

47

10210

4380

73

2190

900

15

4350

1800

30

7570

2940

49

9820

5000

83.33

840

1000

16.66

5000

The IT (and VT) Product


The IT Product (or VT) is characteristic of the harmonic pollution caused by a customer s
harmonic generation. The IT Product is calculated the same way as the TIF but there is
no division by the total RMS current.

I T =

h= N

( I
h =1

Wh )

V T =

h= N

(V
h=1

28

Wh )

The K factor (Transformer derating) ANSI 57.110


The K factor is calculated as
h= N

K=

h
h =1
h= N

I
h =1

I h2
2
h

With this factor, the transformer derating can be calculated by


h= N

I
h=1

2
h

1 + Pec r
1 + K Pec r

where Pec-r is the rated eddy load factor in per unit. The generated graphics files of derating
as function of Pec-r are serialized as derate01.ext, derate02.ext..., with ext= plt for HP-GL
format, cgm for CGM format, wmf for Windows Metafile, png for PNG, jav for JAVA, eps for
Postscript format, pcx for PCX format, and gnu for GNUPLOT format.
The Distortion Index (German National Standard DIN 40110)
This index is calculated by

1 + THD 2
DIN =
THD 2
Peak Value
The peak value is the maximum of the values for the whole period. The program finds both
extremes, positive and negative.
Average Value
The average value is the arithmetic mean of the absolute values for the whole period. The
program calculates this mean as
i =n

Vavg = Vi / n
i =1

Crest Factor
The crest factor is

Crest Factor =

29

V peak
Vrms

Form Factor
The Form Factor is

Form Factor =

Vrms
Vavg

Capacitor overload factor (IEC 1000- 2- 2 Part 2, Electromagnetic Compatibility (EMC))


This factor is calculated as Dw

Dw2 =

h= N

h
h=2

uh2 ,

uh = U h / U 1

and Dw = Dw2

In the above formula IEC recommends that N up to 40 be used. The ANSI and Canadian
standards limit the total harmonic load to 1.35 per unit rating.
In all the equations:
i= index for time function values
n= number of points in a cycle
h= index of frequency values
N= number of frequency values

The results for a sample case are:


HARMONIC CONTENTS IN %
VARIABLE->
HARM. BSA
ORDER BSMA
0.3
0.00
0.5
12.20
0.8
12.05
1.0 100.00
5.0
5.99
7.0
3.04
11.0
0.31
13.0
1.50
17.0
0.25
19.0
0.28
THD->
18.49
Derived from table:
1) RMS
Fundamental =
3.6373E+02
Subharmonics
Harmonics =
2.5108E+01
Interharmonics
Distortion =
6.7237E+01
Total
2) THD
Even =
0.0000E+00 %
Odd
Balanced =
6.9030E+00 %
Residual
Subharmonics =
1.7148E+01 %
Harmonics
Interharmonics =
0.0000E+00 %
Total
3) K factor (for transformer derating, ANSI 57.110)
4) Total TIF IEEE Std. 519
5) Balanced TIF IEEE Std. 519
6) Residual TIF IEEE Std. 519
7) Total C message index
8) Balanced C message index
9) Residual C message index
10) Total I.T or V.T product IEEE Std. 519
11) Balanced I.T or V.T product IEEE Std. 519

30

=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=

6.2373E+01
0.0000E+00
3.6989E+02
6.9030E+00
0.0000E+00
6.9030E+00
1.8485E+01
1.1400E+00
3.8861E+01
3.8861E+01
4.4673E-02
7.1500E-01
7.1500E-01
3.5086E-03
1.4374E+04
1.4374E+04

%
%
%
%

12)
13)
14)
15)
16)
17)
18)

Residual I.T or V.T product IEEE Std. 519


Distortion index DIN=THD/SQRT(1+THD**2)
Mean value
Vmean
Peak value
Vpeak+ =
6.5049E+02
Crest factor max Vpeak/Vrms
Capacitor overload factor IEC 1000-2-2-Part 2
Form factor RMS/Vmean

=
=
=
Vpeak- =
=
=
=

1.6524E+01
1.8178E+01 %
3.3405E+02
-5.7511E+02
1.7586E+00
4.2304E-01
1.1073E+00

The balanced PQI refers to positive and negative sequence components, (not triplen
harmonics) for three-phase systems, and residual refers to homopolar sequence components
(triplen harmonics).
Even or odd refers to only even or only odd components added to the corresponding THD.
Some Standards allow different magnitudes for even or odd harmonics.
More information over definitions and applications of this Power Quality Indices as
calculated by GTPPLOT can be found in the book Electric Power Quality, by Prof. G. T.
Heydt, Stars in a Circle Publications, 9637 N. 117 Street-Tradewinds- Scottsdale, AZ 85259
USA.
With Dr. Heydts permission, the following table is included

31

Selected Guidelines, Recommended Practices, and Standard Limits of THD, TIF, VT, and
IT Product
Application
Dedicated static
converters
Distribution
systems
Distribution
systems

Subtransmission
systems
Subtransmission
systems
Synchronous
machines
Synchronous
generators
Cylindrical rotor
synchronous
machines

Distribution
transformers

Type of limit (source)

Applicable
equipment ratings
Recommended practice 2.4-69 kV
(IEEE Std. 519-1992)
above 69 kV
Recommended practice 2.4-69 kV
(IEEE Std. 519-1992)
above 69 kV
Standard (ANSI Std. Unlikely telephone
368)
interference
Possible telephone
interference
Probable telephone
interference
Typical values
60-69 kV
19-44 kV
Typical
maximum
values
60-69 kV
60-69 kV
Standard
5-19.999 MVA
(ANSI Std. C50.12-1982)
20 MVA and above
Standard
Properly
(ANSI Std. 368)
designed
generators
Standard
(ANSI Std. C50.13-1977) 62.5-299 kVA
300-699
700-999
1000-4999
5000-19999
20000-99999
100000 & above
Distribution engineering
110 V
guideline

32

Limit

Electric quantity

THD 8%
THD 1.5%
THD 5%
THD 1.5 %
IT 10000

Bus voltage

10000 IT 25000

Bus voltage

Line current

IT>25000
Balanced Residual
IT=1400 60<IT<800
VT=700 15<VT<30
Balanced
Residual
KIT=6
0.1<KIT<1
KVT=3500 50<KVT<400
Balanced
Residual
TIF<100
TIF<75
TIF<70
TIF<50
5<TIF<10

Line current
Bus voltage
Line current
Bus voltage
Load
(source)
current
Generator
current

Balanced
Residual
TIF<350
TIF<250
TIF<150
TIF<150
TIF<100
Line current
TIF<100
TIF<75
TIF<70
TIF<50
TIF<40
TIF<30
IT<66 for each kVA rating Line current
of unit

Family of Fourier series


GTPPLOT can calculate and plot a family of Fourier series. This option is available by setting
time0 to a negative value. This type of plot can be useful to study resonance phenomena. If
FREQF is negative, only this harmonic will be plotted as time function.
An example of ferroresonance follows, where the amplitude for some frequencies rise with
time

33

34

Appendix 5
SHAFT.
GTPPLOT can estimate fatigue from the torque output and shaft data.
The method is described in [8].
The authors of this paper developed an auxiliary program (named PERVIDSM) to estimate
the fatigue, reading the torques from the .lis file (the ATP output) of each case. The program
was compiled with constant parameters, corresponding to the machine studied, and was
verified with a commercial program of a European consulting firm.
GTPPLOT reads the torque values from a ATP case, and shaft data from an auxiliary file (one
for each shaft section)
The shaft section data may be in Metric or British units.
As sample, the following are the data for the first section of the machine studied in the
paper:
In metric units
HP-IP
METRIC
706.376221
0.325
0.130
2.40
1.11
1.27

SECTION section's name


SU
DEXT
DINT
K
CS
AKT

static strength (MPa)


external diameter (m)
internal diameter (m)
stress concentration factor
roughness factor
size factor

or in British units
HP-IP
ENGLISH
102.41
12.7952756
5.11811024
2.40
1.11
1.27

SECTION section's name


SU
DEXT
DINT
K
CS
AKT

static strength (kpsi)


external diameter (inches)
internal diameter (inches)
stress concentration factor
roughness factor
size factor

Only the first 14 characters are significative for each line.


The routine SHAFT used in GTPPLOT is a conversion of the program PERVIDSM, as donated
by its author.

References:
[9] J. A. Nizovoy, J. L. Alonso, A. C. Alvarez and L. M. Bouyssede, 'SSR Studies in Argentina
for the Bahia Blanca Generating Plant', IPST 97- International Power System Transients
Conference, Seattle, USA, June 23-27, 1997.
35

[10] H. E. Locay, D. G. Ramey and W. R. Brose, 'TURBINE-GENERATOR SHAFT LOSS-OFLIFE CONCEPTS FOR POWER SYSTEM DISTURBANCES', Fortieth Annual American Power
Conference, Chicago, Illinois, April 24-26 1978. Westinghouse Electric Corporation.
[11] A. C. Alvarez, J. A. Nizovoy and L. A. Almassio, 'FATIGA POR OSCILACIONES
TORSIONALES EN UNIDADES TURBOGENERADORAS', (in Spanish), Seminario Universidad
Nacional de Baha Blanca, Argentina. Baha Blanca, Dec. 1984.

Sample of SHAFT
Output of GTPPLOT for a case: (only the significative parts)
........
Section
HP-IP
Static admissible stress
706.376221 MPa =
External diameter
0.325000 m
=
Internal diameter
0.130000 m
=
Theoretical concentration stress factor
Roughness factor
Size factor
Total reduction factor for fatigue

102.410004 kpsi
12.795276 inches
5.118110 inches
2.400000
1.110000
1.270000
3.383280

Number of relative extremes


: 207
Cycles identified by rainflow : 87
Cycles without fatigue
: 87
Shaft loss of life
: 0.000000E+00 %
............
Section
IP-LP
Static admissible stress
706.376221 MPa =
102.410004 kpsi
External diameter
0.435000 m
=
17.125984 inches
Internal diameter
0.108000 m
=
4.251969 inches
Theoretical concentration stress factor
1.900000
Roughness factor
1.110000
Size factor
1.300000
Total reduction factor for fatigue
2.741700
Number of relative extremes
: 205
Cycles identified by rainflow : 86
Cycles without fatigue
: 79
Shaft loss of life
: 0.111117E-02 %
...........
Section
LP-GE
Static admissible stress
804.458862 MPa =
116.629967 kpsi
External diameter
0.435000 m
=
17.125984 inches
Internal diameter
0.108000 m
=
4.251969 inches
Theoretical concentration stress factor
1.850000
Roughness factor
1.110000
Size factor
1.300000
Total reduction factor for fatigue
2.669550

Number of relative extremes


: 208
Cycles identified by rainflow : 84
Cycles without fatigue
: 48
Shaft loss of life
: 0.151156E-01 %
...........
Section
GE-EX
Static admissible stress
804.458862 MPa =

36

116.629967 kpsi

External diameter
0.190000 m
Internal diameter
0.122000 m
Theoretical concentration stress factor
Roughness factor
Size factor
Total reduction factor for fatigue
Number of relative extremes
Cycles identified by rainflow
Cycles without fatigue
Shaft loss of life

=
=

: 233
: 101
: 101
: 0.000000E+00 %

37

7.480315 inches
4.803150 inches
1.400000
1.110000
1.210000
1.880340

You might also like