[net.sources] GNUPLOT 1.1: part 1 of 6

williams@vu-vlsi.UUCP (01/28/87)

                              G N U P L O T
                     an interactive plotting program

This is the source code to GNUPLOT 1.1.  This supersedes version 1.0,
which was posted a few months ago.  See the README below for more
information and release notes. 

Many thanks to those who have sent us their bug reports, additions, and
ideas!  Please continue to send any questions, comments to complaints to
vu-vlsi!plot. 

--------------------------------CUT HERE---------------------------------
#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
#	README
#	gnuplot.1
#	Makefile
#	plot.h
#	simple.demo
#	1.dat
#	2.dat
#	3.dat
#	controls.demo
# This archive created: Wed Jan 28 12:04:25 1987
export PATH; PATH=/bin:$PATH
echo shar: extracting "'README'" '(4947 characters)'
if test -f 'README'
then
	echo shar: will not over-write existing file "'README'"
else
cat << \SHAR_EOF > 'README'
The GNUPLOT source code and executables may be copied and/or modified freely
as long as the copyright messages are left intact.

GNUPLOT has been tested on a Pyramid 90x (ucb 4.2 and att V), a VAX 8200
(VMS 4.3), IBM PC's and AT's (MS-DOS 3.1, Microsoft C 4.0).  The code is
written with portability in mind, and it passes lint!  If you have
problems, send mail to vu-vlsi!plot.  And please send any modifications
you make so they can be #ifdef'd into later releases. 


                      GNUPLOT 1.1 RELEASE NOTES

New terminal drivers:  AED 512, BBN BitGraph, HP2623, POSTSCRIPT, Selanar,
Vectrix 384.  The PC version now supports Hercules and ATT 6300 monochrome
graphics.  Thanks to those who sent these drivers in.

New commands:  'set dummy' and 'show dummy' to select the dummy variable
name; 'replot' to repeat the last 'plot' command.

The exclamation point (!) is now accepted as postfix factorial operator.
The gamma() function is also included, if your C library has gamma().  See
GAMMA below.

Logical AND (&&) and OR (||) now short-circuit the way they do in C.  That
is, the second && operand is not evaluated if the first is false; the
second || operand is not evaluated if the first is true.  The ternary operator
(?:) also does not evaluate the unused operand.  This change allows for the
definition of recursive functions, e.g. a synonym for the ! factorial operator:

	fact(x) = (x<=1) ? 1 : x*fact(x-1)

GNUPLOT now has a much better memory allocation scheme, replacing
most fixed-size arrays with malloc()'d linked lists.  There is no longer
any artificial maximum on the number of simultaneous plots, number of
points in those plots, or the number of user-defined functions or
variables.  All these are limited only by the memory available to
malloc().  This is a big improvement for memory-starved machines like
PDP-11s or PCs.

Lines beginning with # (also ! in VMS) are treated as comments.  Only the
$ may now be used for a shell escape in VMS, since ! is a comment.

The PC version now has the 'help' command, thanks to code posted by
Robert Scott.

Several old bugs have been superseded by new ones.


                       PREPROCESSOR #DEFINES

These #defines should be checked before compilation:

VFORK       Makefile        define if you've got vfork() system call
GAMMA       Makefile        define if you've got gamma(3)
BCOPY       Makefile        define if your memcpy() is called bcopy()
NOCOPY      Makefile        define if you've don't have a memcpy() by any name
bcopy()     plot.h          define if you've got a memcpy() by some OTHER name
                              (see example in plot.h)
vms         Makefile        define if compiling under VMS;
                              automatically defined by DEC C
PC          Makefile        define if compiling on a PClone
MSDOS       Makefile        define if compiling under MSDOS;
                              automatically defined by Microsoft C 4.0
AED         Makefile        define these if you want this terminal driver
                              included
BITGRAPH       .            (TEK must also be defined)
HP26           .
HP75           .
POSTSCRIPT     .
QMS            .
REGIS          .
SELANAR        .            (TEK must also be defined)
TEK            .
UNIXPLOT       .
V384           .

