Category : Science and Education
Archive   : MATHPL32.ZIP
Filename : MATHPLOT.DOC

 
Output of file : MATHPLOT.DOC contained in archive : MATHPL32.ZIP








M A T H P L O T



Mathematical Function Plotting Program

A "shareware" program



Phillip H. Sherrod

Member, Association of Shareware Professionals (ASP)






Mathplot allows you to specify complicated mathematical
functions using ordinary algebraic expressions and
immediately plot them. Four types of functions may be
specified: cartesian (Y=f(X)); parametric cartesian
(Y=f(T) and X=f(T)); polar (Radius=f(Angle)); and
parametric polar (Radius=f(T) and Angle=f(T)). Up to
four functions may be plotted simultaneously. Scaling
is automatic. Options are available to control axis
display and labeling as well as grid lines. Hard copy
output may be generated to HP LaserJet printers as well
as screen display. Mathplot is an ideal tool for
engineers, scientists, math and science teachers, and
anyone else who needs to quickly visualize mathematical
functions.

Mathplot -- Mathematical Function Plotter Page 1




INTRODUCTION

Mathplot is a program for IBM-PC computers which allows
interactive entry and plotting of mathematical functions. Some
of the features of Mathplot are listed below:

Direct entry of complicated mathematical functions
using normal algebraic expressions with embedded
operators and functions.

An assortment of built-in functions including
trigonometric, square root, log, Gamma, Bessel,
elliptic integrals, normal probability distribution,
etc.

The ability to plot four types of functions: cartesian
(Y=f(X)); parametric cartesian (Y=f(T) and X=f(T));
polar (Radius=f(Angle)); and parametric polar
(Radius=f(T) and Angle=f(T)).

The ability to simultaneously plot up to four
functions.

Automatic scaling and axis labeling.

The ability to save function specifications in command
files which then can be easily executed.

The ability to accept X-Y data points from an external
file.

A command editor allows easy recall and editing of
commands.

Printed copies of plots may be produced on HP LaserJet
printers.


INSTALLING MATHPLOT

The Mathplot system consists of the following files:

MATHPLOT.EXE -- The executable program.
MATHPLOT.FON -- Font file used for title line and axis labels.
MATHPLOT.LJF -- Font file for HP LaserJet printer.
MATHPLOT.FUN -- Example functions
MATHPLOT.DOC -- Documentation file.
REGISTER.DOC -- Software registration form.

To install Mathplot, copy the files into the directory of your
choice. If you do not plan to generated hard copy output for a

Mathplot -- Mathematical Function Plotter Page 2


LaserJet printer, you may delete the MATHPLOT.LJF file. If the
MATHPLOT.FON and MATHPLOT.LJF files are not in your current
directory, you must place a command of the following form in your
AUTOEXEC.BAT file to tell Mathplot where to look for its font
files:

SET MATHPLOT=directory

Where "directory" is the name of the device and directory where
the files are located. For example, if the files are located in
a directory named MATHPLOT on the C disk, the following command
could be used:

SET MATHPLOT=C:\MATHPLOT



GETTING STARTED

Mathplot is exceptionally easy to use. Although there are a fair
number of commands to control options, you only need to know a
couple of commands to begin using it.

Start the program by entering the command:

MATHPLOT

Mathplot will display a title screen; press Enter to proceed to
command mode. The main Mathplot screen is divided into three
sections. The top window explains the function keys. The bottom
window is used to display status and error messages. The middle
window is used by the command editor to display commands that you
enter.

Several of the common Mathplot operations can be performed either
by pressing a function key or by typing a command. These
commands are described below:

Function key Command Action
------------ ------- --------------------------------------
ESC EXIT Exit from Mathplot to DOS
F1 PLOT Plot the current functions
F2 Print current functions on HP LaserJet
F3 HELP Display help menu
F4 RESET Erase functions and reset Mathplot
F5 Run an example

The F5 key executes built-in example plots. Each time you press
F5 a different example is displayed. I suggest you use this
feature to display a few plots in order to get a feeling for how
Mathplot works and what types of commands are used to produce
plots. Press any key to continue with execution after you finish
looking at a plot. Note that after each example is completed the

Mathplot -- Mathematical Function Plotter Page 3


commands that produced it are displayed on your screen. By
examining a few sets of example commands you should be able to
get a pretty good idea about how to use Mathplot.

Once you have used F5 to display some plots, it is time to try
entering your own commands. Begin by specifying a simple
function to be plotted. I suggest you enter the command:

Y=SIN(X)

You may use either upper or lower case letters when you type a
command. Press Enter when you are finished typing the line.
Next, command Mathplot to evaluate this function and plot the
results by pressing F1.

