¢BêÇ    Instructions for CURVE Program

This program derives the linear, exponential, logarithmic, and power
equations to fit a set of input data points x(I),y(I).  All the equations
are converted to the linear form Y=A+BX, and the linear form is fit to
the data by the method of least mean squares.

Type     Original Equation   Linearized Equation    Conversion Equations

Linear          y=a+bx             y=a+bx               Y=y,X=x;a=A,b=B
Exponential      y=ae^bx         ln y=ln a + bx        Y=ln y,X=x;a=e^A,b=B
Power          y=ax^b         ln y=ln a + b ln x   Y=ln y,X=ln x;a=e^A,b=B
Logarithmic     y=a+b ln x         y=a+b ln x           Y=y,X=ln x;a=A,b=B

A=($Y$X^2-$X$XY)/(n$X^2-($X)^2)      B=(n$XY-$X$Y)/(n$X^2-($X)^2)
where the "$" denotes "summation" over the n values.

The program may be considered as operating on two levels.  Level 1
is the data entry part of the program, and Level 2 provides regression
analysis and curve plotting.  Level 1 commands are shown in Table 1 and
are active at all times, including during Level 2 operation.  Level 2
commands are shown in Table 2 and are active only after the data has been
entered and the DONE command has been given.  A Level 1 command or an un-
recognizable entry made in Level 2 will return operation to Level 1.
Commands may be entered at any time by typing in the command followed by
the ENTER key.  Ten of the commands may also by entered by the special
function keys F1 through F10.  Commands may be upper case or lower case,
but upper and lower case letters should not be mixed in the same command.
At the beginning of the program the user is prompted to enter the
maximum number of data points.  The number entered should be large enough
to allow for the maximum number of data points that might need to be
entered, because changing it later will erase any data already entered.
Pressing the ENTER key with no number entry will default the maximum num-
ber of points to 25.  The number may be changed at any time by entering
the DIM command.
The user is then prompted for an optional title.  It may be any
combination of lower case letters, upper case letters, numbers, and
keyboard characters.  The title will be used on the printout.
A data point is entered in the form X,Y followed by the ENTER key,
where X and Y are the actual numbers, separated by a comma.  A data point
may be deleted by the DELETE or DEL command.  If the DELETE command alone
is entered, the user will be prompted for the data point to be deleted.
The data point may be specified by entering the actual data values in the
format X,Y or by entering the subscript number (no comma).  The DEL
or DELETE command may also be followed immediately by the data point
or the subscript before the ENTER key.  After the deletion, the array
subscripts will be renumbered.  The array of data showing the subscripts
may be relisted at any time by entering the LIST command or the F1 key.
Example:  To delete X(7)=100,Y(7)=8.9, enter DEL7 or DEL100,8.9.	¢BåÇ
After all the data points are entered, type DONE or hit the F2 key.
The linear, exponential, power, and logarithmic equations will be displayed,
showing the calculated equation coefficients and the correlation
coefficients.  Then enter the LIST command or hit the F1 key and a table
will be displayed showing all the input data and the values of Y calculated
from each of the four derived equations for each X value of input data.
To calculate values of Y for a new X, simply type in the value of X (no
comma) followed by the ENTER key.  Y will be calculated for each of the
four equations and added to the table listing.  This may be repeated as
many times as desired.  To print the equations, correlation coefficients,
and listing of input data and calculated values to the printer, enter the
PRINT command or hit the F10 key.
Several screen plotting options are available.  The PLOT command
(key F5) will provide plotting of three of the curves in three colors
in the medium resolution mode.  The user chooses which three of the four
equations are to be plotted according to the menu prompt.  The user may
also specify the maximum and minimum values of X and Y to be plotted by
entering Y in response to the prompt.  For any other response to the
prompt, such as just hitting the ENTER key, the program will choose the
maximum and minimum values so as to include all of the input data points.
In addition to the three curves, the plot will show the input data points
as small squares on the screen.  There are no grid lines on the display
other than the X and Y axes.  The numbers in the upper left, lower left,
and lower right corners of the screen are the values of X and Y at the
edges of the screen.  The LIN, EXP, POW, and LOG commands (keys F6, F7,
F8, and F9 respectively) are similar except that the plot is a single
equation in the high resolution mode.  After the equation(s) are plotted
the program will accept further Level 1 and Level 2 commands while the
plots are still on the screen.  The user can erase the plot screen and
return the display of the commands assigned to the special function keys
by hitting the ENTER key once.  Hitting the ENTER key again will return
the program to Level 1.  If the user accidently gets back to Level 1 by
hitting the wrong key, the DONE command will return the program to Level 2.
Note that additional data points can be added without destroying the
existing input data by entering X,Y as before.  To start over with a
completely new set of data, enter RESET (key F3) followed by the ENTER
key.
All calculations are carried out in single precision unless the DBL
command is entered.  BASIC does not provide double precision exponential,
power, and logarithmic functions, so only the linear equation is shown
with double precision coefficients.  However, the double precision mode
still improves the accuracy of the other equations by preventing further
accumulation of errors in the arithmatic calculations.  Calculations
carried out in single precision can easily reduce the accuracy of the
calculated coefficients to only 3 or 4 digits.  The DBL command may be
entered anytime, but it destroys all previously entered data.  The SNG
command returns to single precision calculations.
After a command is completed or a data entry is made, the program
displays the "?" prompt and is ready to accept a new command or data entry.
The program runs continuously once started; it may be stopped by CTRL+BREAK
or by turning the machine off.