HERCULES       .            same, but only if PC is defined
ATT            .
CORONA         .

HUGE        plot.h          define to be largest double if not defined
                              in <math.h>
GNUTERM     plot.h          default terminal type if GNUTERM environment
							  variable not found at run-time
HELP        plot.h          default command spawned by 'help' command
                              if GNUHELP environment variable not found
                              at run-time
SHELL       plot.h          default shell to spawn if SHELL environment
                              variable not found at run-time


                             TO COMPILE

under UNIX:  type 'make'

under VMS:  type '@compile', then '@link'.  Use the 'vmshelp.csh' script
(in the docs subdirectory) to convert the help files.  If you don't have
access to a Unix machine, send us mail and we'll send you the VMS GNUPLOT.HLB.

under MSDOS:  use 'make make.msc' for Microsoft C 4.0.  If you've got
another compiler, you're on your own!  For MSDOS help, use the 'vmshelp.csh'
script to create the file 'gnuplot.hlp', then download this to your PC.  Run
'BUILDHLP . < GNUPLOT.HLP' to create the help tree.


                         ENVIRONMENT VARIABLES

If the environment variable GNUTERM is found, it is used as the terminal
type.

If the environment variable GNUHELP exists, it is used as the command to
spawn for help.

The PC version looks for then environment variable GNUPLOT to contain
the name of the directory from which to load the initialization file
GNUPLOT.INI.  See the help on 'start_up' for more information.
SHAR_EOF
if test 4947 -ne "`wc -c < 'README'`"
then
	echo shar: error transmitting "'README'" '(should have been 4947 characters)'
fi
fi # end of overwriting check
echo shar: extracting "'gnuplot.1'" '(1896 characters)'
if test -f 'gnuplot.1'
then
	echo shar: will not over-write existing file "'gnuplot.1'"
else
cat << \SHAR_EOF > 'gnuplot.1'
.\" dummy line
.TH GNUPLOT 1 "28 January 1987"
.UC 4
.SH NAME
gnuplot \- an interactive plotting program
.SH SYNOPSIS
.B gnuplot
.br
.SH DESCRIPTION
.I Gnuplot 
is a command-driven interactive function plotting program.
Here are some of its features:
.PP
Plots any number of functions, built up of C operators, C library
functions, and some things C doesn't have like **, sgn(), etc.  Also
support for plotting data files, to compare actual
data to theoretical curves.
.PP
User-defined X and Y ranges (optional Y auto-ranging), smart Y scaling,
smart tic marks.
.PP
User-defined constants and functions.
.PP
Support through a generalized graphics driver for
AED 767,
BBN BitGraph,
HP2623,
HP75xx,
POSTSCRIPT,
QMS QUIC
ReGis (VT125 and VT2xx),
Selanar,
Tek 401x,
Vectrix 384,
and unixplot.  The PC version
supports IBM CGA & EGA, Hercules, ATT 6300,
and Corona 325 graphics.  Other devices can be added
simply, but will require recompiling.
.PP
Shell escapes and command line substitution.
.PP
Load and save capability.
.PP
Output redirection.
.PP
All computations performed in the complex domain.  Just the real part is
plotted by default, but functions like imag() and abs() and arg() are
available to override this.
.SH AUTHORS
Thomas Williams and Colin Kelley, Villanova University.
.br
(vu-vlsi!plot.UUCP)
.SH BUGS
The unixplot library does not provide for sending unixplot output to
a file.  As a result, unixplot output cannot be sent to a file with the
.I Gnuplot
\&'set output' command; instead, standard output must be redirected
to this file from the Unix command line.  For example:
.IP
\ \ \ \ \ \ \ 
.I % gnuplot > unixplot.out
.br
\ \ \ \ \ \ \ \ gnuplot>
.I set term unxiplot
.br
\ \ \ \ \ \ \ \ gnuplot>
.I plot sin(x)
.PP
The atan() function does not work correctly for complex arguments.
.SH SEE ALSO
See the printed manual or the on-line help for details on specific commands.
SHAR_EOF
if test 1896 -ne "`wc -c < 'gnuplot.1'`"
then
	echo shar: error transmitting "'gnuplot.1'" '(should have been 1896 characters)'