You should see a sine wave displayed on your screen. Press Enter
to return to the command editor. Now let's make the function
slightly more complicated by entering the command:

Y=SIN(X)+SIN(3*X)/3

Press F1 again to see this function plotted. If you make a
mistake when typing a command, use the arrow and editing keys
such as Backspace and Delete to correct your mistake, then press
Enter to reexecute the command.

So far, the function has been evaluated over the interval
(0,2*pi), which is the initial default domain. Use the following
command to change the domain to (-2*pi,2*pi):

DOMAIN -2*PI,2*PI

Also, use the following command to turn on grid line display:

GRID ON

Press F1 to display the plot.

As a final exercise, use the following command to define a second
function to be displayed simultaneously with the first one:

Y2=SIN(X)

And, again press F1 to display them. You should see a simple
sine wave (the Y2 function) superimposed on the previous function
(the Y function). Press ESC to exit Mathplot and return to DOS.

Demonstration Command File

The Mathplot distribution includes a command file named
MATHPLOT.FUN containing a number of interesting example plots.
You can execute this command file by using the Mathplot "DO"
command, or by specifying the command file on the invocation

Mathplot -- Mathematical Function Plotter Page 4


line. The following DOS command starts the Mathplot program and
instructs it to execute the commands stored in the file
MATHPLOT.FUN:

MATHPLOT MATHPLOT.FUN



COMMAND EDITOR

The middle window of the main Mathplot screen is used by the
command editor to accept and display commands you type. In
addition to typing commands, you can also use the arrow keys and
other editing functions to recall, edit, and reexecute commands.
If you enter a command that has an error, a message will appear
in the bottom window. You can use the up-arrow key to move the
cursor up to the previous line, edit it, and then reexecute it by
pressing Enter. Each time you press Enter, the line in which the
cursor is positioned is executed. Using the arrow keys to move
up and down does not execute commands.

The following function keys can be used with the command editor:

Delete -- Delete the character under the cursor.
Home -- Move to the left end of the line.
End -- Move to the right end of the line.
Page up -- Move up to the previous page of commands.
Page down -- Move down to the next page of commands.
Insert -- Switch between insert and overtype mode.

The following control characters can be used with the command
editor:

Enter -- Execute the command line the cursor is positioned to.
Backspace -- Delete the character to the left of the cursor.
Control-U -- Delete characters to the left of the cursor.
Control-D -- Delete all characters in the current line.



FUNCTION SPECIFICATION

Much of the power of Mathplot comes from its ability to evaluate
complicated functions entered in ordinary algebraic form. This
section explains the arithmetic operators and built in functions
that are used to define a function.

Mathplot -- Mathematical Function Plotter Page 5


Arithmetic Operators

The following arithmetic operators may be used in expressions:

+ addition
- subtraction or unary minus
* multiplication
/ division
** or ^ exponentiation

Exponentiation has the highest precedence, followed by
multiplication and division, and then addition and subtraction.
Parentheses may be used to group terms.

As a convenience, Mathplot allows you to omit the multiplication
operator between a numeric constant and a following variable or
function. For example, the expressions "2pi", and "2 pi" are
equivalent to "2*pi". Similarly, "5X" is equivalent to "5*X".
However, if you specify a number before the letter "E", it will
be taken as the exponential form of a number (see below) rather
than the number times the constant E (base of natural
logarithms).

Numeric Constants

Numeric constants may be written in their natural form (1, 0,
1.5, .0003, etc.) or in exponential form, n.nnnEppp, where n.nnn
is the base value and ppp is the power of ten by which the base
is multiplied. For example, the number 1.5E4 is equivalent to
15000. All numbers are treated as "floating point" values,
regardless of whether a decimal point is specified or not.

Symbolic Constants

There are two numeric constants that may be specified using
symbolic names. The symbolic name "PI" is equivalent to the
value of pi, 3.14159... Similarly, the symbolic constant "E" is
equivalent to the base of natural logarithms, 2.7182818...


Parameter values

Mathplot allows you to use parameters named P0, P1, ..., P9 in
function definitions. You can then assign values to the
parameters and replot the function without having to retype the
function to change a value. To assign a value to a parameter,
type the parameter name as a command followed by the value to be
assigned. For example, the following command assigns the value
0.67 to the parameter P0:

P0 0.67

Mathplot -- Mathematical Function Plotter Page 6


Note that parameters are like constants during the evaluation and
plotting of a function (i.e., their values do not change). But
you can assign new values to parameters between plot generations.
For example, consider the following commands which define a
function and then plot it twice with two different values of the
P0 parameter:

Y = EXP(-P0*X) * COS(X)
P0 0.6
PLOT
P0 0.8
PLOT

This function represents the response of a damped oscillator with
the P0 coefficient controlling the damping factor. By changing
the value of the P0 parameter you can examine different forms of
the function without having to retype the function.


