6 6 14 50 V.2.20

                *****************
                **   SUB_CAL   **
                *****************

                   A subset of
         EL_CAL: The Elementary Calculator
        ½ 1989, 1992  by J.Andrzej Wrotniak

         Distributed by Debonair Software

  To view a page, click on its top-right corner.
     To change volume or to rearrange pages,
        click on the proper volume number.

                 MENU OPERATIONS
Among options available from the Menu Bar are:
* <Use|Calculator> switches to the Sub_Cal panel.
* <Use|Linear Algebra>  invokes the Linear Algebra
  Panel (see the last Help volume).
* <Options|Switch Screen Colors> - obvious.
* <File|Quit> exits the program.
Most of other entries are  disabled permanently in
Sub_Cal (they are available in El_Cal only).
   Similarly,  screen  buttons   corresponding  to
features  available  only  in the  full El_Cal are
filled with grey; clicking on them has no effect.
   For more about  El_Cal  (in case  you think you
may need it), see Vol.6 of this help file. 
                  DISPLAY LINES
* Most of  the time  Sub_Cal operates  on  display
  lines (in the LCD-like display at the top).
* Display lines  may be  typed in  or entered with
  the mouse. Mouse entries will be always added at
  the end of display line, regardless  of the text
  cursor position.
* Case is not significant and spaces are ignored.
* Switching between  (up to 3)  lines  -  by using
  [] and [] at the top.   Clicking  on  the line
  number (between the arrows) jumps to Line 1.
* [] enables  auto-scroll:  after RETURN or clic-
  king  on the  display the  current line  will be
  computed and the next one will be displayed.
       EDITING FUNCTIONS, DATA FORMATTING
* [RST] clears all lines and variables.
* [CLR] clears the current line.
* [BSP] removes the last entry from the line.
* The buttons shown as [F][n] or [E][n] at the top
  set the format (fixed or exponential) and number
  of fractional digits in variable display.   This
  does not affect the accuracy of variables, which
  are always stored with 16-digit precision.
Buttons  allowing  to  echo  all  operations  to a
printer, and to perform disk operations,  are dis-
abled in Sub_Cal.
         COMPUTING DISPLAYED EXPRESSIONS
* Click on the main display (or just press RETURN)
  to compute the current line and store the result
  in the Destination Variable shown on the right.
* Clicking on []  and then on a variable from the
  pop-up  menu  will  nominate  a new  Destination
  Variable and execute the current line.
* Keyboard  shortcut  for the above:  type the ex-
  pression, then "=" and variable name, e.g. 2*3=Z
* To choose Destination Variable without executing
  the line: click on the Destination Variable but-
  ton, and then on the variable to choose.
* "" left of display means that the line has been
  computed; next mouse entry will start a new one.
              VARIABLES AND NUMBERS
* Variables  A..Z are  used  to  store data, or as
  components of expressions.
* To modify a variable, double-click on its value.
* To reviev or restore previous values of a varia-
  ble, single-click on its value field.
* Clicking on a variable value with Shift key down
  will show it with all 16 digits of accuracy.
* t is a dummy variable, used in some macros (e.g.
  plotting). It cannot be used to store data.