fi
fi # end of overwriting check
echo shar: extracting "'Makefile'" '(2557 characters)'
if test -f 'Makefile'
then
	echo shar: will not over-write existing file "'Makefile'"
else
cat << \SHAR_EOF > 'Makefile'
# where to install executable on 'make install'
DEST=/usr/local/bin/gnuplot
# where to install man page on 'make man_install'
MANDEST=/usr/man/manl/gnuplot.l

# -DFORK if you have vfork()
# -DBCOPY if your memcpy() is called bcopy() (a Berkeleyism, right?)
# -DNOCOPY if you don't have a memcpy() by any name
# -DGAMMA if you've got gamma(3)
# -O if you trust your compiler's optimizer
CFLAGS = -DVFORK -DBCOPY -DGAMMA #-gx #-O

# -D<terminal> in TERMFLAGS iff you wish to support <terminal>
# -DAED         AED 512 and AED 767
# -DBITGRAPH    BBN BitGraph
# -DHP26        HP2623A and maybe others
# -DHP75        HP7580, and probably other HPs
# -DPOSTSCRIPT  Postscript
# -DQMS         QMS/QUIC laserprinter (Talaris 1200 and others)
# -DREGIS       ReGis graphics (vt125, vt220, vt240, Gigis...)
# -DSELANAR     Selanar
# -DTEK         Tektronix 4010, and probably others
# -DUNIXPLOT    unixplot
# -DV384        Vectrix 384 and tandy color printer

TERMFLAGS = -DAED -DBITGRAPH -DHP26 -DHP75 -DPOSTSCRIPT -DQMS -DREGIS -DSELANAR -DTEK -DUNIXPLOT -DV384


OBJS = 	command.o eval.o graphics.o internal.o misc.o parse.o plot.o scanner.o\
    standard.o term.o util.o

CSOURCE1 = command.c eval.c graphics.c internal.c misc.c parse.c
CSOURCE2 = plot.c scanner.c standard.c term.c util.c version.c
# not C code, but still needed
ETC = README gnuplot.1 Makefile plot.h simple.demo 1.dat 2.dat 3.dat \
	  controls.demo
# VMS and PC-specific files
VMSPC = compile.com link.com \
        buildhlp.c corgraph.asm corplot.c header.mac help.c help.hlm \
		hrcgraph.asm lineproc.mac link.opt make.msc pcgraph.asm

# -lplot if you have -DUNIXPLOT
LIBS = -lm -lplot

gnuplot: $(OBJS) version.o
	cc $(CFLAGS) $(OBJS) version.o $(LIBS) -o gnuplot

install: gnuplot
	cp gnuplot $(DEST)
	strip $(DEST)

man_install: gnuplot.1
	cp gnuplot.1 $(MANDEST)

term.o: term.c 
	cc $(CFLAGS) $(TERMFLAGS) -c term.c

$(OBJS): plot.h

lint:
	lint -hx $(CSOURCE1) $(CSOURCE2)

vax:
	uucp -m $(CSOURCE1) $(CSOURCE2) plot.h excalibur!m1:\[esl.source.esl.gnuplot\]

shar: gnuplot.shar.1 gnuplot.shar.2 gnuplot.shar.3 gnuplot.shar.4 \
	  gnuplot.shar.5 gnuplot.shar.6

gnuplot.shar.1: $(ETC)
	shar -vc $(ETC) > gnuplot.shar.1

gnuplot.shar.2: $(CSOURCE1)
	shar -vc $(CSOURCE1) > gnuplot.shar.2

gnuplot.shar.3: $(CSOURCE2)
	shar -vc $(CSOURCE2) > gnuplot.shar.3