Built in Functions

The following functions are built into Mathplot and may be used
in expressions:

ABS(x) -- Absolute value of x.

ACOS(x) -- Arc cosine of x. Angles are measured in radians.

ASIN(x) -- Arc sine of x. Angles are measured in radians.

ATAN(x) -- Arc tangent of x. Angles are measured in radians.

BETAI(x,a,b) -- Incomplete beta function: Ix(a,b). The
incomplete beta function can be used to compute a variety of
statistical functions. For example, the probability of
Student's t with `df' degrees of freedom can be computed
with BETAI(df/(df+t^2),.5*df,.5). The probability of the F
statistic with df1 and df2 degrees of freedom can be
computed with
2*BETAI(df2/(df2+df1*f),.5*df2,.5*df1).

COS(x) -- Cosine of x. Angles are measured in radians.

COSH(x) -- Hyperbolic cosine of x.

COT(x) -- Cotangent of x. (COT(x) = 1/TAN(x)).

CSC(X) -- Cosecant of x. (CSC(x) = 1/SIN(x)).

DEG(x) -- Converts an angle, x, measured in radians to the
equivalent number of degrees.

Mathplot -- Mathematical Function Plotter Page 7


EI1(alpha,phi) -- Elliptic integral of the first kind. Computes
the integral from 0 to phi radians of the function
d.phi/sqrt(1-k**2*sin(phi)**2), where k = sin(alpha). alpha
and phi must be in the range 0 to pi/2.

EI2(alpha,phi) -- Elliptic integral of the second kind. Computes
the integral from 0 to phi radians of the function
sqrt(1-k**2*sin(phi)**2)*d.phi, where k = sin(alpha). alpha
and phi must be in the range 0 to pi/2.

EIC1(alpha) -- Complete elliptic integral of the first kind.
Computes the integral from 0 to pi/2 radians of the function
d.phi/sqrt(1-k**2*sin(phi)**2), where k = sin(alpha). alpha
must be in the range 0 to (less than) pi/2.

EIC2(alpha) -- Complete elliptic integral of the second kind.
Computes the integral from 0 to pi/2 radians of the function
sqrt(1-k**2*sin(phi)**2)*d.phi, where k = sin(alpha). alpha
must be in the range 0 to pi/2.

ERF(x) -- Standard error function of x.

EXP(x) -- e (base of natural logarithms) raised to the x power.

FAC(x) -- x factorial (x!). Note, the FAC function is computed
using the GAMMA function (FAC(x)=GAMMA(x+1)) so non-integer
argument values may be computed.

GAMMA(x) -- Gamma function. Note, GAMMA(x+1) = x! (x factorial).

GAMMAI(x) -- Reciprocal of GAMMA function (GAMMAI(x) =
1/GAMMA(x)).

GAMMALN(x) -- Log (base e) of the GAMMA function.

HAV(x) -- Haversine of x. (HAV(x) = (1-COS(x))/2).

J0(x) -- Bessel function of the first kind, order zero.

J1(x) -- Bessel function of the first kind, order one.

JN(n,x) -- Bessel function of the first kind, order n.

LOG(x) -- Natural logarithm of x.

LOG10(x) -- Base 10 logarithm of x.

MAX(x1,x2) -- Maximum value of x1 or x2.

MIN(x1,x2) -- Minimum value of x1 or x2.

Mathplot -- Mathematical Function Plotter Page 8


NORMAL(x) -- Normal probability distribution of x. X is in units
of standard deviations from the mean. See also the
description of the NPD function. NORMAL(x) = NPD(x,0,1).

NPD(x,mean,std) -- Normal probability distribution of x with
specified mean and standard deviation. X is in units of
standard deviations from the mean.

PAREA(x) -- Area under the normal probability distribution curve
from -infinity to x. (i.e., integral from -infinity to x of
NORMAL(x)).

PULSE(a,x,b) -- Pulse function. If the value of x is less than a
or greater than b, the value of the function is 0. If x is
greater than or equal to a and less than or equal to b, the
value of the function is 1. In other words, it is 1 for the
domain (a,b) and zero elsewhere. If you need a function
that is zero in the domain (a,b) and 1 elsewhere, use the
expression (1-PULSE(a,x,b)).

RAD(x) -- Converts an angle measured in degrees to the equivalent
number of radians.

SEC(x) -- Secant of x. (SEC(x) = 1/COS(x)).

SIN(x) -- Sine of x. Angles are measured in radians.

SINH(x) -- Hyperbolic sine of x.

SQRT(x) -- Square root of x.

STEP(a,x) -- Step function. If x is less than a, the value of
the function is 0. If x is greater than or equal to a, the
value of the function is 1. If you need a function which is
1 up to a certain value and then 0 beyond that value, use
the expression STEP(x,a).

