4 6 14 50 V.1.14

                *****************
                **   SUB_CAL   **
                *****************

                   A subset of
         EL_CAL: The Elementary Calculator
           ½ 1989 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.
           DISPLAY LINES, GREY BUTTONS
* 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 cur-
  sor position.
* Case is not significant and spaces are ignored.
* Switching between (up to 4) lines - by using
  [] and [] at the top.   Clicking  on  the line
  number (between the arrows) jumps to Line 1.
NOTE: Screen  buttons   corresponding  to features
available  only in the full El_Cal are filled with
grey; clicking on them has no effect.
       EDITING FUNCTIONS, DATA FORMATTING
* [RST] clears all lines and variables.
* [CLR] clears the current line.
* [BSP] removes the last entry from line.
* [TAB] sets  the  accuracy  of  variable display,
  e.g. [TAB][6]  or [TAB][E][3].  Maximum possible
  accuracy is set by [TAB][.] or [TAB][E][.]. This
  does not affect the accuracy of variables, which
  are always stored with 16-digit precision.
         COMPUTING DISPLAYED EXPRESSIONS
* Click on the main display (or just press RETURN)
  to compute  the displayed line and store the re-
  sult in the "destination variable" on the right.
* Clicking on []  and then on a variable from the
  Variable Panel  will nominate  a new destination
  variable and execute the line.
* To choose destination variable without executing
  the line: click on the destination variable but-
  ton, and then on the variable to choose.
* Keyboard  shortcut  for the above:  type the ex-
  pression, then "=" and variable name, e.g. 2*3=Z
* "" left of  display  means,  that  the line was
  computed; next mouse entry will start a new one.
              VARIABLES AND NUMBERS
* Variables  A..Z  may be used to store data,or as
  components of expressions.
* Direct entry into a variable is done by clicking
  on its value field and then typing the value in.
* 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 .
Some  macros may  modify displayed variable names.
The original  names will be  restored as soon as a
given variable is used again.
                     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)),  and
  2Pi^3A ð 2*(Pi^(3*A)).
* ()  may be nested to any depth;  missing 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.
* []  switches  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  switch sets the angular mode valid
  at the computing (not entry!) time.
* LOG 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
  [LOG] and [EXP] buttons.
* ABS, RCP - absolute value and reciprocal (1/x).
* INT, FRA - integer and fractional part.
        STATISTICAL DISTRIBUTION FUNCTIONS
   These are accessible from the  Statistical Fun-
ction Panel (to get there, click on []).
   Prefixes F, P, Q and A designate function type,
suggested by the button icons:
* F - distribution density
* P - left  probability integral:    Prob(X<x)
* Q - right probability integral:    Prob(Xòx)
* A - central probability integral:  Prob(-x<X<x),
  where X is random variate, x - function argument
Only Gaussian (Normal) and  Beta distributions are
enabled in Sub_Cal: GAU and BET, respectively.
   The Euler Gamma  function (x>0)  and  factorial
(use [] to switch) are located at the bottom of
this panel.
           MACROS:  ZERO, INTEGRAL, dF/dt
   Macros are applied  to the currently  displayed
expression treated as F(t).  The result is sent to
the current destination variable.
* [ZERO] - find a (single) zero of  F(t)  within a
  given interval (bisection method is used)
* [INTEGRAL] - compute integral of F(t) over a gi-
  ven interval (Romberg algorithm)
* [dF/dt] - compute  dF(t)/dt  at  given  t  value
  (quadratic approximation with given finite step)
* The program will ask for  macro parameters (e.g.
  limits  and accuracy in ZERO);  numbers or vari-
  able names can be entered here (also Pi and Ee).
* [OPTIM] - see under "Optimization".
                  FUNCTION PLOTTING
Click on [PLOTS] to go to the Plotting Panel:
* [PLOT] draws the selected lines as functions  of
  the dummy t. (A..Z can be used as constants).
* Sub_Cal asks for the x- and y-limits.
  [FIND] computes the latter for a given x-range.