gnuplot.shar.4: docs/*
	cd docs; make clean
	shar -vc docs > gnuplot.shar.4

gnuplot.shar.5: /usr/help/gnuplot/*
	(cd /usr; shar -vc help/gnuplot) > gnuplot.shar.5

gnuplot.shar.6: $(VMSPC)
	shar -vc $(VMSPC) > gnuplot.shar.6
SHAR_EOF
if test 2557 -ne "`wc -c < 'Makefile'`"
then
	echo shar: error transmitting "'Makefile'" '(should have been 2557 characters)'
fi
fi # end of overwriting check
echo shar: extracting "'plot.h'" '(5591 characters)'
if test -f 'plot.h'
then
	echo shar: will not over-write existing file "'plot.h'"
else
cat << \SHAR_EOF > 'plot.h'
/*
 *
 *    G N U P L O T  --  plot.h
 *
 *  Copyright (C) 1986, 1987  Thomas Williams, Colin Kelley
 *
 *  You may use this code as you wish if credit is given and this message
 *  is retained.
 *
 *  Please e-mail any useful additions to vu-vlsi!plot so they may be
 *  included in later releases.
 *
 *  This file should be edited with 4-column tabs!  (:set ts=4 sw=4 in vi)
 */

#define PROGRAM "G N U P L O T"
#define PROMPT "gnuplot> "
#define SHELL "/bin/sh"		/* used if SHELL env variable not set */

#ifdef vms
#define HELP  "gnuplot "
#else /* vms */
#define HELP  "/usr/local/bin/help gnuplot"
#endif /* vms */

#define SAMPLES 160			/* default number of samples for a plot */
#define ZERO	1e-8		/* default for 'zero' set option */

#ifdef PC
#define TERM "egalib"
#else /* PC */
#define TERM "regis"		/* put your most common term type here! */
#endif /* PC */

#define TRUE 1
#define FALSE 0

#define Pi 3.141592653589793

#define MAX_POINTS 1
#define MAX_LINE_LEN 255	/* maximum number of chars allowed on line */
#define MAX_TOKENS 200
#define MAX_ID_LEN 20		/* max length of an identifier */

#define MAX_AT_LEN 150		/* max number of entries in action table */
#define STACK_DEPTH 100
#define NO_CARET (-1)


#ifdef vms
#define OS "VMS "
#endif

#ifdef unix
#define OS "unix "
#endif

#ifdef MSDOS
#define OS "MS-DOS "
#endif

#ifndef OS
#define OS ""
#endif

/*
 * note about HUGE:  this number is just used as a flag for really
 *   big numbers, so it doesn't have to be the absolutely biggest number
 *   on the machine.
 *
 * define HUGE here if your compiler doesn't define it in <math.h>
 * example:
#define HUGE 1e38
 */

#define END_OF_COMMAND (c_token >= num_tokens || equals(c_token,";"))


#ifdef vms

#define is_comment(c) ((c) == '#' || (c) == '!')
#define is_system(c) ((c) == '$')

#else /* vms */

#define is_comment(c) ((c) == '#')
#define is_system(c) ((c) == '!')

#endif /* vms */

/*
 * If you're memcpy() has another name, define it below as bcopy() is.
 * If you don't have a memcpy():
#define NOCOPY
 */

#ifdef BCOPY
#define memcpy(dest,src,len) bcopy(src,dest,len)
#endif /* BCOPY */

#ifdef vms
#define memcpy(dest,src,len) lib$movc3(&len,src,dest)
#endif /* vms */

#define top_of_stack stack[s_p]

typedef int BOOLEAN;
typedef int (*FUNC_PTR)();

enum operators {
	PUSH, PUSHC, PUSHD, CALL, LNOT, BNOT, UMINUS, LOR, LAND, BOR, XOR,
	BAND, EQ, NE, GT, LT, GE, LE, PLUS, MINUS, MULT, DIV, MOD, POWER,
	FACTORIAL, BOOL, JUMP, JUMPZ, JUMPNZ, JTERN, SF_START
};

