GTPPLOT
GTPPLOT
1. Introduction.
GTPPLOT is a plotting program for ATP output, compiled with the GNU FORTRAN 95
(g95), and makes use of the graphical package DISLIN. The program is available for
Windows 32 and Linux. It has the following 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 within the limit of available memory up to near 2
GB, no specific limits to number of variables or number of ponts. 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.
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. The
1
Mingw32 and Linux versions use the right button mouse or <ENTER> key or <ESCAPE> key
to escape from graphic mode. The pointer must be in the plot.
Output Formats:
The program can generate graphics files in different formats: HP-GL (Hewlett-Packard
Graphic Language), CGM (Computer Graphics Metafile), WMF (Windows Meta File), PNG
(Portable Network Graphics), JAVA, PCX, PostScript, PPM (Portable PixMap), PDF, BMP
(Windows Bit Map), MATLAB, MATHCAD, MATHEMATICA, GNUPLOT and CSV
(Comma Separated Values). 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 by the operative system.
Available Commands:
4
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>.
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.
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 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.
5
The MATHCAD command allows generate data in MATHCAD CSV format. The
MATHCAD 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 Voltage-
Current 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, file.002... if the number of files is up to
999, file.0001, file.0002... if there are more than 999 files), 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 9999 files
can be processed.
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
6
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.
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.
The SAVE command allows generate data in PISA ATP format. The name of file is requested
to the user, or save.pl4 is used by default.
If the user send # command to choose variables, only the variables selected will be in the .pl4
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 .pl4 file.
The TYPE-1 command allows generate data in ATP TYPE-1 sources format. The name of
file is requested to the user, or type1.pch is used by default.
If the user send # command to choose variables, only the variables selected will be in the .pch
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 .pch file.
The CSV command allows generate data in CSV format. The name of file is requested to the
user, or csv.csv is used by default.
If the user send # command to choose variables, only the variables selected will be in the .csv
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 .csv file.
7
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:
8
PARAMETER Description Note
FPOWER Frequency for time scales and RMS calculation
FREQFR Frequency for Fourier Analysis
PROP Proportion for the plot 1
TBEFORE Waiting time (in seconds) before screen plot (batch mode only)
TAFTER Waiting time (in seconds) after screen plot (batch mode only)
CSIZE Character size multiplier (0.5CSIZE1.0)
SSIZE Symbol size multiplier (0.5SSIZE1.0)
THRES Threshold value for harmonic source inclusion. 2
SKIZIL Key to produce 'S' ARMAFIT files (1.0) or 'Z' (0.0)
Y0 Admittance for zero frequency. 9999. for use the admittance for minimum frequency.
YINF Admittance for infinite frequency. 9999. for use the admittance of maximum frequency.
ORDMIN Minimum order for ARMAFIT fitting
ORDMAX Maximum order for ARMAFIT fitting
ERROR Maximum error for ARMAFIT use.
WITER Maximum number of iterations for ARMAFIT use.
NOHPGL Key to enable (0) or disable (1) the plot in HP-GL format
NOCGM Key to enable (0) or disable (1) the plot in CGM format
NOPOST Key to enable (0 or -1), or disable (1) the plot in PostScript format .-1 is for portrait, 0 for landscape
NOGNU Key to enable (0) or disable (1) the plot in GNUPLOT format
NOSCREEN Key to enable (0) or disable (1) the plot in screen
NOGRID Key to enable (0) or disable (1) the plot the grid
NODASH Key to enable (0) or disable (1) the line dashes
NOSYMBOL Key to enable (0) or disable (1) the symbol marks
NOCOLOR Key to enable (0) or disable (1) the colors
NFORSP Number of Fourier components 3
NSHADF Shading of barcharts (Fourier Analysis) 4
NSHADS Shading of barcharts (Statistics DICE option) 5
NOLOG Key to enable (0) or disable (1) log file generation
NOCROSS Key to enable (0) or disable (1) the cross in X-Y PLOT
NOFRAME Key to enable (0) or disable (1) the frame plot
NOBARS Key to enable (0) or disable (1) the barchart for FS or HFS
NODERATE Key to enable (0) or disable (1) the plot of transformer derating (ANSI 57.110)
NOPERC Key to enable (0) or disable (1) the barchart in percent for FS and HFS cases. 6
NOZERO Key to enable (0) or disable (1) the zero-axys
NOBOX Key to enable (0) or disable (1) the bow around axis
NOWINDO Key to enable (0) or disable (1) the multiplot feature
NRPCX Key to choice the pcx format resolution. 0 disables .pcx format output.
NTIME Key to choice the time unit. The values are the same as TIME UNITS command.
NOCLEAN Key to enable (0) or disable (1) the deletion of graphic files at start time
NOREV Key to enable (0) or disable (1) the reverse screen
NOWMF Key to enable (0) or disable (1) the plot in WMF format
NOJAVA Key to enable (0) or disable (1) the plot in JAVA format
NSTATI Key to choose the x-axis variable: 0: interval, 1: P.U. 2: Physical units 7
NODATE Key to enable (0) or disable (1) the inclusion of date in plot
NOFILE Key to enable (0) or disable (1) the inclusion of graphic (.pl4) filename in plot
NOPNG Key to enable (0) or disable (1) the plot in PNG format
NOBMP Key to enable (0) or disable (1) the plot in BMP format
NOTIT Key to enable (0) or disable (1) title lines in RELAY output
KPHASOR Key to enable (1) or disable (0) the division by sqrt(2) of PHASOR values before plot
NOSAVE Key to save (0) or no save (1) the data of surface plots for other applications usage.
L4FULL Key to read REAL*4 (0) or REAL*8 (1) pl4 files (CUSTOM PLOT FILE) 8
IFOUR Key to COS inverse Fourier (0) or SIN inverse Fourier series (1)
JX, JY Coordinates of upper-left corner of screen, in pixels. JX=-1 disables the screen size.
NX, NY Width and height of screen, in pixels
NOSYMM Key to plot with symmetric Y axis (0), or natural Y axis (1)
NOPDF Key to enable (0 or -1), or disable (1) the plot in PDF format.
NOPPM Key to enable (0 or -1), or disable (1) the plot in PPM format -1 is for portrait, 0 for landscape
NOGIF Key to enable (0) or disable (1) the plot in GIF format
NRM Number of lines before on screen a <CR> is required to continue (peaks and zeroes commands)
NOTRV Key to enable (0) or disable (1) text files of TRV and envelopes, -1 for no synchronized graphics
NOCHOICE Key to enable (0) or disable (1) an automatic CHOICE command at start time
NOCSV Key to enable (0) or disable (1) the generation of CSV files
NCSV Width of CSV column files
PRINT HP-GL program viewer command 9
EDITOR Text editor, as user preference 1-
FONT Font for all the plot. An extension .ttf indicates that a TrueType Font will be used 11
9
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. If the FONT has an extension .ttf, a TrueType Font will be used. The .ttf
will be searched in the working directory or FONTS directory of Windows (normally c:\Windows\FONTS). For Linux, the
directory /usr/X11R6/lib/X11/fonts/truetype/ will be searched.
10
5. Samples
The following are samples of graphics obtained with GTPPLOT. All the figures are imported
from the .wmf files and have COMPLX font.
11
Sample of DICE command.
12
Sample of BODE command.
13
Sample of HARMONIC FREQUENCY SCAN and derating plots.
14
Sample of multiplot (SET NOWINDO=0)
15
Sample of impedance calculation
16
Sample of AGFPLOT
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
20
Sample of PHASOR command
21
Sample of TRV command.
22
Sample of PCVP command.
23
Sample of FILTER command
24
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
25
Sample of Sequence plots
26
References
27
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
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.
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
For COMPLX font all the lower accented Spanish vowels and tilded N () are allowed in
titles. German special characters are allowed in all fonts.
28
Appendix 3
Appendix 4
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
h N I
h 2
2
h
RMS I 02 21 I
h1
2
hpeak THD
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).
h N
V h Wh2
h 1
TIF
Vtotal
where
Vh = the node voltage at the harmonic h
Wh = pfCh = 5fCh
h N
V h Ch2
h1
C message index =
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.
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.
h N h N
2 2
I T I
h1
h Wh V T V
h1
h Wh
30
The K factor (Transformer derating) ANSI 57.110
h N
1 Pec r
I
h1
2
h
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.
1 THD 2
DIN
THD2
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
in
Vavg Vi / n
i 1
Crest Factor
31
V peak
Crest Factor
Vrms
Form Factor
h N
Dw2 h
h 2
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.
32
3) K factor (for transformer derating, ANSI 57.110) = 1.1400E+00
4) Total TIF IEEE Std. 519 = 3.8861E+01
5) Balanced TIF IEEE Std. 519 = 3.8861E+01
6) Residual TIF IEEE Std. 519 = 4.4673E-02
7) Total C message index = 7.1500E-01
8) Balanced C message index = 7.1500E-01
9) Residual C message index = 3.5086E-03
10) Total I.T or V.T product IEEE Std. 519 = 1.4374E+04
11) Balanced I.T or V.T product IEEE Std. 519 = 1.4374E+04
12) Residual I.T or V.T product IEEE Std. 519 = 1.6524E+01
13) Distortion index DIN=THD/SQRT(1+THD**2) = 1.8178E+01 %
14) Mean value Vmean = 3.3405E+02
15) Peak value Vpeak+ = 6.5049E+02 Vpeak- = -5.7511E+02
16) Crest factor max Vpeak/Vrms = 1.7586E+00
17) Capacitor overload factor IEC 1000-2-2-Part 2 = 4.2304E-01
18) Form factor RMS/Vmean = 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.
33
Selected Guidelines, Recommended Practices, and Standard Limits of THD, TIF, VT,
and IT Product
34
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
35
Appendix 5
SHAFT.
GTPPLOT can estimate fatigue from the torque output and shaft data.
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)
As sample, the following are the data for the first section of the machine studied in the paper:
In metric units
36
HP-IP SECTION section's name
METRIC
706.376221 SU static strength (MPa)
0.325 DEXT external diameter (m)
0.130 DINT internal diameter (m)
2.40 K stress concentration factor
1.11 CS roughness factor
1.27 AKT size factor
or in British units
HP-IP SECTION section's name
ENGLISH
102.41 SU static strength (kpsi)
12.7952756 DEXT external diameter (inches)
5.11811024 DINT internal diameter (inches)
2.40 K stress concentration factor
1.11 CS roughness factor
1.27 AKT size factor
References:
Sample of SHAFT
37
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
38