T(n,x) -- Chebyshev polynomial of order n.

TAN(x) -- Tangent of x. Angles are measured in radians.

TANH(x) -- Hyperbolic tangent of x.

Y0(x) -- Bessel function of the second kind, order zero.

Y1(x) -- Bessel function of the second kind, order one.

YN(n,x) -- Bessel function of the second kind, order n.

Mathplot -- Mathematical Function Plotter Page 9


FUNCTION TYPES

Mathplot allows four different types of functions to be plotted:
cartesian, parametric cartesian, polar, and parametric polar.
Each of the function types is described below:

Cartesian Functions

A cartesian function has the form Y=f(X), where X is the
independent variable that is plotted along the horizontal axis
and Y is the dependent variable plotted on the vertical axis.
The value specified with the DOMAIN command controls the interval
of X values over which the function is evaluated. Some examples
of this type of function are listed below:

Y=SIN(X)
Y=2*X**2-3*X+5
Y=SIN(X)/EXP(X)
Y=1/SQRT(2*(X+1))

Parametric Cartesian Functions

Parametric functions use a third variable, which we will call T,
as the independent variable. Both X and Y are dependent
variables defined as functions of T. The value of the T variable
is not directly displayed on the plot but is used only in the
functions that define the values of the X and Y variables that
are plotted. For example, the following commands define X and Y
as functions of T:

X=COS(T)
Y=SIN(T)

When parametric functions are defined, the DOMAIN statement
specifies the interval over which the T variable is computed. If
the two functions of X and Y specified above are plotted over the
domain (0,2*PI), the result is a circle with radius 1 centered
around the origin.

Polar Functions

A polar function specifies the distance (or radius) of a point
from the origin as a function of the angle swept around the
origin. The angle (A) is the independent variable and the radius
(R) is the dependent variable. The DOMAIN statement specifies
the interval of values that the angle is to be evaluated over.
The angle begins on the positive X axis; positive angles are
measured counterclockwise around the origin. Angles are measured
in radians; the RAD and DEG functions can be used to convert
between degrees and radians. The simplest polar function is

R=1

Mathplot -- Mathematical Function Plotter Page 10


which specifies that for all angles the radius is 1. If this
function is plotted over the domain (0,2*pi) the result is a
circle of radius 1 centered around the origin. Another simple
polar function is

R=A

which defines a spiral with the radius increasing with the angle.

Parametric Polar Functions

A parametric polar function defines the radius (R) and angle (A)
as functions of the parametric variable, T. The DOMAIN statement
defines the interval of T values over which the function is
evaluated. The following is an example of a parametric polar
function definition:

R=COS(T)
A=SIN(T)

Over the domain (0,2*pi), this produces a figure-eight pattern.


PLOTTING SIMULTANEOUS FUNCTIONS

Up to four functions may be plotted at the same time. When
defining multiple functions, add a single-digit suffix to the
dependent variable name for the function. For example, the
following commands define four functions to be plotted
simultaneously:

Y1=SIN(X)
Y2=COS(X)
Y3=SIN(2*X)
Y4=COS(2*X)

If no number is specified, the default value is 1. Thus, the
following two function definitions are equivalent:

Y=2*X**2
Y1=2*X**2

You can remove a function definition by defining another function
for the same dependent variable or by specifying the dependent
variable without a function. For example, the following command
removes the definition for Y2:

Y2

When a function of a type (cartesian, polar, etc.) different from
the current type is defined, all of the currently defined
functions are removed.

Mathplot -- Mathematical Function Plotter Page 11


MATHPLOT COMMANDS

The commands described in this section are used to control
Mathplot. When Mathplot is waiting for a command, the cursor is
positioned in the middle window of the screen. If you need to
type a command that is longer than a single line, you may
continue a command by typing a minus sign as the last character
on the line to be continued.

Commands may be abbreviated to the first three letters of their
keyword. Commands may be typed using upper or lower case
letters.

You may place comments on commands by preceding the comment by an
exclamation point. For example, the following commands have
comments:

! Define square wave function
Y=SIN(X)+SIN(3*X)/3 ! Approximate square wave
DOMAIN 0,2*PI ! One cycle of the function


Startup Command File

The DOS command to start Mathplot is:

MATHPLOT [filename]

where "filename" is an optional parameter specifying the name of
a file containing commands to be executed by Mathplot as soon as
it is started. This startup command file may contain one or more
complete sets of statements to define functions and plot them.
The default file extension is ".FUN". See also the descriptions
of the DO and SAVE commands for additional information about
command files.

Initialization file