#define is_jump(operator) ((operator) >=(int)JUMP && (operator) <(int)SF_START)

enum DATA_TYPES {
	INT, CMPLX
};

enum PLOT_TYPE {
	FUNC, DATA
};

enum PLOT_STYLE {
	LINES, POINTS, IMPULSES
};

struct cmplx {
	double real, imag;
};

struct value {
	enum DATA_TYPES type;
	union {
		int int_val;
		struct cmplx cmplx_val;
	} v;
};

struct lexical_unit {	/* produced by scanner */
	BOOLEAN is_token;	/* true if token, false if a value */ 
	struct value l_val;
	int start_index;	/* index of first char in token */
	int length;			/* length of token in chars */
};

struct ft_entry {		/* standard/internal function table entry */
	char *f_name;		/* pointer to name of this function */
	FUNC_PTR func;		/* address of function to call */
};

struct udft_entry {				/* user-defined function table entry */
	struct udft_entry *next_udf; /* pointer to next udf in linked list */
	char udf_name[MAX_ID_LEN+1]; /* name of this function entry */
	struct at_type *at;			/* pointer to action table to execute */
	char *definition; 			/* definition of function as typed */
	struct value dummy_value;	/* current value of dummy variable */
};

struct udvt_entry {			/* user-defined value table entry */
	struct udvt_entry *next_udv; /* pointer to next value in linked list */
	char udv_name[MAX_ID_LEN+1]; /* name of this value entry */
	BOOLEAN udv_undef;		/* true if not defined yet */
	struct value udv_value;	/* value it has */
};

union argument {			/* p-code argument */
	int j_arg;				/* offset for jump */
	struct value v_arg;		/* constant value */
	struct udvt_entry *udv_arg;	/* pointer to dummy variable */
	struct udft_entry *udf_arg; /* pointer to udf to execute */
};

struct at_entry {			/* action table entry */
	enum operators index;	/* index of p-code function */
	union argument arg;
};

struct at_type {
	int a_count;				/* count of entries in .actions[] */
	struct at_entry actions[MAX_AT_LEN];
		/* will usually be less than MAX_AT_LEN is malloc()'d copy */
};

struct coordinate {
	BOOLEAN undefined;	/* TRUE if value off screen */
#ifdef PC
	float x, y;			/* memory is tight on PCs! */
#else
	double x, y;
#endif /* PC */
};

struct curve_points {
	struct curve_points *next_cp;	/* pointer to next plot in linked list */
	enum PLOT_TYPE plot_type;
	enum PLOT_STYLE plot_style;
	char *title;
	int p_count;					/* count of points in .points[] */
	struct coordinate points[MAX_POINTS];
		/* will usually be less in malloc()'d copy */
};

struct termentry {
	char *name;
	unsigned int xmax,ymax,v_char,h_char,v_tic,h_tic;
	FUNC_PTR init,reset,text,graphics,move,vector,linetype,lrput_text,
		ulput_text,point;
};

/*
 * SS$_NORMAL is "normal completion", STS$M_INHIB_MSG supresses
 * printing a status message.
 * SS$_ABORT is the general abort status code.
 from:	Martin Minow
	decvax!minow
 */
#ifdef	vms
#include		<ssdef.h>
#include		<stsdef.h>
#define	IO_SUCCESS	(SS$_NORMAL | STS$M_INHIB_MSG)
#define	IO_ERROR	SS$_ABORT
#endif /* vms */

#ifndef	IO_SUCCESS	/* DECUS or VMS C will have defined these already */
#define	IO_SUCCESS	0
#endif
#ifndef	IO_ERROR
#define	IO_ERROR	1
#endif
SHAR_EOF
if test 5591 -ne "`wc -c < 'plot.h'`"
then
	echo shar: error transmitting "'plot.h'" '(should have been 5591 characters)'
fi
fi # end of overwriting check
echo shar: extracting "'simple.demo'" '(554 characters)'
if test -f 'simple.demo'
then
	echo shar: will not over-write existing file "'simple.demo'"
