home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
plot
/
grafdemo.arc
/
GRAF.DOC
next >
Wrap
Text File
|
1989-03-28
|
37KB
|
1,646 lines
G r a F
USERS MANUAL
Version 1.0
Written by
Dan L. Kunkel
8 Mansfield Ave
Burlington, VT 05401
First Edition, January 1989
{C} Copyright 1989 by Dan L. Kunkel. All Rights Reserved.
DISCLAIMER
Written by Dan L. Kunkel for the IBM PC,XT,AT or compatibles using
DOS 2.0 or later.
GraF, GraFDemo and the accompanying documentation is
copyrighted by the author. You may make copies of the demo
program and documentation files for your own use, and you may
copy the files for others. You may not charge for such copies,
or in any other way sell the program or otherwise attempt to
make money from it or any modified version of it.
An exception to the above is granted to RECOGNIZED USER'S
GROUPS, which are hereby authorized to charge a small amount
(not to exceed $3.00) for media, postage, handling, etc of the
demo version.
For use by corporations and other institutions, please contact me
for a site licensing agreement. The source, customizing, and
special licensing are also available upon written request.
Purchase orders and invoicing are acceptable.
While every precaution has been taken in the preparation of
this software and manual, Dan L. Kunkel assumes no
responsibility for errors or omissions. Neither is any
liability assumed for damages resulting from the use of the
information contained in this manual. I do not warrant that
the documentation is accurate, or that the program operates as
designed. I will not be liable for any damages of any kind
sustained through the use of this program. By using this
software, you agree to this.
Your comments, suggestions, and friendly criticisms are welcome.
IBM is a registered trademark of International Business Machines
Corporation.
HP and HP Laser Jet is a registered trademark of Hewlett
Packard Corporation.
AT&T and AT&T PC6300 are registered trademarks of American
Telegraph and Telephone.
EPSON is a registered trademark of Epson America, Inc.
If you are using GraF Demo and find it of value, a copy can be
purchased for $20. Makes checks payable in U.S. dollars to Dan
L. Kunkel. Thank you.
{C} Copyright 1989 by Dan L. Kunkel. All Rights Reserved.
PREFACE
Welcome to GraF.
GraF is a complete graphing system which will accurately
plot experimental data as well as mathematical functions. GraF
is intended for the those people who need to graph data or
functions frequently and efficiently.
GraF allows you to do the following:
Plots graphs with up to 200 data points.
View Spline Interpolations of your data.
Take both the first and second derivative of your interpolated
data.
View user specified mathematical expressions.
Find the Derivative of mathematical expressions.
Integrate mathematical expressions.
Performs least squares data modeling to Polynomials,
Fourier Series, Exponential, Natural Logarithms, and
Power.
Store and retrieve data from the disk.
Equipment Requirements:
One of the following: IBM PC,XT,AT, AT&T PC6300, or any
IBM compatible that has at least 312 K of Memory.
The following graphic display standards are supported:
CGA Graphic Adapter
EGA Graphic Adapter
VGA Graphic Adapter
AT&T PC6300 High Resolution Mode Graphics Adapter.
Optional Equipment:
Hewlett Packard Laser Jet Printer.
Epson/IBM compatible dot matrix printer.
TABLE OF CONTENTS
1. INTRODUCTION ............................ 1
2. PROGRAM OVERVIEW ........................ 2
3. GETTING STARTED ......................... 4
4. TUTORIAL ................................ 6
5. REFERENCE ............................... 10
6. APPENDICES .............................. 16
Calculator ............................ 16
Data Editor ........................... 17
Line Editor ........................... 18
Data File Format ...................... 20
File Selector ......................... 21
INTRODUCTION
GraF Version 1.0 is a user-oriented graphing software
package. It is intended for the college student, and assumes
the user has very little computer experience. The pop up
menus make the program very easy to learn and use.
The software is designed to integrate data plotting with
data analysis. It will perform least squares fit, cubic
spline interpolations, and mathematical calculations of
functions you type in. Using this program will save you
valuable time when plotting your data, as well as assisting in
the analysis of your data.
How to use the manual
The manual is intended to familiarize the user with the
operation of the program. If you're the type of person who
hates to read documentation, try browsing the next section,
then run GraF and experiment with the sample data. The
tutorial will illustrate most of the functions of the software
in a clear, concise manner.
Page 1
PROGRAM OVERVIEW
Along with the standard graphing options provided with
most any graphing program, GraF provides additional support
with spline interpolation, least squares data fitting, and the
plotting of mathematical expressions.
The program has functions which allow you to edit, save
or retrieve your data. It automatically plots your data to
the screen, and allows you to change the scale, graph title,
and axis labels. It is also possible for you to control the
existence of data symbols, error bars, and lines connecting
the data points.
The data fitting section performs a "Least Squares" or
best fit of your data to a simple mathematical expression.
The mathematical forms include: Fourier (Sines, Cosines),
Polynomial (a * x^2 + b * x + c), Exponential ( a*exp(b*x) ),
Power (a*x^b) or Logarithmic (a * ln(b*x)). The coefficients
will appear on the plot along with the "Standard Deviation" or
quality of the fit.
Cubic splines are also included in the software. A
spline is a "smooth curve" which goes through all of your data
points. Included in this section is the ability to see the
"Derivative" or slope of the spline (the rate of change of the
spline), and the "Second Derivative" which the rate at which the
derivative is changing.
Finally, the program will allow you to specify a
mathematical expression such as "-3 * x^2 + 0.23 * x + 12" and
will it compute the value of the function at any x value. The
Page 2
program can also perform calculus manipulations with your
function such as Differentiation and Integration using
numerical methods. GraF will also plot mathematical
expression along with your data simultaneously.
Page 3
GETTING STARTED
What You Need to Get Started
- Any IBM PC, XT, AT or IBM true compatible computer.
- Must have at least 312K of random access memory (RAM).
- At least one 360K Disk Drive.
- A CGA, EGA, VGA or AT&T graphics monitor.
Invoke AT&T high resolution Graphics by including /a
after the name of the program. Example "graf /a".
- The GraF Software Diskette.
Optional Equipment
- A parallel or serial serial printer that is either
Epson/IBM compatible, or a HP LaserJet.
You will also need one 5 1/4-inch, double density floppy
diskette to make a working copy of GraF. Refer to your DOS
manual if you have any questions about formating a diskette.
Page 4
Preparing a Working Copy
Before you start the GraF tutorial, you must first
complete some preparatory steps.
The first step is to make a working copy of the original
GraF program diskette that came with this manual. The working
copy diskette should be the one you use at all times. The
original should be put away to protect it from being damaged
or destroyed.
Here's how:
Step 1 : Turn on your computer, and place your DOS diskette
in the Drive labeled A:. Enter the correct time
and date.
Step 2 : Put your new Diskette in Drive B:, and format with
the system. - See your DOS manual's section on
formating a diskette if you need assistance.
Step 3 : Take out the DOS disk, and replace it with the
GraF program diskette.
Step 4 : Type "copy a:*.* b:" and press <RETURN>.
Step 5 : Put the GraF program disk in a safe place.
You may repeat this process any time you need additional
working copies.
Page 5
TUTORIAL
This section of the GraF manual provides step by step
instructions to help you understand and operate GraF.
Loading the program.
If the computer is off, insert the working copy of GraF in
Drive A and turn on the computer. Then, enter the time and
date, pressing <RETURN> after each. The A> prompt will appear
on the screen.
If you are using an AT&T PC6300 type:
A>graf /a and press <RETURN> to utilize its high
resolution monitor.
Otherwise type:
A>graf and press <RETURN>.
After several seconds the Title and Copyright screen will
appear. Hit any key to continue with the tutorial.
To Quit:
Use the <LEFT> and <RIGHT> arrow keys to select "Quit" on
the menu bar on the top of the screen, and press <RETURN>.
Page 6
Creating Your First Plot:
After the Title and Copyright message disappears, the
program will display an empty plot and menu bar. You can
select a menu option by pressing the <LEFT> and <RIGHT> arrow
keys (Number 4 and 6 on the Numeric keypad).
Move to "File/Data" and press <RETURN>. Another menu will
appear below the menu bar. Select the top entry "Edit/Create
Data" using the <UP> and <DOWN> keys and press <RETURN>. A
screen containing titles and lists of numbers will appear. Use
the instruction box in the upper right corner. REMEMBER to use
the <F9> and <F10> or <TAB> and <Shift TAB> keys when moving
from one column of numbers to the next.
Position the cursor for each item and type in the
following data:
X axis Y axis
0.664 0.1
1.08 0.25
1.44 0.3
1.80 0.45
2.37 0.5
Pressing <ESC> will abort editing, and plot the data you just
entered.
Let's save the data. Hit a key to make the menu bar
appear, then press <RETURN> to bring up the "File/Data" menu.
Move down to "Save Data" by pressing the <DOWN> arrow key
several times, and press <RETURN> again. When the program
prompts for a name, type "MYFIRST.DAT" and press <RETURN>.
Now we want to change the X axis scale so it starts from
Page 7
Zero, and ends at 2.5. Hit a key to make the menu bar pop up,
then move to "GraF" and press <RETURN>. Move down to "Change
Scale", and type <RETURN>. Enter "0" <RETURN> to make the X
axis lower limit zero. Move down to X axis upper limit, and
type "2.5" <RETURN>. Now press <ESC> to see the new plot
displayed.
In order to change the Title and Axis Labels, you must
first go to that command under "GraF". Change the Title by
typing "Spring Constant", <RETURN>. Then change the X axis to
"Time^2 (sec^2)", and the Y axis to "Mass (Kg)". Press <ESC>
to quit editing, and see the new lables.
Let's perform Linear Regression on the data. Go to "Data
Fitting", and pick "Linear Regression" from the menu. A
straight line will appear adjacent to the line that is
connecting the data points. The equation of the straight line
can be found in the upper left corner of the plot with the
Regression Coefficient of the fit written just below that.
Sometimes lines connecting the Y data points are
confusing, so let's just have the computer plot symbols at
each of the data points. Go to "GraF", "Line Type", and pick
"Hide Y Data" from the menu that appears on the screen.
Notice that your data disappeared; don't worry, it's still in
the computer. Now pick "Symbols" to see your data points
plotted with boxes. <ESC> or "Exit" will make the menu box
disappear.
Let's interpolate your data by moving into the Spline
menu and choosing "Interpolate". A smooth curve, also known
as a cubic spline will go through all of your data points.
Page 8
We can examine the difference between your data and the
equation "Y = x^(5/4)/4+0.1" by using the "Calculator". Pick
Calculator, Plot Function, and type in "X^(4/5) / 4" and
press <RETURN>. After a moment a plot of the function will
appear. Now you can visually compare your data to the
function.
If you have a printer connected, now is the time to turn
it on and correctly position the paper. Choose GraF, Print,
and select the type of printer output, and press <RETURN>.
The computer will think for a short time, and then start
printing your plot.
When you're all done, pick "Quit" from the menu bar. If your
data has been changed, the computer will ask if you want to save
it to the disk before quitting. That's all there is to it.
Page 9
REFERENCE
This section will help you understand all of GraF's many
capabilities.
GRAPHING BASICS:
GraF requires a two dimensional data point - a point
specified by an X and Y coordinate. Traditionally, X is the
controlled variable, and Y is the measured variable.
Due to the computers internal number representation, some
weird things can happen at very large or very small scales.
This can be remedied by scaling your data before entering it
into GraF.
GraF has the ability to plot many different lines on the
same graph. In addition to your data, the error data can also
be plotted. Data Fitting, Spline, and Calculator can each
have one line plotted. The lines are drawn automatically when
you choose a command from their sub-menus, and can be removed
from the plot by choosing either Clear or Remove Plot.
Page 10
MENUS EXPLAINED
When you run the program, the first thing you will see is
an introductory screen. After hitting any key, the program
will display an empty plot on the screen, and produce a pop up
menu bar.
The Menu options include:
File/Data This has everything to do with Editing, Loading,
and Saving the data. It also lets you change
directories and view text files.
GraF This controls all the aspects of plotting your
data, such as how your data is printed. Other
options include Auto-Scaling your data, as well as
changing the scale, sorting your data, and
printing.
Data Fit This menu allows you to choose what kind of Data
Fitting to perform, as well as Auto-Scaling the
Fit, and Clearing it from your plots.
Splines This option allows you to choose the Spline
Interpolation or one of its derivatives,
as well as Auto-Scaling the spline, and Removing
it from your plots.
Calculator This will pop up a sub-menu has all the options
dealing with the mathematical expressions you
would type in. You can evaluate an expression,
as well as Differentiating or Intergrating that
expression at any point. The plot function
option will graph your function on the screen.
Auto-Scale and Remove plot will scale your
function, or remove it from the plot.
Quit Returns you to DOS.
Picking things from the menus is easy. Just move with the
arrow keys until the desired item is highlighted (NumLock must
be off), then press <RETURN>. A faster way is to just type the
first character of the command choosen. To return at any time
to your graph, just press the <ESC> key. A help document will
appear on the screen when you type <F1>.
Page 11
FILE/DATA
Edit/Create Data This command found in the File/Data menu is used
to edit or enter data into the computer. The
commands for operating the Data Editor are found
in the Appendix.
Load / Save These two commands will let you save the data
you entered into the diskette, or read it from
the diskette after you've saved it. When you're
Loading data into the computer, it will let you
pick the name of the file from the Directory
chooser. The File Selector and File Format
are discussed in the Appendix.
New/Erase Data
New/Erase Data will erase all of the data that
is stored in the computer's memory.
Directory Directory will let you examine the files
contained on the specified diskette.
Change dir Change dir displays the current drive and
directory, and allows you to change to a
specified drive and/or directory.
View ASCII File This routine will let you list ASCII files to
the screen. The commands it understands are
<UP>, <DOWN>, <PGUP>, <PGDN>, <BEGIN> and <END>.
Press <ESC> will return you to the program.
Page 12
GraF
Line Types
Y Data/Hide Y data controls whether lines are
used to connect each data point.
Symbols/No Symbols controls whether the box
symbols are placed on every data point.
Valid Error Bars/Invalid Error Bars controls the
use of Error Bars on your plot.
Error Data/Remove Error Data controls whether
the Error data is also plotted. This allows you
to display two lines at the same time, but you
have no control over the attributes of the Error
Data Line.
Auto-Scaling The program will automatically scale a plot.
Entering this command will scale the data
currently being used. For instance, Auto-Scaling
in the Calculator menu will automatically scale
the current Calculator Function.
Changing Scale This option will let you change the limits of
the plot. You can also choose to have your data
plotted on a logarithmic scales.
IMPORTANT Since logarithms aren't defined for numbers
less than or equal to zero, make sure your data
and plotting limits are all positive numbers
larger than zero.
Title/Axis Labels This option lets you change your X and Y
axis labels and plot title.
Sort X axis. This option will sort your data into ascending
order.
Print Graph This command will print the plot on the screen
to either a Dot Matrix printer, or a HP Laser
Jet printer. The Large Dot Matrix printout will
rotate the printout and make it larger. You can
choose to have the output sent to a file, by
entering the files name, or to the printer by
entering "PRN". When you want to print the file
that is generated, just type "copy FileName PRN
/b".
Page 13
DATA FITTING
Each Data Fitting routine prints the formula to the plot
in the upper left hand corner, and is followed by the quality
factor of the fit.
Linear Regression This performs standard Linear Regression on your
data. The regression coefficient is displayed
along with the data.
Polynomial Fit This performs a Least Square Fit with a
polynomial of degree N which you specify.
Fourier Fit This fits the data to Y = A + B*Sin(x) +
C*Cos(x) + ... using the least squares method.
You can enter the number of terms you want in
the fit.
Exponential The data is fitted to the form Y = A * exp(B*X)
using the least squares method.
Power The data is fitted to the form Y = A * x^(B*X)
using the least squares method.
Logarithmic The data is fitted to the form Y = A * ln(B*X)
using the least squares method.
Derivative This can be used instead of Fitting your Data,
to compute the change of your data divided by
the change in X.
Auto-Scale This command will automatically scale the plot
so that the entire Data Fit will be visible.
Clear This function will stop displaying the data fit
text and line plotting.
SPLINE
Interpolation This routine computes and plots the cubic free
spline of your data. This spline is then
superimposed on the plot.
Differentiation This routine computes and plots the derivative
of the cubic spline that was created from your
data.
Second Derivative This routine computes and plots the second
derivative of the spline that interpolates your
data.
Auto-Scale This command will automatically scale the plot
so that the entire Spline will be visible.
Edit/Create This routine will let you examine and/or change
the Spline data.
Clear This function will stop plotting the Spline
data.
Page 14
CALCULATE
Expression This routine will return the numerical value of
a function at any point. See the Appendix on
the Calculator commands.
Integrating This routine computes the Integral of your
function over a interval you specify. It uses
the Adaptive Simpson method. If you don't know
what these are, you can find discussions in your
nearest Calculus book.
Differentiating This routine computes the Differential of your
function a a specified point. Information about
this can also be found in your Calculus book.
Plot Function This routine will let you enter a function of X
and plot it. The routine will use the X axis
Limits to choose the input range for the
function.
Auto-Scale This command will automatically scale the plot
so that the entire function is visible.
Edit/Create This procedure will let you examine and/or
change the function data.
Clear This routine will stop plotting the mathematical
function.
Page 15
APPENDIX
CALCULATOR
GraF contains a full functioned scientific calculator.
All operations are performed according to Algebraic Rules. The
legal functions include :
Addition (+) Subtraction (-)
Division (/) Multiplication (*)
Factorial (!) Exponential (exp)
Natural Log (ln) X to the Y (^)
Logarithms (log) Square (sqr)
Square Rt (sqrt) Round (round)
Absolute Value (Abs) Random Number (RND)
Trigonometric
Sine (sin) Cosine (cos)
Tangent (tan) Secant (sec)
Cosecant (csc) Cotangent (cot)
Arcsine (arcsin) Arccosine (arccos)
Arctan (arctan)
CHANGING CALCULATOR MODES:
The calculator is in Radian Mode upon startup. Typing
"Deg" instead of a mathematical expression will put it
into Degree Mode. "Rad" invokes Radian Mode.
Hyperbolic
Sine (sinh) Cosine (cosh)
Tangent (tanh) Arcsine (arcsinh)
Arccosine (arccosh) Arctanh (arctanh)
Constants and Variables:
The constant "Pi" is defined as 3.1415926...
The variables X, and Y are understood, but Y is always
evaluated as being 0.
Page 16
DATA EDITOR
The Data Editor is designed to let you easily input and/or
edit data. It is invoked every time you "Edit/Create" data.
The data editor commands include the following:
<UP> Moves up one line.
<DOWN> Moves down one line.
<PGUP> Moves up a page.
<PGDN> Moves down a page.
<F1> Invokes a Help Screen.
<F5> Copies the value of the entry that is being
edited to the line numbers you specify.
<F6> Copies the values of all the lists of numbers
to the line numbers you specify.
<F7> Inserts a Line for Data.
<F8> Deletes a Line of Data.
<F9>, Moves which list you are editing to the left
<TAB> one position.
<F10>, Moves which list you are editing to the right
<Shift TAB> one position.
<ESC> Returns to the data plot.
Page 17
LINE EDITOR
Whenever you are asked to input a name, a string, or a
number, the following commands are available:
<F1> Displays a help document.
<F2> Change the case of the letter at the cursor.
<ESC> Escape and go back.
<RETURN> You're done, that's it.
TYPEOVER AND INSERT MODES
The GraF editor has two basic modes: the typeover mode and the
insert mode. In typeover (normal mode), anything you type
will replace the text currently displayed at the cursor. In
insert mode, anything you type will be inserted into the text
at the current cursor position, displacing any characters to
the right of the cursor. The <INS> key toggles between
typeover and insert modes.
CURSOR MOVEMENT KEYS
GraF uses the following keys for cursor movement:
<HOME> Moves the cursor to the first position in the line.
<END> Moves the cursor to the end position (following
the last character displayed). <LEFT> Moves the
cursor to the left one character. This does not
erase any characters; it simply moves the
cursor. Remember that <LEFT> is the left-arrow
Page 18
key on the numeric keypad (key 4), not the
backspace key (the larger left arrow next to
NumLock).
<RIGHT> Moves the cursor to the right one character.
<Ctrl LEFT> Moves the cursor to the left one word. A "word"
is any sequence of characters bounded by one or
more spaces; the cursor will be placed on the
first character of the previous "word".
<Ctrl RIGHT> Moves the cursor to the right one word; it
will be placed on the first character of the
next word.
TEXT DELETION KEYS
The following GraF editor keys are used to delete text:
<DEL> Deletes the character at the cursor position.
<BACKSPACE> Deletes the character to the left of the cursor
position. This is known as a destructive
backspace; it is exactly equivalent to keying
<Left> followed by <Del>.
<Ctrl END> Deletes all characters from the cursor position
to end of the command.
Page 19
DATA FILE FORMAT
The File format is a simple ASCII format, which can be
edited and changed by any text editor.
The format is:
Title if the Line is Text.
X axis Label if the Line is Text.
Y axis Label if the Line is Text.
0,0,0
1,1,0 ...
Spaces and many characters can be used instead of commas as
delimiters.
Page 20
FILE SELECTOR
The file selector is designed to make chooseing files
easier. The DOS-style mask allows the user control over what
files appear in the selector. You can load in a specific file
by just typing it's name. After pressing <RETURN>, a box
with all of the choices will appear on the screen.
File Selector commands:
<ESC> Get out without selecting anything.
<F1> Displays a help document.
<UP> Moves up one line.
<DOWN> Moves down one line.
<PGUP> Moves up a sceen.
<PGDN> Moves down a sceen.
<HOME> Moves to the top.
<END> Moves to the bottom.
<RETURN> Selects a file or directory.
Page 21