Each time Mathplot is started it attempts to open a file named
MATHPLOT.INI. If this file exists, all commands in it are
executed. You may create such a file to contain initialization
commands to set default values. For example, if you normally
like to have grid lines turned on, create a file named
MATHPLOT.INI containing the command "GRID ON". Mathplot looks
for this file first in the current directory and if it does not
find it there it checks to see if a MATHPLOT environment variable
has been defined to specify a directory. The initialization file
is executed before any file specified on the command that starts
Mathplot.

Mathplot -- Mathematical Function Plotter Page 12


Command Arguments

Many of the commands accept numeric arguments. In the
descriptions below, the notation "cexpr" is shown wherever a
numeric argument may be specified. These numeric arguments may
consist of numbers, symbolic constants, and expressions using
operators and built in functions. For example, the following is
a valid DOMAIN command:

DOMAIN -2*PI,PI*SQRT(2)

The argument expressions may NOT contain variables such as X, Y,
R, A, or T, or parameters such as P0 or P1.

Arguments shown in brackets are optional. Braces around a set of
options indicate that you must choose one of the options in the
set.



ALPHABETICAL LIST OF COMMANDS

AXES {ON | OFF} (default=ON) -- Specifies whether to display
axes. Use the LABELS command to control whether axis labels
are displayed.

CALCULATE cexpr -- Evaluate the specified expression, which must
contain only numbers, operators, and built in functions, and
display the result in the bottom window.

CAXES cexpr (default=3) -- Specify the color to be used for the
axis lines and labels.

CFn cexpr (default=2,1,4,3) -- Define the color to be used when
plotting function 'n'. For example, the command "CF1 3"
specifies that color 3 is to be used when plotting function
1.

CGRID cexpr (default=8) -- Specify the color to be used for grid
lines.

COMMONSCALE {ON | OFF} (default=OFF) -- If this option is turned
on, the X and Y directions are forced to have the same
scale. If this option is off, the X and Y ranges are scaled
independently, which may cause figures to be distorted - for
example, a circle may display as an ellipse. However,
turning this option on may result in one of the dimensions
using only a small portion of the screen if the X and Y
ranges are very different. This option is always on for
polar function plots.

Mathplot -- Mathematical Function Plotter Page 13


CTITLE cexpr (default=7) -- Specify the color to use for the
title line.

DATA filename -- Causes X and Y data values to be read from an
external file rather than being computed from function
definitions. After the data has been read, use the PLOT
command to display it. Any function definition following
this command will clear the external data values and revert
to function mode. Each X,Y data pair must be specified as a
separate line in the file with a space separating the X
value from the Y value. The default extension for the file
is ".DAT".

DISPLAY string -- Display the string in the bottom window of the
screen. The string is displayed for 3 seconds. This
command may be placed in command file to cause information
to be printed while the command file is being processed.

DO filename -- Execute the Mathplot commands stored in an
external file. This allows you to specify a complete plot
request, including functions and options, and then execute
it without having to retype the commands. An external file
may itself contain a DO command and this nesting may be
performed to a depth of 10 files. The default file
extension is ".FUN". Use the LIST command to control
whether the commands in the file are displayed in the edit
window. See also the description of the SAVE command.

DOMAIN cexpr1,cexpr2 (default=0,2*pi) -- Define the domain of the
independent variable over which the functions are evaluated
and plotted. This command may be abbreviated to "DOM".

EXIT -- Stop Mathplot and return to DOS. Pressing ESC will also
cause Mathplot to exit.

GRID {ON | OFF} (default=OFF) -- Specify whether grid lines are
to be displayed.

HELP -- Display the help menu. You can also do this by pressing
F3.

LABEL {ON | OFF} (default=ON) -- Specify whether axis labels are
to be displayed.

LIST {ON | OFF} (default=OFF) -- Specify whether commands
executed from an external file by subsequent use of the DO
command are to be listed as they are executed.

NUMPOINTS cexpr (default=100) -- Specify the number of points at
which the functions are to be evaluated over the domain.
Specifying a larger number of points results in a smoother
plot but increases the computation time. The maximum number
of points that may be computed is 2000. This command may be

Mathplot -- Mathematical Function Plotter Page 14


abbreviated to the single letter 'N'.

ORIGIN {ON | OFF} (default=OFF) -- Specify whether the origin
(0,0) is to be forced to be included in the plot. If this
option is off and the range of values does not span 0, then
the origin may not be displayed. Turning this option on
allows the range of the function relative to the origin to
be observed, but may result in a small scale factor if the
range is far from the origin.

Pn cexpr -- Specify a value for parameter Pn where 'n' is in the
range 0 to 9. Mathplot allows you to use up to ten
parameter values in function specifications. The parameters
are named P0, P1, ..., P9. You can assign a new value to a
parameter and replot the function without having to retype
the function.