else
cat << \SHAR_EOF > 'simple.demo'
#
# gnuplot> set term <term-type>
# gnuplot> load 'simple.demo'
#
set samples 50
plot [-10:10] sin(x),atan(x),cos(atan(x))
set samples 100 
plot [-pi/2:pi] cos(x),-(sin(x) > sin(x+1) ? sin(x) : sin(x+1))
set samples 200 
plot [-3:5] asin(x),acos(x)
plot [-30:20] besj0(x)*0.12e1 with impulses, (x**besj0(x))-2.5 with points
set samples 400
plot [-10:10] real(sin(x)**besj0(x))
plot [-5*pi:5*pi] [-5:5] real(tan(x)/atan(x)), 1/x
set autoscale
set samples 800
plot [-30:20] sin(x*20)*atan(x)
plot [-19:19] '1.dat'with impulses ,'2.dat' ,'3.dat' with lines
SHAR_EOF
if test 554 -ne "`wc -c < 'simple.demo'`"
then
	echo shar: error transmitting "'simple.demo'" '(should have been 554 characters)'
fi
fi # end of overwriting check
echo shar: extracting "'1.dat'" '(781 characters)'
if test -f '1.dat'
then
	echo shar: will not over-write existing file "'1.dat'"
else
cat << \SHAR_EOF > '1.dat'
-20.000000 -3.041676
-19.000000 -3.036427
-18.000000 -3.030596
-17.000000 -3.024081
-16.000000 -3.016755
-15.000000 -3.008456
-14.000000 -2.998978
-13.000000 -2.988049
-12.000000 -2.975310
-11.000000 -2.960273
-10.000000 -2.942255
-9.000000 -2.920278
-8.000000 -2.892883
-7.000000 -2.857799
-6.000000 -2.811295
-5.000000 -2.746802
-4.000000 -2.651635
-3.000000 -2.498092
-2.000000 -2.214297
-1.000000 -1.570796
0.000000 0.000000
1.000000 1.570796
2.000000 2.214297
3.000000 2.498092
4.000000 2.651635
5.000000 2.746802
6.000000 2.811295
7.000000 2.857799
8.000000 2.892883
9.000000 2.920278
10.000000 2.942255
11.000000 2.960273
12.000000 2.975310
13.000000 2.988049
14.000000 2.998978
15.000000 3.008456
16.000000 3.016755
17.000000 3.024081
18.000000 3.030596
19.000000 3.036427
SHAR_EOF
if test 781 -ne "`wc -c < '1.dat'`"
then
	echo shar: error transmitting "'1.dat'" '(should have been 781 characters)'
fi
fi # end of overwriting check
echo shar: extracting "'2.dat'" '(781 characters)'
if test -f '2.dat'
then
	echo shar: will not over-write existing file "'2.dat'"
else
cat << \SHAR_EOF > '2.dat'
-20.000000 -6.083352
-19.000000 -6.072853
-18.000000 -6.061191
-17.000000 -6.048162
-16.000000 -6.033510
-15.000000 -6.016913
-14.000000 -5.997955
-13.000000 -5.976098
-12.000000 -5.950620
-11.000000 -5.920546
-10.000000 -5.884511
-9.000000 -5.840556
-8.000000 -5.785765
-7.000000 -5.715597
-6.000000 -5.622591
-5.000000 -5.493603
-4.000000 -5.303271
-3.000000 -4.996183
-2.000000 -4.428595
-1.000000 -3.141593
0.000000 0.000000
1.000000 3.141593
2.000000 4.428595
3.000000 4.996183
4.000000 5.303271
5.000000 5.493603
6.000000 5.622591
7.000000 5.715597
8.000000 5.785765
9.000000 5.840556
10.000000 5.884511
11.000000 5.920546
12.000000 5.950620
13.000000 5.976098
14.000000 5.997955
15.000000 6.016913
16.000000 6.033510
17.000000 6.048162
18.000000 6.061191
19.000000 6.072853
SHAR_EOF
if test 781 -ne "`wc -c < '2.dat'`"
then
	echo shar: error transmitting "'2.dat'" '(should have been 781 characters)'