TABLE 1:  Level 1 Commands

LIST             Lists all input data points in the format
X(I)=number,Y(I)=number.

DELETE or DEL    Delete a previously entered data point.  The user is
prompted to enter the data point to be deleted.  The
data point may be specified by entering the the X and Y
values separated by a comma.  The data point may also be
specified by entering a single number (no comma) rep-
resenting the array subscript shown in the data list.

DELETE x,y       Delete a previously entered data point.  The x and y after
or DEL x,y       the DELETE command are the actual numbers to be deleted.
Both values must be given and must be separated by a
comma.  A number without a comma would be interpreted as
a subscript.  The space after the command is optional.

DELETE i         Delete a previously entered data point.  The i after the
or DEL i         DELETE command is the array subscript number shown in the
input data list.  To display the current input data list,
enter the LIST command (key F1).  The space after the
command is optional.

DONE             Calculate the equation coefficients and correlation
coefficients for each of the four types of equations
and display the resulting equations and correlation
coefficients.  Illegal data points are ignored in the
calculations.  (For example, 0 and negative values of
X are illegal in the logarithmic equation, so the
logarithmic curve fit is calculated from the legal input
data points only.)  Level 2 commands are accessable after
the DONE command.

RESET            Erase all previously entered data and start over.

DBL              Erase all previously entered data and start over using
double precision arithmetic.  Since all BASIC functions
are single precision, the results for the exponential,
power, and logarithmic equations are limited to an
accuracy of six digits.  However, the calculations are
are double precision, which helps prevent the accumulation
of roundoff errors.

SNG              Erase all previously entered data and start over using
double precision arithmetic.  Note that accumulated
roundoff errors can reduce the effective accuracy of the
end results to only 3 or 4 digits or even less.

DIM              Erase all previously entered data, reset the maximum
number of data points, and start over.

TABLE 2:  Level 2 Commands

LIST             List a table of X and Y input data values and calculated
values of Y for each X using the four derived equations.
For trend line analysis, key in a new value of X (no
comma) followed by the ENTER key, and it will be added
to the table listing along with the calculated values of
Y for each of the four equations.

PLOT             Plot 3 of the 4 derived equations on the screen in 3
colors in the medium resolution mode.  The user selects
the 3 equations to be plotted in response to a menu
prompt.  The user may also specify the maximum and
minimum end points of the plot by entering Y in response
to the prompt; for any other entry, such as just hitting
the ENTER key, the program will choose the end points so
as to include all of the input data points.  The input
data points are indicated by small squares on the plot
screen.

LIN              Plot the derived linear, exponential, power, or
EXP              logarithmic equation on the screen in the medium
POW              resolution mode.  The user may specify the maximum and
LOG              minimum end points of the plot as described above.

PRINT            Print the title, the four derived equations, the
correlation coefficients, the input data values, the
values of Y caluclated from each of the four equations
for each input X data value, and the values of Y
calculated from the equations for any new values of X
that were entered.