PAUSE [cexpr] (default=0) -- This command may be placed in a
command file to cause execution to pause until a key is
pressed or the specified number of seconds elapse. If cexpr
is omitted or has the value 0, execution pauses for an
indefinite time until a key is pressed.

PDEVICE device (default=PRN) -- Allows you to specify the device
or file to which printer output is written when printing is
turned on by use of the PRINT ON command. The default
device is "PRN" but you may specify another device such as
LPT2 or COM. You may also direct output to a disk file that
you can printer later using the DOS PRINT or COPY commands.

PRESOLUTION value (default=150) -- Specifies whether plots sent
to HP LaserJet printers should use 150 or 300 dot-per-inch
resolution. The value parameter must be 150 or 300. The
default value is 150 causes the plots to use most of the
horizontal width of an 8.5x11 inch page. These plots are
suitable for direct transfer to overhead transparencies.
Specifying 300 for the resolution produces smaller plots
that are suitable for inclusion in printed documents.

WIDTH value (optional) -- Specify the width, in inches, of
printed plots. Due to memory space considerations, the
maximum width is limited to about 7.9 inches for 150 DPI
resolution and 4.5 inches for 300 DPI resolution. If you
have limited memory space, you may have to reduce the width
to be able to produce printed plots. This statement is
ignored unless you request that a plot be printed.

PLOT [cexpr] (default=0) -- Evaluate the currently defined
functions and plot them. If an optional value (cexpr) is
specified, the function is displayed for the specified
number of seconds or until a key is pressed. If the
optional value is omitted or is zero, the plot is displayed
for an indefinite time until a key is pressed. The use of

Mathplot -- Mathematical Function Plotter Page 15


the optional value is most useful when the PLOT command
occurs in a command file producing a "slide show" of
functions. You can also plot the function(s) by pressing
F1.

PRINT {ON | OFF} (default=OFF) -- Turns printer output on or off.
When turned on, any plot displayed on the screen is also
written to the printer (or file as directed by the PDEVICE
command). To produce a printed copy of the currently
defined function(s) press F2.

RESET -- Reset all parameters and options to their initial values
and remove all function definitions. You can also perform
this function by pressing F4.

SAVE filename -- Write the current function definitions and the
values of all options and parameters to the specified file.
The DO command can then be used at a later time to redisplay
the function. The default file extension is ".FUN".

TITLE string -- Define a title line to be displayed at the top of
the plot.

WAXES cexpr (default=3) -- Specify the width (in dots) of the
axis lines for printed output. This parameter does not
affect the screen display.

WFn cexpr (default=3) -- Specify the width (in dots) of the line
used to draw the plot of function 'n'. This only affects
hard copy output.

WGRID cexpr (default=1) -- Specify the width (in dots) of the
grid lines. This only affects hard copy output.


ADVANCED APPLICATIONS

Root Finding

Mathplot can be used to find the roots of equations. To do this,
turn on axis labeling (LABEL ON) and plot the function over the
domain in which a root occurs. Observe the approximate X value
at which the function crosses the X axis and then reset the
domain to closely span the crossing point. Replot the function
and obtain a new X estimate. After several iterations you will
be able to determine the root to several significant digits. For
example, use this technique to find the root of the function:

Y = X^4 - EXP(X)

in the domain (2,9.5).

Mathplot -- Mathematical Function Plotter Page 16


For a course in Algebra I, Mathplot can be used to demonstrate
the graphical method of solving two simultaneous linear equations
by locating the point of intersection. For an Algebra II course,
Mathplot can be used to locate minimum and maximum points for
quadratic and cubic equations.

Multiple Domains

Mathplot only allows specification of a single continuous domain
of values. However, by using the multiple function plotting
capability it is sometimes possible to simulate multiple domains.
For example, the function X*Y=5 defines a hyperbola with branches
in both the positive X-Y domain (upper right quadrant) and the
negative X-Y domain (lower left quadrant). The following set of
commands defines two parametric functions to draw each of the
branches:

X1=T
Y1=5/T
X2=-T
Y2=-5/T
DOMAIN 0.5,10
LABEL ON
COMMONSCALE ON
PLOT

Interesting Functions

The following specifications plot interesting and attractive
functions:

TITLE Four Leaved Rose
CTITLE 4
R=2*SIN(2*A)
CF1 3
DOMAIN 0,2*PI
NUMPOINTS 150
AXES ON
CAXES 1
PLOT

TITLE Prolate Cycloid
CTITLE 4
Y=1-2*COS(T)
X=T-2*SIN(T)
CF1 2
DOMAIN -4*PI,4*PI
NUMPOINTS 400
CAXES 1
COMMONSCALE ON
PLOT

Mathplot -- Mathematical Function Plotter Page 17