fi
fi # end of overwriting check
echo shar: extracting "'3.dat'" '(781 characters)'
if test -f '3.dat'
then
	echo shar: will not over-write existing file "'3.dat'"
else
cat << \SHAR_EOF > '3.dat'
-20.000000 -9.125028
-19.000000 -9.109280
-18.000000 -9.091787
-17.000000 -9.072243
-16.000000 -9.050265
-15.000000 -9.025369
-14.000000 -8.996933
-13.000000 -8.964147
-12.000000 -8.925931
-11.000000 -8.880819
-10.000000 -8.826766
-9.000000 -8.760835
-8.000000 -8.678648
-7.000000 -8.573396
-6.000000 -8.433886
-5.000000 -8.240405
-4.000000 -7.954906
-3.000000 -7.494275
-2.000000 -6.642892
-1.000000 -4.712389
0.000000 0.000000
1.000000 4.712389
2.000000 6.642892
3.000000 7.494275
4.000000 7.954906
5.000000 8.240405
6.000000 8.433886
7.000000 8.573396
8.000000 8.678648
9.000000 8.760835
10.000000 8.826766
11.000000 8.880819
12.000000 8.925931
13.000000 8.964147
14.000000 8.996933
15.000000 9.025369
16.000000 9.050265
17.000000 9.072243
18.000000 9.091787
19.000000 9.109280
SHAR_EOF
if test 781 -ne "`wc -c < '3.dat'`"
then
	echo shar: error transmitting "'3.dat'" '(should have been 781 characters)'
fi
fi # end of overwriting check
echo shar: extracting "'controls.demo'" '(598 characters)'
if test -f 'controls.demo'
then
	echo shar: will not over-write existing file "'controls.demo'"
else
cat << \SHAR_EOF > 'controls.demo'
#
# warning:  this demo is SLOW on PCs without math coprocessors!
#
# From _Automatic_Control_Systems_, fourth ed., figure 6-14
# transient response of a second-order system to a unit step input function
#
damp(t) = exp(-s*wn*t)/sqrt(1.0-s*s)
per(t) = sin(wn*sqrt(1.0-s**2)*t - atan(-sqrt(1.0-s**2)/s))
c(t) = 1-damp(t)*per(t)
#
#	wn is natural undamped frequency
#	s is damping factor
#
wn = 1.0
set xrange [0:13]
set samples 50
set dummy t
#
# plot c(t) for several different damping factors s
#
plot s=.1,c(t),s=.3,c(t),s=.5,c(t),s=.7,c(t),s=.9,c(t),s=1.0,c(t),s=1.5,c(t),s=2.0,c(t)
set dummy x
SHAR_EOF
if test 598 -ne "`wc -c < 'controls.demo'`"
then
	echo shar: error transmitting "'controls.demo'" '(should have been 598 characters)'
fi
fi # end of overwriting check
#	End of shell archive
exit 0

drdave@rocksvax.UUCP (02/02/87)

 I have tried putting GNUPLOT together on my PC/XT using the MS C 4.0
compiler.  The load string calls for a library called "EGA.LIB" which
iss not avialable.  As a result there are several undefined addresses.

Is this a "standard" library or is something missing from the distribution?

BTW this runs fine on my VAX780 running 4.2 bsd.

Thnaks for the nice program.

Dave Birnbaum

black@ee.ucla.edu (02/09/87)

>  I have tried putting GNUPLOT together on my PC/XT using the MS C 4.0
> compiler.  The load string calls for a library called "EGA.LIB" which
> iss not avialable.  As a result there are several undefined addresses.

Dave-

Extended Graphics Adapters are cards that XTs use to produce hi-res 
graphics output on terminals.  If you have such a card for your
PC, it should have included a floppy disk with EGA.LIB on it.
If you're using a Hercules or other non-EGA card, what you'll need
to do is establish a one-to-one mapping from EGA routines to yours,
paying special attention to parameters (one-to-two or even one-to-n
mappings are possible too, but one Hell of a lot less likely to
work.)