* Points for which the function cannot be computed
  will be just ignored.
* Pressing any key will suspend the plotting.
* Click in the plot area for coordinate readout.
[ Full-screen plotting mode is available  from the
menu bar in El_Cal,  with  a possibility of saving
screens as disk files in the Degas format. ]
              USER-DEFINED FUNCTIONS
   Two  functions,  DF1..DF2, can  be defined from
the Def Panel (use [] to get there).
* Clicking on  [DEF]  and then on one of the [DF?]
  buttons will enter the current  line  as defined
  function, with "t" as dummy argument.
* [SHOW][DF?] will recall selected function to the
  display (e.g. for modification).
* [CLR][DF?] will erase the function selected.
* Clicking on any other than a [DF?]  button after
  [DEF], [CLR] or [SHOW] will have no effect.
* One user-defined function can call another one,
  preceding it on the list,  e.g. DF2 can call DF1
  but not vice versa.
                  POLYNOMIAL ROOTS
  [ROOTS]  will bring us into the Root Panel. From
here linear  or quadratic  equations can be solved
(real roots only!):
* Clicking  on  the  degree selector,  [1] or [2],
  will  choose the equation  degree.  The equation
  is then displayed immediately below.
* [COMP] solves the equation with parameters  sto-
  red beforehand in  A, B, and C, depending on the
  degree.
* Depending on the status of these variables, some
  choices of polynome degree can be disabled.
* Results  are  displayed  in the  Variable Panel,
  starting from W on.
         STATISTICAL OPERATIONS - GENERAL
   Two panels are devoted to statistical data pro-
cessing:
* The Data Panel (click on [DATA] to get there),
* The Stat Panel (click on [STAT]).
   Direct  transfer  between  these two  panels is
also possible.
   At any moment Sub_Cal is in one of three stati-
stical modes: X, Y or XY.  Each of  the modes  has
its  own  data  buffer.   The sizes  of all  three
buffers are equal (Sub_Cal sets them to 25).
              STATISTICAL DATA ENTRY
   The data can be entered into the current buffer
(indicated by Stat Mode selector) in two ways:
* [X], [Y] or [XY]: enter data from X and/or  Y
  variable into appropriate stat buffers.
* [ENTR]  allows for quick typing in  data points,
  without  going through the Variable Panel.  When
  in the type-in mode,  use  RETURN  to  terminate
  numbers;  a RETURN with empty data field(s) will
  bring you back to the normal operation.
(El_Cal  allows  also to use  disk files  for data
storage.)
          STATISTICAL BUFFER MANIPULATION
* [], [], [] and []  are used  for  browsing
  through  the data  sequence  (double arrows jump
  to the  beginning  or to the end).  The data are
  displayed in the X and/or Y variable fields.
* [UNDO] - will try to delete  the currently  dis-
  played X and/or Y from the current buffer  (e.g.
  during the browsing process).
* [CLR] clears the current buffer.
* [FLIP] will exchange the X data with Y in the XY
  buffer.
* [SPLIT] will copy the data  from XY  buffer into
  X and Y buffers,  respectively  (overwriting the
  old contents).
           SIMPLE STATISTICAL OPERATIONS
* [HIST] plots a histogram of X or Y buffer.
* [G-FIT] - as above, with a Gaussian fit.
* [SCAT] draws a scatter-plot of the XY buffer.
* [REGR] - as above, with linear regression.
* [1] to [3] will compute polynomial least-squares
  fit to the data, depending on mode:
  - Mode XY - Y vs. X, as stored in the buffer;
  - Mode X or Y - the variable in question, versus
    uniformly spaced t values.
  The mean square (no root!)  deviation from  line
will be returned as s.
  The program will ask for plot parameters; [FIND]
and  [ROUND] may be used to compute them.
          MULTI-PARAMETER CURVE FITTING
  [POINTS]  in the  Stat Panel fits the XY, X or Y