TITLE Hypocycloid of four cusps (Asteroid)
CTITLE 4
Y=SIN(T)^3
X=COS(T)^3
CF1 2
DOMAIN 0,2*PI
NUMPOINTS 100
AXES ON
CAXES 1
COMMONSCALE ON
PLOT

TITLE Bifolium
CTITLE 4
Y=2*SIN(T)^2*COS(T)^2
X=2*SIN(T)*COS(T)^3
CF1 3
DOMAIN 0,2*PI
NUMPOINTS 100
AXES ON
CAXES 1
COMMONSCALE ON
PLOT

TITLE Epicycloid
CTITLE 4
Y=5*SIN(T)-SIN(5*T)
X=5*COS(T)-COS(5*T)
CF1 3
DOMAIN 0,2*PI
NUMPOINTS 150
AXES ON
CAXES 1
COMMONSCALE ON
PLOT

"Artistic" Plots

When Mathplot plots a function, it evaluates the function at the
number of points specified by the last NUMPOINTS command and then
connects the points together using straight lines. By specifying
very large domain values for polar or parametric functions, the
lines connecting the points span large distances and produce
interesting and "artistic" plots. It is best to turn off axis
display (AXES OFF, LABELS OFF) and turn on common scaling
(COMMONSCALE ON) for these plots. Here are some examples to try:

Y=SIN(T)^3
X=COS(T)^3
CF1 2
DOMAIN 0,4000
NUMPOINTS 500

Mathplot -- Mathematical Function Plotter Page 18


R=2*SIN(2*A)
CF1 3
DOMAIN 0,2000
NUMPOINTS 500

Y=5*SIN(T)-SIN(5*T)
X=5*COS(T)-COS(5*T)
CF1 3
DOMAIN 0,6000
NUMPOINTS 400

Parametric and polar functions seem to produce the best artistic
plots. By varying the NUMPOINTS and DOMAIN values you can
usually produce many different plots from the same functions.



USE AND DISTRIBUTION OF MATHPLOT

You are welcome to make copies of this program and pass them on
to friends or post this program on bulletin boards or distribute
it via disk catalog services provided the entire Mathplot
distribution is included in its original, unmodified form. A
distribution fee may be charged for the cost of the diskette,
shipping and handling. However, Mathplot may not be sold, or
incorporated in another product that is sold, without the
permission of Phillip H. Sherrod. Vendors are encouraged to
contact the author to get the most recent version of Mathplot.

As a shareware product, you are granted a no-cost, trial period
of 30 days during which you may evaluate Mathplot. If you find
Mathplot to be useful, educational, and/or entertaining, and
continue to use it beyond the 30 day trial period, you are
required to compensate the author by sending the registration
form printed on a following page (and in REGISTER.DOC) with the
appropriate registration fee to help cover the development and
support of Mathplot.

In return for registering, you will be authorized to continue
using Mathplot beyond the trial period and you will receive the
most recent version of the program, a laser-printed, bound
manual, and three months of support via telephone, mail, or
CompuServe. Your registration fee will be refunded if you
encounter a serious bug that cannot be corrected.

See also the special offer for Nonlin that follows.

This program is produced by a member of the Association of
Shareware Professionals (ASP). ASP wants to make sure that the
shareware principle works for you. If you are unable to resolve
a shareware-related problem with an ASP member by contacting the
member directly, ASP may be able to help. The ASP Ombudsman can
help you resolve a dispute or problem with an ASP member, but

Mathplot -- Mathematical Function Plotter Page 19


does not provide technical support for members' products. Please
write to the ASP Ombudsman at 545 Grover Road, Muskegon, MI 49442
or send a CompuServe message via CompuServe Mail to ASP Ombudsman
7007,3536.

You are welcome to contact the author:

Phillip H. Sherrod
4410 Gerald Place
Nashville, TN 37205-3806
615-292-2881 (evenings)
CompuServe: 71333,27

Both the Mathplot program and documentation are copyright (c)
1991-1992 by Phillip H. Sherrod. You are not authorized to
modify the program. "Mathplot" is a trademark.

Disclaimer

Mathplot is provided "as is" without warranty of any kind, either
expressed or implied. This program may contain "bugs" and
inaccuracies, and its results should not be assumed to be correct
unless they are verified by independent means. The author
assumes no responsibility for the use of Mathplot and will not be
responsible for any damage resulting from its use.

Mathplot -- Mathematical Function Plotter Page 20


N O N L I N

Nonlinear Regression Analysis Program -- Special Offer

If you like Mathplot, you should check out Nonlin -- the
nonlinear regression analysis program by the same author. And,
if you register your use of Mathplot and order Nonlin at the same
time, you can get both for the special price of $40.