Hope this clears things up a bit.

Rex Black
	
black@ee.ucla.edu                                          ARPA        
...!{ihnp4,ucbvax,sdcrdcf,trwspp}!ucla-cs!uclaee!black     UUCP

Disclaimer:  "It wasn't me, no no babe, it wasn't me,
              Yeah, it musta been some-other-body,
              No no child, it wasn't me!"  -- George Thoroughgood

randy@chinet.UUCP (02/10/87)

In article <4327@brl-adm.ARPA> black@ee.ucla.edu (Rex Black) writes:
>>  I have tried putting GNUPLOT together on my PC/XT using the MS C 4.0
>> compiler.  The load string calls for a library called "EGA.LIB" which
>> iss not avialable.  As a result there are several undefined addresses.
>
>Extended Graphics Adapters are cards that XTs use to produce hi-res 
>graphics output on terminals.  If you have such a card for your
>PC, it should have included a floppy disk with EGA.LIB on it.

	Ega.lib is a library of programs posted to net.sources recently.
Here is the first part of the included DOC file:

----------------

              Graphics for the IBM's Enhance Graphic Adapter (EGA)
                              Version 02/25/86
                           for Microsoft C 3.00+
                                   and
                            Turbo Pascal 3.01A+
                                                        DATE:   02/03/86
                                 IMPORTANT NOTICE
        The Enhanced Graphic Adapter (EGA) graphic routines for Microsoft
        3.0 and Turbo Pascal 3.01A was written and is maintained by:
                               Kent Cedola
                               2015 Meadow Lake Court
                               Norfolk, Virginia  23518
                               1-(804)-857-0613
        Users of this software are encouraged to copy and distribute the
        graphics library and demonstrations programs which are a part of
        this package for non-commericial purposes.
        No fee or other charges may be made in the distribution of these
        programs without the written permission from Kent Cedola.
        Any program written with this graphic library may be sold, as
        long as the source code for the graphic library in not included.
        If you wish to include the graphic library with the product,
        please contact me for more information and written permission.
        The date of release will be used in instead of a version.  When
        requesting information, please included the date (version) of the
        copy that you have and the amount of EGA memory.  Write the above
        for the current release of the graphic library.
--------------------------

	If you failed to receive it, send me mail, and I will email it to you.
-- 
.. that's the biz, sweetheart...
Randy Suess
chinet - Public Access UN*X
(312) 545 7535 (h) (312) 283 0559 (system)
..!ihnp4!chinet!randy

colin@vu-vlsi.UUCP (02/11/87)

In article <4327@brl-adm.ARPA> black@ee.ucla.edu (Rex Black) writes:
>>  I have tried putting GNUPLOT together on my PC/XT using the MS C 4.0
>> compiler.  The load string calls for a library called "EGA.LIB" which
>> iss not avialable.  As a result there are several undefined addresses.
<
<Dave-
<
<Extended Graphics Adapters are cards that XTs use to produce hi-res 
<graphics output on terminals.  If you have such a card for your
<PC, it should have included a floppy disk with EGA.LIB on it.
<If you're using a Hercules or other non-EGA card, what you'll need
<to do is establish a one-to-one mapping from EGA routines to yours,
<paying special attention to parameters (one-to-two or even one-to-n
<mappings are possible too, but one Hell of a lot less likely to
<work.)
<
<Hope this clears things up a bit.
<
<Rex Black

UGGHH!  Please ignore Rex's followup.  It is totally wrong.  EGA cards do not
come with _any_ software.  The EGA lib was posted to comp.sys.ibm.pc, and I
posted a followup explaining how to get it by US mail.  Please direct any
further questions to me so we can avoid this disinformation!

	-Colin Kelley  ..{cbmvax,pyrnj,psuvax1,bpa}!vu-vlsi!colin
or on BITNET:  colin@vuvaxcom