* Constants:  Ee (Euler's e = 2.71...)  and Pi are
  treated in expressions the same way as variables
* Numbers may use decimal exponent [E]: 1E6 or E6.
* Zero before fraction is optional: .8 means 0.8 .
                    OPERATORS
* Arithmetic operators:    [+], [-], [*], [/], [^]
  (power) have generally accepted priorities.
* Implied multiplication:   the  "*"  sign can  be
  omitted between two variables or between a value
  and variable, e.g. 2A or 6.6PiXY. Implied multi-
  plication has the same priority as "^" (highest)
* Operators  of equal priority are  executed  from
  left  to  right, except for "^" and implied mul-
  tiplication,  e.g.  A^B^CD  ð  A^(B^(C*D)),  but
  2Pi^3A ð 2*(Pi^(3*A)).
* Parentheses () can be nested to any depth;  mis-
  sing ones  at the beginning  and at the end will
  be added, e.g. 5+2)*(8-3  is legal and gives 35.
               FUNCTIONS - GENERAL
* Most of the functions accept a  single argument.
  If  this  argument is  a variable, a value, or a
  product using  implied  multiplication,  then it
  does  not  need  to be enclosed  in parentheses,
  e.g. SIN A or LOG 2Pi, but COS(Pi/3).
* ATN2  and the  statistical functions  accept two
  or three arguments,  which need  to be separated
  with commas, e.g. IPSNE(t+.2,2A,B-A).
* Function evaluation has the same priority as po-
  wer and implied multiplication.  This means that
  EXP A^2 ð EXP(A^2) but  EXP 2*A ð (EXP 2)*A.
* The [][] buttons switch between three Function
  Panels: Standard, Statistical and User-Defined.
             STANDARD MATH FUNCTIONS
* SIN, COS, TAN, COT may be used with [ARC] and/or
  [HYP] switches, e.g. [ARC][HYP][COT] gives ACOTH
* The [ARC] switch has to be  re-entered  for each
  function, while [HYP] will stay on until reset.
* ATN2(Y,X) computes arctan(y/x) in (0,2Pi)
* The  [Rad]/[Deg]  button sets  the angular mode,
  valid at the computing (not entry!) time.
* LN and EXP  - with base e, 10 or 2 will give LN,
  LOG or LG2 and EXP, TEN and TWO (base to...).
  Choosing the base will  change appropriately the
  text on [LN] and [EXP] buttons.
* ABS, INV - absolute value and reciprocal (1/x).
* INT, FRA - integer and fractional part.
       STATISTICAL DISTRIBUTION FUNCTIONS
Prefixes F, P, Q and A denote the function type:
* F - distribution density
* P - left  probability integral, Prob(X<x)
* Q - right probability integral, Prob(Xòx)
* A - central integral, Prob(abs(X-m)<abs(x-m))
For discrete  cases  "density"  should be replaced
with "probability" and "integral" - with "sum".
X stands here for the random variate, x - for fun-
ction argument and m - for distributon mean value.
* I  preceding  P, Q or A  means  "inverse",  e.g.
  IPGAU(t) returns x for which PGAU(x) = t.
             SUPPORTED DISTRIBUTIONS 
   Sub_Cal supports only  the Gaussian (or Normal)
distribution. To access seven other distributions,
you need the full version of El_Cal.

   The [GAU]  button will  enter one  of the seven
possible functions for the Gaussian  distribution,
depending on the status of buttons  [F], [P], [Q],
[A] and [I] described in the previous page.
   These functions accept  three  parameters: x, m
and  s,  where  m  and  s  are mean  and  standard
deviation of the distribution, respectively.
         RANDOM NUMBERS, EULER FUNCTIONS
   A pseudorandom generator function is available:

* XGAU(m,s) - from Normal distribution (m,s).

(El_Cal supports three more distributions here).
The [S] button reseeds the generator.

Natural logarithm  of the  Euler's  Gamma  is also
available LGM(x) - natural logarithm of Gamma(x).

(Again, five more related functions are accessible
in El_Cal).

      USER-DEFINED AND CONDITIONAL FUNCTIONS
DF1..DF2 (or just DFx) are user-defined functions:
* [DEF][DFx]  defines the current  line as a func-
  tion with "t" as dummy argument.
* [SHOW][DFx]  recalls a defined  function  to the
  display (e.g. for modification).
* [CLR][DFx] un-defines a function.
* One DFx function can call another,  preceding it
  on the list, e.g. DF2 can call DF1.
IFN, IFZ and IFP  are conditional functions (stan-
ding for "if negative", "if zero", "if positive"):
* IFx(x1,x2,x3) will return x2 if x1 has the requ-
  ired sign, and x3 otherwise. This means that one
  of the (x2,x3) is not being evaluated at all.
          CONSTANTS AND UNIT CONVERSION
 Clicking on [CONST] allows to store a constant in
one of the Sub_Cal variables:
* The button next to "Store" selects the constant,
  one next to "in" chooses the variable.
* Some constants  allow for  a choice of units; in
  such cases a "Converted to" button will appear.
The [UNITS] button calls the unit conversions:
* The  "Convert" button selects the physical quan-
  tity to convert, "From" and "To" select units.
* To convert a variable value, click on the middle
  -right button; the top-right one will prompt for
  a value, and the bottom-right button selects the
  variable to store the result.
       MACROS:  ZERO, INTEGRAL, dF/dt, SUM
 Macros apply to the current line treated as F(t).
The result is sent to the Destination Variable.
* [ZERO]  finds a (single) zero of  F(t)  within a
  given interval (bisection method is used)
* [INTGR]  computes  integral of F(t) over a given
  interval with given accuracy (Romberg algorithm)
* [dF/dt]  computes  dF(t)/dt  at  given  t  value
  (quadratic approximation with given finite step)
* [SUM] computes a sum of F(t) for given range and
  step in t.
When  the program  asks for required macro parame-
ters, only numbers or  variable  names  (including
Pi and Ee) can be entered - no expressions.
              FUNCTION OPTIMIZATION
   The  [OPTIM]  button on the  Macro Panel allows
for finding an extremum of the current line, which
is then  treated as  a function of variables  from
the A..Z range.
  Up to 3 variables can be selected  as arguments;
the function  value will be returned in the Desti-
nation Variable.
  The algorithm, of course,  may end up in a local
extremum  (or a region  with  a very low  function
gradient), so proper care should be excercised.
  Wrong choice of the initial approximation (or of
the function itself)  may lead to a false solution
or to an arithmetic error.
                POLYNOMIAL ROOTS
[ROOTS] calls the Root Panel,  from where roots of
polynomes up to the second degree can be found:
* The degree is chosen by clicking  on the buttons
  [1]..[2]. The equation is then displayed below.
* [COMP] solves the equation, with the contents of
  variables A..C as parameters (with non-zero A!).
  Depending on the status of these variables, some
  degree choices will sometimes be disabled.
* Real roots will  be shown in  the Variable Panel
  as u1..u2, and the components of complex conju-
  gate root pairs - as Re and Im.
The polynomial  functions  as defined above can be
plotted by clicking on [PLOT] in the Root Panel.
           NON-LINEAR EQUATION SYSTEMS
  [EQUAT] will display the Equation Panel. Systems
of up to  3 equations F(A..C)=0 can be solved from
here, with expression lines serving for F() selec-
ted with use of the [1]..[3] buttons.
  Clicking on [SOLV] will show a dialog asking for
selection of unknown variables.  Their number must
be equal to the number of equations. The variables
should contain reasonable initial guesstimates.
  The used Newton-Raphson method has been modified
to accept less accurate initial guesses. If no so-
lution is found, an alert will be displayed.


                    Reserved
                FUNCTION PLOTTING
Click on [PLOTS] to go to the Plotting Panel:
* [PLOT] draws selected  lines as functions  of t.
* Sub_Cal will ask for t- and y-limits, log or lin
  scale. [Find] finds y-limits for a given t-range
  and [Box] uses a previously defined box.
* Points for which  a function cannot  be computed
  will be just ignored.
* Pressing any key suspends the plotting.
* Click in the plot area for coordinate readout.
* Drag a rubberband to define a box for next plot,
  accessible from the Plot Limit Dialog.
           PLOT BUFFERING AND OVERLAYS
If the plot buffer is active, a plot can be stored
there for a later recall. Leaving a plot by press-
ing RETURN stores it; pressing UNDO bypasses buff-
ering; clicking the mouse button offers a choice.
  To recall a buffered plot, click on [SHOW].
  The [OVER] button switch,  when selected, causes
any following  plot to be drawn on  the top of the
buffered one. In this case, the plot range will be
the same as for the plot already in the buffer; no
plot limit dialog will appear. De-select [OVER] to
draw a plot on an empty slate, with new limits.
  Exception:  histograms (see)  cannot be overlaid
on buffered plots (but can still be buffered).
        DIFFERENTIAL EQUATIONS - GENERAL
Sub_Cal can solve ODE systems of the form
 dy1/dt = F1(t,y1,yN), ... , dyN/dt = FN(t,y1,yN)
where N may range from 1 to 3.  The equations have
to be defined by Sub_Cal Display Lines:
* Sub_Cal variable t is used for t above;
* Variables A..C are used for y1..yN;
* For each line its  Destination Variable reflects
  the y whose dy/dt this line computes.
Black buttons  in the  Differential Equation Panel
(invoked by [DIFF]) denote Display Lines  defining
the ODE system.  Each of them has to have a diffe-
rent  Destination Variable.  Sub_Cal variables not
used in this way will be treated as constants.
     DIFFERENTIAL EQUATIONS: SINGLE SOLUTION
To solve an ODE system for a  single value of t:
* Enter the equations  as described above,  select
  the appropriate line buttons (make sure no buton
  is outlined) in the Differental Equation Panel.
* Make sure that the initial y-values are stored
  in corresponding variables A..C;
* Click on [INTEG].
* Answer the prompt for initial and final t-values
  and for the integration accuracy in y.
Pressing any key will suspend the computation with
an option to abort.
  The resulting  y-values will be  shown  in their
respective variable fields.
        DIFFERENTIAL EQUATIONS: PLOTTING
The ODE system can also be solved over an interval
with any and all of the solutions plotted.
* Functions to plot are identified by outlining of
  their buttons  (click on a selected line  button
  to  outline it).
* A prompt will ask for the starting t-value which
  may be inside or outside of the plot range.
* A plot range dialog will ask for the ranges in t
  and y and for scales (log or lin).
Plotting can be suspended by pressing any key. The
y-values at plot limits will be displayed in their
respective variables.
  See also "Plot Buffering and Overlays".
        STATISTICAL OPERATIONS - GENERAL
* Available modes are  X, XY, WXY (with weights W)
  and DXY (with Y-errors D).   Clicking on [CLEAR]
  or  changing  the mode  (button at  bottom left)
  clears the data buffer.  The current and maximum
  number of data points are shown on the right.
* The data buffer can hold up to  36 points in the
  X mode, up to 18 in the XY mode and up  to 12 in
  the WXY and DXY modes.
(In El_Cal  number of data points  is limited only
by available memory).
[EDIT]  brings up the Data Window,  where the data
can be viewed and edited.  At its top  the current
and maximum number of data points are shown.
           DATA BUFFER MANIPULATION - I
   Clicking  inside the Data Window selects a data
point and presents you with the following options:
* <Edit> - to modify the selected data point,
* <Insert > or <Insert > - inserts  a new  point
  before or after the selected one,
* <Move >, <Move >, <Move >, <Move > - moves
  the selected data point up or down  by one posi-
  tion or all the way, respectively;
* <Delete> - deletes the point from the buffer.
  To add a new data point to the buffer,  click on
the last data point (or in the empty space below).
  Double-clicking on  a value  in the  Data Window
allows for modifying just that value.
           DATA BUFFER MANIPULATION - II
  The window scroll bar  has keyboard equivalents:
 and  (page),  and  (line), Clr/Home (to top).
  To exit  the  window,  click  on the  closer box
(top-left) or press the Esc key.
  Clicking on the top-right box in the Data Window
presents a menu for global operations:
- <Sort by X>,  <Sort by Y> - in increasing order;
- <Flip XY> - swap the X- and Y-columns;
- <XF()> etc.  fill a column  with values  of F()
  from the Display Line. X,Y,D and W are interpre-
  ted in F() as data values (if a column exists in
  the current mode), and t - as the point index.
- <Undelete> restores the last deleted data point.
       STATISTICAL OPERATIONS IN THE X-MODE
* [HIST] - plots a histogram of the data; you will
  be asked for the range and bin number (max.10).
* [PARAM] - as above, but mean and stand.deviation
  are shown  as m and s,  and the error of m - for
  the confidence level set with the [()] button.
* [FIT]  fits data with  a normalized distribution
  defined by the current line as F(t|A..C), a fun-
  ction of t, with parameters from the A..C range.
* [TEST] compares the data to the  distribution as
  above;  the test statistics  is the same as that
  optimized in fitting (see next page).
Plots  created  in statistical  operations  can be
buffered as described in "Plot Buffering".
         DISTRIBUTION FITTING AND TESTING
  The distribution-fitting mode is permanently set
to a chi-square fit.  Only bins  in the plot range
are used; those with <6 points will be merged.
  (El_Cal has also maximum likelihood fit mode).
  The  Destination Variable  will  then  store the
chi-square value.
  The parameter  variables  are  used  as function
parameters (test) or as initial "reasonable guess"
values to be optimized (fit).
 STATISTICAL OPERATIONS IN XY, WXY AND DXY MODES
* [SCATT] draws a scatter-plot of data points;
* [REGR] - as above,  with  linear  or  polynomial
  regression. First use the degree button, [n], to
  set  the degree (1 or 2).    The  sum of squared
  deviations  from  line  will  be  returned  as s
  (weighted in WXY and DXY modes).
For degree=1,  the linear regression  analysis will
include  the correlation  coefficient, r,  and mean
square errors  of slope and  intercept,  d1 and d0,
respectively.
* [FIT] and [TEST] - see the next page.
          MULTI-PARAMETER CURVE FITTING
[FIT] fits the XY, WXY or DXY data with  F(t|A..C)
defined by the current line (t as argument,A..C as
optimized parameters). 
  The  fitting  algorithm  minimizes  the  sum  of
squared deviations   (El_Cal can also minimize the
sum of absolute values).
  Parameters should  be initialized  to reasonable
values.  Sum of squared  deviations from line will
be  stored in  the Destination Variable  (weighted
in DXY and WXY modes).
  [TEST] will just compare  the data sequence with
F(t|A..C) computed for the initial values of A..C,
setting the Destination Variable as above.
      DATA OBJECTS IN LINEAR ALGEBRA PANEL
At any moment some of the buttons are disabled, to
make illegal command sequences impossible.
* To see a data object, double-click on its button
  [M1]..[S3]. An array form will be displayed with
  all the object's components visible at once.
* To modify a component, click on it (double click
  will also clear the input field).
* Clicking on  [PUT] will send the displayed value
  to the selected Sub_Cal variable A..Z, on [GET] -
  fetch a value from the variable to the display.
* The whole object will not be modified  until the
  [Set] button is pressed to exit the object form.
       SIMPLE VECTOR AND MATRIX OPERATIONS
  To use  an object  in  a command,  click  on its
button. The following operations are available:
- Assignment, [], e.g. M1  M3 (store M1 in M3);
- Addiction and subtraction:  [+] and [-];
- Scalar (inner) product, [.]:   V.V  S
- Product, [*], for various operands and results:
  S*S  S   S*V  V   V*S  V   S*M  M   M*S  M
  V*V  M   V*M  V   M*V  V   M*M  M
It is clear from the context, whether the vectors
are  of row  or column nature.
  Additionally,  [*]  can be  used to compute the
cross-product of vectors size three:  V*V  V.
              MORE MATRIX OPERATIONS
- [DET] for determinant:   Det M  S
- [TRN] for transposition: Trn M  M
- [INV] for inversion:     Inv M  M
- [EQU] solves a system of linear equations:
  M Equ V  V,  where  M  is the left side matrix
  and the first V - the right side vector.
A command  consists  of one  or two  arguments, an
operator and destination object, e.g. V1*M1  V3.
It will be executed only  after  [OK]  is pressed.
Usually [] is entered by the program itself.
          OTHER LINEAR ALGEBRA OPTIONS
Other operations in the Linear Algebra Panel are:
- [SIZE] sets the matrix/vector size to 2..4;
- [AUTO] enables auto-scroll in data object entry;
- [EXP]  toggles  on/off the  floating point  data
  display format;
(El_Cal, in addition to setting the maximum object
size to 10,  allows also for  a variety of printer
and disk operations, not available here.)
                  ABOUT EL_CAL
  Sub_Cal is  a limited  subset  of El_Cal, a more
powerful  mathematical  toolbox,   available  from
Debonair Software. If you find Sub_Cal useful, the
chances are one day you will need the "real thing"
- and the buttons disabled  permanently in Sub_Cal
should give you some  information  about the extra
features and capabilities available in El_Cal.
  More about the differences between both programs
can be found in the accompanying SUB_CAL.DOC file.
  In case of any questions or doubts, do not hesi-
tate to contact us (see the next page).
  If you do  not need El_Cal,  we still  hope  you
will like and enjoy Sub_Cal.
                DEBONAIR SOFTWARE

EL_CAL 2.2 sells for $63 and is distributed by
   
         Debonair Software
         P.O.Box 521166
         Salt Lake City, UT 84152-1166.
         
[Checks or money orders; outside continental US
please add $5 extra.]

  Technical  correspondence  can be also forwarded
electronically directly to the author: 
         CompuServe: 70611,2552
         GEnie:      J.WROTNIAK