data sequence with a function  defined by the cur-
rent line  (t as argument, A and/or B as estimated
function  parameters).   In X  and Y  modes  equal
spacing is assumed. Two fit modes are possible:
* [SQ] - minimizing sum of squared deviations,
* [ABS] - minimizing sum of absolute deviations.
  The parameter variables should be initialized to
some reasonable  values  (a good choice will speed
up the process).   Mean square  or  mean  absolute
deviation is returned in the destination variable.
  Pressing any key will  suspend the fitting, dis-
playing the current result and allowing to stop.
              DISTRIBUTION FITTING
  [DISTR]  fits the X- or Y-data with a normalized
distribution defined by the current line as a fun-
ction of t, with A and/or B as parameters:
* [CHI] - a chi-square fit.   Only the bins within
  the plot range will be accounted for, and bins
  with less than 6 data points will be combined.
(El_Cal allows also  for a maximum  likelihood fit
and for up to 9 fitted parameters.)
  The destination  variable will  contain the chi-
square value per bin.
  Initial "reasonable guess"  values  are expected
in parameter variables.
              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..B range.
  Up to 2 variables (9 in El_Cal)  can be selected
as arguments; the function value  will be returned
in the destination 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.
                LINEAR ALGEBRA PANEL
  The  Linear Algebra  Panel consists of:
* Display - to  show  the  entered commands;
* Buttons to  execute or cancel the shown command,
  to get help, and to exit to the menu; 
* Object  buttons for accessing matrix, vector and
  scalar data objects  (two of each kind);  only
  square matrices are supported.    Sub_Cal limits
  the matrix size to 3*3 (El_Cal: up to 10*10).
* Operator Panel,  grouping the available  operat-
  ions  on data objects.
Usually,  at a given moment  only some of the but-
tons  are  enabled, so  that  entering  of illegal 
command sequences is impossible.
                ENTERING DATA OBJECTS
* To enter or to view  a data object, double-click
  on its button: [M1]..[S2]. A tabular array  form
  will be displayed with all object components vi-
  sible at once.
* To modify an object component, click on it:  the
  single  entry dialog will be shown (double click
  also clears the input field).
* The old value  will not be  changed  until a new
  one is typed in (or fetched, see below) and [OK]
  pressed.
* Clicking on  [PUT] will send the displayed value
  to the selected  Sub_Cal variable A..Z, on [GET]
  - fetch a value from a variable to the display.

        SIMPLE VECTOR AND MATRIX OPERATIONS
  To use a data object in a command,  single-click
on its button. The following operations are avail-
able from the Operator Panel:
- Assignment, [], e.g. M1  M2 (store M1 in M2);
- Addiction and subtraction:  [+] and [-], respec-
  tively, for both objects of the same kind.
- Product, [*], for various  types of operands and
  results. Using the obvious notation, these are:
  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 vec-
  tors are of row or column nature; see any book).
- Scalar (inner) product, [.]:   V.V  S
              MORE MATRIX OPERATIONS
- [DET] for determinant:      Det M  S
- [TRN] for transposition:    Trn M  M
- [INV] for inversion:        Inv M  M
- [EQU] for solving  a set  of  linear  equations:
  M1 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  V2.
It will be executed only  after  [OK]  is pressed.
Usually [] is entered by the program itself.
  [SIZE] allows to set  matrix/vector size  (2..3,
El_Cal allows up to 10),  and [EXP] toggles on/off
the  floating point  data display format;
                 DEBONAIR SOFTWARE
  Sub_Cal can be distributed freely as long as all
the accompanying files remain intact.
  The full version of El_Cal can be ordered from
         Debonair Software
         P.O.Box 521166
         Salt Lake City, UT 84152-1166
  The price of $44 includes user manual,  shipping
and one update. UT residents add sales tax. Outsi-
de continental US please add $5 (US) for shipping.
  Technical questions and other correspondence can
be also forwarded electronically to the author: 
         CompuServe: 70611,2552
         GEnie:      J.WROTNIAK