What is regression analysis? Regression analysis is a
mathematical technique for determining the best values of
parameters to fit an equation to a set of data points. For
example, you might want to develop an equation of the form

price = p0 + p1*age + p2*miles

to predict the price of a used car based on its age and the
number of miles driven. With Nonlin you can collect data from
car ads and then perform the analysis using the following set of
commands:

VARIABLES PRICE,AGE,MILES
PARAMETERS P0,P1,P2
FUNCTION PRICE = P0 + P1*AGE + P2*MILES
DATA

Nonlin will analyze the data and determine the best values of the
parameters P0, P1, and P2 to fit the data values.

Ordinary linear regression programs can only determine parameter
values for linear (straight line) equations. Nonlin, on the
other hand, can handle multivariate, linear, polynomial, and
general nonlinear equations. For example, using Nonlin you can
easily determine the best values for the parameters Offset,
Amplitude, and Frequency for an equation of the form:

Y = Offset + Amplitude * sin(Frequency * X)

Nonlin uses the same expression evaluator as Mathplot so you can
model complicated equations using the full set of operators and
library functions available in Mathplot. Nonlin can also find
the root (zero point) or minimum absolute value of a nonlinear
expression.

If you do any data analysis, or would just like to learn about
the incredibly useful regression analysis technique, you need
Nonlin!

Mathplot -- Mathematical Function Plotter Page 21


TSX-32 Multi-User Operating System

If you have a need for a multi-user, multi-tasking operating
system, you should look into TSX-32. TSX-32 is a full-featured,
high performance, multi-user operating system for the 386 and 486
that provides both 32-bit and 16-bit program support. With
facilities such as multitasking and multisessions, networking,
virtual memory, background batch queues, data caching, file
access control, real-time, and dial-in support, TSX-32 provides a
solid environment for a wide range of applications.

TSX-32 is not a limited, 16-bit, multi-DOS add-on. Rather, it is
a complete 32-bit operating system which makes full use of the
hardware's potential, including protected mode execution, virtual
memory, and demand paging. TSX-32 sites range from small systems
with 2-3 terminals to large installations with more than 64
terminals on a single 386.

In addition to supporting most popular 16-bit DOS programs,
TSX-32 also provides a 32-bit "flat" address space with both Phar
Lap and DPMI compatible modes of execution.

Since the DOS file structure is standard for TSX-32, you can
directly read and write DOS disks. And, you can run DOS part of
the time and TSX-32 the rest of the time on the same computer.

TSX-32 allows each user to control up to 10 sessions. Programs
can also "fork" subtasks for multi-threaded applications. The
patented Adaptive Scheduling Algorithm provides consistently good
response time under varying conditions.

The TSX-32 network option provides industry standard TCP/IP
networking through Ethernet and serial lines. Programs can
access files on remote machines as easily as on their own
machine. The SET HOST command allows a user on one machine to
log onto another computer in the network. FTP, Telnet, and NFS
are available for interoperability with other systems.

TSX-32 allows simultaneous real-time program execution with
normal time-sharing operations. Real-time programs can connect
to interrupts, access device control ports, and preempt other
operations when necessary. TSX-32 is an ideal process control or
data collection system.

TSX-32 is, quite simply, the best and most powerful operating
system available for the 386 and 486. For additional information
contact:
S&H Computer Systems, Inc.
1027 17th Avenue South
Nashville, TN 37212
615-327-3670 (voice)
615-321-5929 (fax)

Mathplot -- Mathematical Function Plotter Page 22


=====================================================================
Software Order Form
=====================================================================

Name ______________________________________________________

Address ___________________________________________________

City _______________________ State _______ Zip ___________

Telephone _________________________________________________

CompuServe account (optional) _____________________________

Mathplot version (on title screen) ________________________

Bulletin board where you found Mathplot ___________________

Comments __________________________________________________


Check the box below which indicates your order type:

___ I wish to register Mathplot ($20).

___ I wish to order Nonlin ($25).

___ I wish to register Mathplot and order Nonlin ($40).

Add $5 to any amount shown above if the software is being shipped
out of the United States.

In return for registering, you will receive the most recent
version of the program, a laser-printed, bound copy of the
manual, and three months of telephone or CompuServe support.
Your registration fee will be refunded if you find a serious bug
that cannot be corrected.

Distribution disk choice (check one):

3.50" HD (1.4 MB) ______
5.25" HD (1.2 MB) ______
5.25" DD (360 KB) ______

Send this form with the amount indicated to the author at:

Phillip H. Sherrod
4410 Gerald Place
Nashville, TN 37205-3806
615-292-2881 (evenings)
CompuServe: 71333,27


  3 Responses to “Category : Science and Education
Archive   : MATHPL32.ZIP
Filename : MATHPLOT.DOC

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/