home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS - Coast to Coast
/
simteldosarchivecoasttocoast2.iso
/
calculat
/
rsc310.zip
/
RSC.DOC
next >
Wrap
Text File
|
1993-06-09
|
38KB
|
971 lines
***********************************************
*********** RSC 3.10 ************
**************** Resident Scientific Calculator ****************
**************** ****************
**************** Copyright 1990,1993 ****************
**************** Sergey Shmakov & Igor Evsikov ****************
**************** ****************
*********** March 1993 ************
***********************************************
CONTENTS
--------
0. News
0.1 New possibility
0.2 Bug fix list
1. Introduction
2. RSC Features
3. Installation
4. Getting started RSC. Parameters (loading option)
5. Expressions
6. Mouse support
7. Numerical Bases and Notations
8. Arithmetic operations
9. Boolean operations
10.Functions
10.1 Trigonometric Functions
10.2 Exponential, Logarithmic and Square root Functions
10.3 Special functions
10.4 Hyperbolic and Inverse Hyperbolic Functions
10.5 Numerical Integration
10.6 Statistical functions
10.7 Solving Equations
10.8 Absolute extrema searching
11.Constants
12.Other keys
13.Edit keys
14.Error messages
15.Disclaimer
16.Registration
17.Acknowledgments
0. News
----
0.1 New possibility
---------------
Version 3.1
1) Mouse support has been added.
2) The unary minus sign is now treated correctly.
3) Functions' precision have been added to DOC.
4) Gaussian quadrature uses now weights and nodes with the
accuracy of 25 decimal digits.
5) Precision of the Erf- and Gamma- functions has been
improved.
6) Constants' precision has been raised.
7) Constants "pi" and "e" now displayed by their name.
8) The termination condition of solve() function
has been improved.
9) Absolute extrema searching has added
10) Known bugs have been fixed.
0.2 Bug fix list
------------
.________________________________________________________________.
|Expression |Version |Comment |
|------------------------+---------------------+-----------------|
|arctan(X) |3.00 |operated properly|
| | |in radian mode |
| | |only |
|------------------------+---------------------+-----------------|
|for J to K step m (?) |3.00 |did not operate |
`----------------------------------------------------------------'
1. Introduction
------------
Resident Scientific Calculator (RSC) is intended for scientific
calculations and can be used on any IBM-compatible PC equipped
with EGA/VGA/CGA or Hercules card and hard disc, running under
DOS 3.3+. The program uses about 160 Kb of disc space or EMS/XMS
(if present) for swapping. The resident part of the program is
about 6-7Kb.
RSC can handle expressions up to 255 symbols in length.Expressions
are written in a form similar to the customary mathematical one.
Expressions such as the following can be computed:
cos(Z)+(?+tg(ln(Y)))/exp(sin(pi/10))-integral(1+cos(X))
2. RSC Features
------------
- Mouse support
- Line editor with expressions recall (last 10 expression)
- Hot key Function prompt
- Debug: Error position fixed
- Online help with F1
- Decimal, Hexadecimal and Binary bases
- Fixed point, Scientific, Engineering and Sexagesimal *)
- Radian and Degree modes for trigonometric functions
- Precision: 7-12 significant digits.
- Range: √(3.4E-4392 to 1.1E+4392)
- Trigonometric functions
- Hyperbolic functions
- Numerical Integration
- Solving of equations
- Absolute extrema searching
- Arithmetic operations
- Logical operations
- Special functions (Gamma, Bessels, Si, Ci, erf)
- Statistic functions (Average, Standard deviation)
- Common functions such as exp, ln, sqrt, etc.
- FOR-NEXT-type loop
- 10 user defined variables
- 10 user defined constants
- Hard Copy
- Stack for expressions
- Stack for results (last 100)
- Variables, Expressions and Results map
-------------------------------------
*)
(i.e., result in the form hours:minutes:seconds or
degrees:minutes:seconds) notations
-------------------------------------
The basic control keys are shown on the RSC panel, its layout is
presented below(Upper-ASCII characters are replaced by as similar
as possible Low-ASCII ones for printing)
.--------------------------- ver 3.10 -.
|.- BASE -------notation------angmode-.|
|| Result Error messages ||
|| <-------Expression region--------->||
|`-[■]-[■]-[■]------------------------'|
| help-(F1) map-(F2) clr-(F3) clm-(F4) |
|----- function --- mode --- Display --|
| sn-S as-^S Sf- $|dec?F5|not-F10 ()lr |
| cn-O ac-^O Γ - !|hex?F6|*/^+-&|\%.?.:|
| tg-T at-^T sq- Q|bin?F7|0123456789=b |
| lg-G 10-^G 1/-^X|rad?F8|ESC, Unload |
| ln-L ex-^L cn-^C|deg?F9|paste(R)esult|
|----- move ---------------------------|
|<ctrl->,<>,v,^ TAB-lastr, pusH/Pop str|
`--------------------------------------'
Hold down the <Shift> key to see a second screen of information
.--------------------------- ver 3.10 -.
|.- BASE -------notation------angmode-.|
|| Result Error messages ||
|| <-------Expression region--------->||
|`-[■]-[■]-[■]------------------------'|
| help-(F1) map-(F2) clr-(F3) clm-(F4) |
|----- function --- mode --- Display --|
| sh-S hs-^S ef- $|dec F5|not-F10 ()lr |
| ch-O hc-^O Si- !|hex F6|*/^+-&|\%.?.:|
| th-T ht-^T Ci- Q|bin F7|XYZVWKIJKLM=d|
| Jn-G Yn-^G n!-^X|rad F8|ESC, Unload |
| In-L Kn-^L cl-^C|deg F9|paste(R)esult|
|----- move ---------------------------|
|<ctrl->,<>,v,^ TAB-lastr, pusH/Pop str|
`--------------------------------------'
Hold down the <Alt> key to see a third screen of information
.--------------------------- ver 3.10 -.
|.- BASE -------notation------angmode-.|
|| Result Error messages ||
|| <-------Expression region--------->||
|`-[■]-[■]-[■]------------------------'|
| help-(F1) map-(F2) clr-(F3) clm-(F4) |
|----------- misc Function ------------|
| Average -(Alt-A) For cycle-(ALt-F) |
| St.Dev. -(Alt-D) sEtup -(Alt-E) |
| + digit -(Alt-+) Popresult-(Alt-P) |
| - digit -(Alt--) savesTack-(Alt-T) |
| History -(Alt-H) viewstaCk-(Alt-C) |
| set var -(Alt- X,Y,Z,V,W,I,J,K,M,N) |
| (c) CopyRight by I.Evsikov&S.Shmakov |
`--------------------------------------'
The position of the calculator display can be adjusted by the
<up> and <down> arrow keys or by the <Ctrl><left> and<Ctrl><right>
chords. Screen modes 132x25, 132x43, 80x43(50) (as, for example,
with Ultravision installed) are also supported.
3. Installation
------------
The archive RSC310.ZIP contains:
RSC.EXE - Version of the calculator
RSC.DOC - This file.
RSC.CFG - default config file (autocreate)
RSC.REG - Registration File.
Copy the files RSC.EXE to a directory defined in the PATH
statement of your AUTOEXEC.BAT file (like your DOS or TOOLS
directory). For changing colors and/or hot-key of the RSC use
<Alt><E> keys.
4. Getting started RSC
-------------------
To begin RSC, type the following command at the MS-DOS command
prompt:
>RSC
You will see a label:
┌──────────────────────────────┐
│Resident Scientific Calculator│
│ by S.Shmakov & I.Evsikov. │
│ UNREGISTERED COPY │
│To PopUp press < Ctrl-Alt-C >.│
└──────────────────────────────┘
To recall RSC in any programs, editors etc. press the keys <Ctrl>,
<Alt> and <C> simultaneously.
The full syntax of command line to load RSC is:
>RSC [/Spath] [/Fpath] [/Efile] [/Cfile] [/Dfile] [/W] [/N] [-X] [-E]
/Spath ... the swap-file directory. By default, expanded (EMS)
or extended (XMS) memory, or RAM disk are used (if
presented). Otherwise, current directory is used.
/Fpath ... path to RSC.CFG, if the configuration file is not
in the same directory in which the executable file
is situated.
/Efile ... filename containing expressions with which to
initialize the RSC stack.
/Cfile ... filename of a user defined constant file. This file
can contain up to 10 of constants, of the form:
<constant_name>=<value>.
For example:
Pi=3.1415926535919
e=2.7182811828459
/Dfile ... the full path and file name of the HARDCOPY file. To
print the output rather than store it to a file,
use PRN or LPT1.
/W ... DOS window application under WINDOWS 3.1
/N ... not resident version
-M ... do not use mouse, even if it present
-X ... prevents the use extended memory for swapping, even
if extended memory is available.
-E ... prevents the use expanded memory for swapping,
even if expanded memory is available
/? ... mini-help.
5. Expressions
-----------
Expressions appear on the bottom line of the RSC display and can
be edited/corrected during calculation. You can insert the result
of the previous calculation in the current expression (using "?"
key), as well as the values of up to 10 user defined constants.
Result occurs in the top line of the RSC display.
Expressions can make use of the symbols I,J,K; M,N; V,W,X,Y,Z.
(must be upper case) as variables. To assign a value to a
variable, use key chord <Alt>-<key> where "<key>" is one of the
10 valid symbols for variables. If you used an undefined variable
in an expression, you will be prompted during calculation of the
expression to define the variable. The variable, in their turn,
can be defined by another expression.
The last 10 typed expression can be reused by pressing the key
chord <Alt>-<H> (or <Alt>-<F8>) keys. This brings up a menu of
(up to) the last 10 expressions used (simple arithmetic
expressions are not saved); move the light bar to the desired
expression and press <Enter>; the expression will be copied to
the expression line of the RSC display. Besides, up to 10
expressions can be saved/restored to/from the cyclic expression
stack. When RSC is first loaded, the expression stack can be
initialized from the external file. As well, the stack can be
whenever saved to a file. A session can be HARDCOPied (see below
option /D in command line) to printer or an external file. After
some editing, these files can be used as input for another
session.
Examples:
3-5+4.61
(5-arcsin(0.4561))^2.1+sqrt(lg(25))+sin(Y/7)
Ln(2)-solve(3*x^2+2*x-32)
(?+tg(ln(Y)))/exp(sin(1.5/10))-integral(1+cos(X))
6. Mouse support.
--------------
RSC supports Microsoft-compatible mouses. In the case of
another drivers usage cursor position can be set improperly.
Use option -M to ignore mouse even if it is present.
To switch RSC panels with the aid of the mouse click on -[■]-
buttons. Mind the mouse switch of the RSC panels simulates
pressing Shift/Alt keys. Be careful when using the mouse and
keyboard simultaneously.
7. Numerical Bases and Notations
-----------------------------
The range of numbers is approximately 3.4E-4932 to 1.1E+4932
with 19-20 significant digits.
For changing of the base, angular measure and notation use
follow hot keys:
Key Switches
F5 ... switch to decimal format
F6 ... switch to hexadecimal format
F7 ... switch to binary format
F8 ... switch to radians
F9 ... switch to degrees
F10 ... switch notation (fixed point, scientific,
engineering, sexagesimal)
In the binary and hexadecimal format only integer part of the
numbers is displayed.
Calculator supports four notations: fixed point - fix,
scientific - sci, engineering - eng and sexagesimal - sxg (i.e.,
result in the form hours:minutes:seconds or degrees:
minutes:seconds). The current notation mode is displayed in the
center of the RSC display. Any notation can be used for input
independently of the current result mode. If the input and result
notation differ one from another the conversion to the current
result notation will be made.
For example:
.- dec ---------- fix --------- rad -.
| 0.66666666667 |
| 2/3 |
`------------------------------------'
Keystrokes: <2></><3><Enter>
.- dec ---------- sci --------- rad -.
| 6.6666666667E-01 |
| 2/3 |
`------------------------------------'
Keystrokes: <F10>
.- dec ---------- eng --------- rad -.
| 666.66666667E-03 |
| 2/3 |
`------------------------------------'
Keystrokes: <F10>
.- dec ---------- sxg --------- rad -.
| 0:40:0 |
| 2/3 |
`------------------------------------'
Keystrokes: <F10>
The number of displayed digits is controlled by <Alt><->,
<Alt><+> keys.
PS : The maxvalue in sxg notation 2^19. Binary numbers larger
than 2^15-1 not correctly pasted because of the 15 positions
pasted result.
8. Arithmetic operations
---------------------
Key Description
+ ... Addition or unary plus
- ... Subtraction or unary minus
* ... Multiplication
/ ... Division
^ ... Power
% ... Percentage
() .. Prioritize an expression
Example: (16+20*4)%6.5
.- dec ---------- fix --------- rad -.
| 6.24 |
| (16+20*4)%6.5 |
`------------------------------------'
Keystrokes: (16+20*4)%6.5<Enter>
9. Boolean operations
------------------
For Boolean operations, the fractional part of the numbers is
ignored.
Key Description
& ... and
| ... or
\ ... xor
Example: 3+(10 and 7)
.- dec ---------- fix --------- rad -.
| 5.0 |
| 3+10&7 |
`------------------------------------'
Keystrokes: 3+10&7<Enter>
10. Functions
---------
Expressions can contain trig functions, 10^X, exp, A^X, gamma,
integral, statistic functions, hyperbolic functions, integral,
Bessel functions and FOR-NEXT-type loop. To save typing, they
are entered by the corresponding shortcut keys. Trigonometric
functions can accept arguments expressed in radians and degrees;
the angular mode is set by function keys F8 and F9. The current
angular mode is displayed in the right corner of the RSC display.
10.1 Trigonometric Functions
-----------------------
Keys Prompt Function Name
S ... sin() ..... Sine of expression (..)
O ... cos() ..... Cosine of (..)
T ... tn() ...... Tangent of (..)
Ctrl-S ... arcsin() .. Arc sine of (..)
Ctrl-O ... arccos() .. Arc cosine of (..)
Ctrl-T ... arctn() ... Arc tangent of (..)
The trigonometric functions sin, cos ... have precision 12
digits.
Example: sin(pi/2) in Radians
.- dec ---------- sci --------- rad -.
| 1.0E+0 |
| sin(pi/2) |
`------------------------------------'
Keystrokes: <S><Ctrl-P>/2<Ehter>
o
Example: sin(45 30'15") in Degrees
.- dec ---------- sci --------- deg--.
| 7.1330141882E-1 |
| sin(45:30:15) |
`------------------------------------'
Keystrokes: <F9><S><Ctrl-P>/2<Ehter>
10.2 Exponential, Logarithmic and Square root Functions
--------------------------------------------------
Keys Prompt Function Name
Q ... sqrt() .... Positive square root of (..)
G ... lg() ...... Natural (base e) logarithm (..)
L ... ln() ...... Common (base 10) logarithm (..)
Ctrl-G ... 10^() ..... Number 10 raised to the (..)th power
Ctrl-L ... exp() ..... Number e raised to the (..)th power
The functions sqrt, lg ... have precision 12 digits.
Example: exp(1.4)+ln(2)
.- dec ---------- eng --------- rad -.
| 4.748347147E+00 |
| exp(1.4)+ln(2) |
`------------------------------------'
Keystrokes: <Ctrl-L>1.4<Right>+<L>2<Ehter>
10.3 Special functions
-----------------
Keys Prompt Function Name
! ... Γ() ....... Gamma function of (..)
Shift-G ... Jn(,) ..... Bessel function J (..th, ..)
Shift-L ... In(,) ..... Bessel function I (..th, ..)
Shift-Ctrl-G ... Yn(,) ..... Modify Bessel function Y (..th, of ..)
Shift-Ctrl-L ... Kn(,) ..... Modify Bessel function K (..th, of ..)
Shift-F ... erf() ..... Error func associated w/normal distribution
Shift-D ... Si() ...... Integral Sine of (..)
Shift-Q ... Ci() ...... Integral Cosine of (..)
The function Γ has precision 15 digits (│delta│<1.0E-16).
The functions Bessel have precision 7 digits (│delta│<3.0E-7).
The function erf has absolute error value (│epsilon│<1.0E-9).
The functions Si,Ci have absolute error value (│epsilon│<3.0E-7).
Example: 1+J (5.4)
4 .- dec ---------- sci --------- rad -.
| 1.3990575914E+0 |
| 1+Jn(4,5.5) |
`------------------------------------'
Keystrokes: 1+<Shift-G>4<Right>5.4<Ehter>
For calculating The Bessel's function integral representations
were used. The calculation algorithms were tested for all
available Bessel functions in the region 0 <= nu <= 100, 0 <= z
<= 100 using "Handbook of mathematical functions with formulas,
graphs and mathematical tables" Edited by Milton Abramowitz and
Irene A. Stegun, National bureau of standards applied
mathematics series 55, Issued June 1964. The testing results are
shown in the diagram below.
▒ - stands for correct (within 7 significant digits) result,
x - no data,
- - calculation failed.
J (z) Y (z) I (z) K (z)
nu nu nu nu
nu nu nu nu
100x▒▒xx▒xxxx▒▒- 100x▒▒xx▒xxxx▒▒▒ 100x▒▒xx▒xxxx▒▒▒ 100x--xx-xxxx---
50x▒▒xx▒xxxx▒▒- 50x▒▒xx▒xxxx▒▒▒ 50x▒▒xx▒xxxx▒▒▒ 50x--xx-xxxx---
40x▒▒xx▒xxxx▒▒- 40x▒▒xx▒xxxx▒▒▒ 40x▒▒xx▒xxxx▒▒▒ 40x--xx-xxxx▒--
30x▒▒xx▒xxxx▒▒- 30x▒▒xx▒xxxx▒▒▒ 30x▒▒xx▒xxxx▒▒▒ 30x-▒xx▒xxxx▒--
20x▒▒xx▒xxxx▒▒- 20x▒▒xx▒xxxx▒▒▒ 20x▒▒xx▒xxxx▒▒▒ 20x▒▒xx▒xxxx▒▒-
15▒▒▒▒▒▒▒▒▒▒▒▒- 15▒▒▒▒▒▒▒▒▒▒▒▒▒ 15▒▒▒▒▒▒▒▒▒▒▒▒▒ 15▒▒▒▒▒▒▒▒▒▒▒▒-
10▒▒▒▒▒▒▒▒▒▒▒▒▒ 10▒▒▒▒▒▒▒▒▒▒▒▒▒ 10▒▒▒▒▒▒▒▒▒▒▒▒▒ 10▒▒▒▒▒▒▒▒▒▒▒▒-
8▒▒▒▒▒▒▒▒▒▒▒▒▒ 8▒▒▒▒▒▒▒▒▒▒▒▒▒ 8▒▒▒▒▒▒▒▒▒▒▒▒▒ 8▒▒▒▒▒▒▒▒▒▒▒▒-
6▒▒▒▒▒▒▒▒▒▒▒▒▒ 6▒▒▒▒▒▒▒▒▒▒▒▒▒ 6▒▒▒▒▒▒▒▒▒▒▒▒▒ 6▒▒▒▒▒▒▒▒▒▒▒▒-
4▒▒▒▒▒▒▒▒▒▒▒▒▒ 4▒▒▒▒▒▒▒▒▒▒▒▒▒ 4▒▒▒▒▒▒▒▒▒▒▒▒▒ 4▒▒▒▒▒▒▒▒▒▒▒▒-
2▒▒▒▒▒▒▒▒▒▒▒▒▒ 2▒▒▒▒▒▒▒▒▒▒▒▒▒ 2▒▒▒▒▒▒▒▒▒▒▒▒▒ 2▒▒▒▒▒▒▒▒▒▒▒▒-
1▒▒▒▒▒▒▒▒▒▒▒▒▒ 1▒▒▒▒▒▒▒▒▒▒▒▒▒ 1▒▒▒▒▒▒▒▒▒▒▒▒▒ 1▒▒▒▒▒▒▒▒▒▒▒▒-
0▒▒▒▒▒▒▒▒▒▒▒▒▒ 0-▒▒▒▒▒▒▒▒▒▒▒▒ 0▒▒▒▒▒▒▒▒▒▒▒▒▒ 0-▒▒▒▒▒▒▒▒▒▒▒-
1 1 1 1
150 150 150 150
Z 0123456789000 Z 0123456789000 Z 0123456789000 Z 0123456789000
10.4 Hyperbolic and Inverse Hyperbolic Functions
-------------------------------------------
Keys Prompt Function Name
Shift-S ... sinh() ..... Hyperbolic sine of (..)
Shift-O ... cosh() ..... Hyperbolic cosine of (..)
Shift-T ... tanh() ..... Hyperbolic tangent of (..)
Shift-Ctrl-S ... asinh() .... Hyperbolic arc sine of (..)
Shift-Ctrl-O ... acosh() .... Hyperbolic arc cosine of (..)
Shift-Ctrl-T ... atanh() .... Hyperbolic arc tangent of (..)
The functions sinh, cosh ... have precision 12 digits.
Example: sinh(4.6+X) where X=5
.- dec ---------- sci --------- rad -.
| 7.3823907489E+3 |
| sinh(4.6+X) |
`------------------------------------'
Keystrokes: <Shift-S>4.6+x<Alt-X>5<Ehter>
Example: sinh(4.6+X) where X=3
.- dec ---------- sci --------- rad -.
| 9.9909769732E+2 |
| sinh(4.6+X) |
`------------------------------------'
Keystrokes: <Alt-X>3<Ehter>
10.5 Numerical Integration
---------------------
Keys Prompt Function Name
$ ... integral() . Numerical Integration of f(X)
This approximates the value for the definite integral of f(X),
using 10-point Gaussian formula:
10
integral = sum(W * f(X ))
i=1 i i
where W and X are the weights and nodes of the Gauss formula.
i i
This procedure gives accurate results for the polynomial
functions up to the 19-th order.
Upper and lower limits of the integral are defined throw the
<Alt><U> and <Alt><L> keys, respectively. If the limits are not
defined you will be prompted to define them. The variable X is
used as integration variable but its value in previous expression
is retained.
To improve the accuracy of the integral, press <Enter> again
without changing the integrand and limits. This will halve the
integration interval and apply of the algorithm to each interval;
the result is calculated by summation over all subintervals. Each
time your press <Enter> the number of the subintervals is
doubled. Changing of the integrand or/and limits of integration
will restore the evaluation interval to one.
For example, to integrate sin(x)^2 in the limits (0,10):
.- dec ---------- sci --------- rad -.
| Previous result |
| integral(sin(X)^2) |
`------------------------------------'
Keystrokes: $sx<Right>^2
After pressing <Enter> you will be prompted to enter low integral
limit:
.- dec ---------- sci --------- rad -.
| Previous result |
| low=0 |
`------------------------------------'
Keystrokes: 0
After input <Enter> you will be prompted to enter up integral
limit:
.- dec ---------- sci --------- rad -.
| Previous result |
| up=10 |
`------------------------------------'
Keystrokes: 10<Enter>
.- dec ---------- sci --------- rad -.
| 4.771684898E+0 |
| integral(sin(X)^2) |
`------------------------------------'
To improve result simply press <Enter>:
.- dec ---------- sci --------- rad -.
| 4.771763687E+0 |
| integral(sin(X)^2) |
`------------------------------------'
10.6 Statistical functions
---------------------
Keys Prompt Function Name
Alt-A ... x .......... Mean value
Alt-D ... d .......... Standard deviation
Ctrl-X ... random() ... Random number in [0..N]
Random returns r/65536*n, where r is uniform random number in the
interval 0..65535
Example: calculation of the mean value and standard deviation of
1.11, 2.22, 3.33, 4.44:
.- dec ---------- sci --------- rad -.
| Previous result |
| x |
`------------------------------------'
Keystrokes: <Alt><A>
.- dec ---------- sci --------- rad -.
| Previous result |
| x= |
`------------------------------------'
Keystrokes: <Enter>
.- dec ---------- sci --------- rad -.
| 1.11 |
| x= |
`------------------------------------'
Keystrokes: 1.11<Enter>
.- dec ---------- sci --------- rad -.
| 1.665 |
| x= |
`------------------------------------'
Keystrokes: 2.22<Enter>
.- dec ---------- sci --------- rad -.
| 2.22 |
| x= |
`------------------------------------'
Keystrokes: 3.33<Enter>
.- dec ---------- sci --------- rad -.
| 2.775 |
| x= |
`------------------------------------'
Keystrokes: 4.44<Enter><Esc>
<Esc> - end of input data
.- dec ---------- sci --------- rad -.
| 1.433003838E+0 |
| s |
`------------------------------------'
Keystrokes: <Alt><D><Enter>
_
Both x and s can be used in a similar way as variables.
x
_
It should be noted, however, using of x in an expression forces
new procedure of the average value calculation, while <Alt><D>
simply inserts the corresponding standard deviation in the
expression.
10.7 Solving Equations
-----------------
Keys Prompt Function Name
Shift-Ctrl-C ... solve() .... solves an equation of f(X) = 0
This returns a solution of the equation.
The algorithm used in this program for solving equations is the
bisection method. A solution can be found for continuous functions
in the range low <= x <= up, only if f(low) <= 0 <= f(up). If the
equation happens to have several solutions the method give only
one of them. You can get the rest ones by step-by-step narrowing
of the search interval. The solving process is terminated when
abs(f(X)/(f(up)-f(low)) will be less then 1.E-11. If necessary,
one can improve the result by narrowing of the search interval.
Examples:
Keystrokes: 1-<Shift-Ctrl-C><S>x<Right>-0.5
.- dec ---------- sci --------- rad -.
| Previous result |
| 1-solve(sin(X)-0.5) |
`------------------------------------'
Keystrokes: <Enter>0
.- dec ---------- sci --------- rad -.
| Previous result |
| low=0 |
`------------------------------------'
Keystrokes: <Enter><Ctrl-P>/2
.- dec ---------- sci --------- rad -.
| Previous result |
| up=pi/2 |
`------------------------------------'
Keystrokes: <Enter>
.- dec ---------- sci --------- rad -.
| 4.7640122342E-1 |
| 1-solve(sin(X)-0.5) |
`------------------------------------'
As it is implemented one gets frequently the message "Interval Error".
This is because of the fact, that requirements are not met.
The user has to make some effort to meet these requirements.
The adjusting of the interval is a problem, that can be
circumvented. Also the restriction that f(low)*f(up) < 0.
Solving x^x-27=0 is easier done by entering 100 as a wild guess
and then several times .5*(?+27^(1/?)) or this with Alt-F.
Ad hoc, but ? works nice for such simple iterative schemes.
One gets easily the correct solution 3 exactly.
Disregarding for a moment the stopping criterium, the method or
accuracy, paying only attention to the definition.
One could define uniquely the solution of f(x) = 0, where x in (a,b) to
be the smallest x in (a,b), such that f(x) = 0. If there isn't any then
we have an "Interval Error".
Then it is much easier to obtain all solutions of f(x)=0 in some
interval. Also easier to work with, because one needs not to have an up
and low, that has the property f(low)*f(up) < 0.
To do this requires some extra programming. The additional effort to do
it, is something, that is implicit in my proposal below about max().
10.8 Absolute extrema searching.
--------------------------
Keys Prompt Function Name
Shift-Ctrl-X ... ???() ...... Absolute extremum searching of (..)
??? is "min" or "max" depending on chosen extremum type. To
switch between "min" or "max" searching press <Alt-1> or <Alt-2>.
An algorithm by F. Gremmen (University of Nijmegen, Netherlands)
is used. A global extremum can be found for continuous functions
in the range low <= x <= up. If function has too many
(approximately >40) extrema in the interval, the risk of
overlooking an extremum is present. In this case you may press
<Enter> again without changing the function and limits. This
will halve the interval and apply of the algorithm to each
interval; the result is selected between absolute extrema of all
subintervals. Each time your press <Enter> the number of the
subintervals is doubled. Changing of the expression or/and
interval boundaries will restore the search interval to one.
For example max(-X^2+2*X+3) will
return 4 if low = 0 and up = 2 and X will be set to 1. It should
return 0 if low = 3 and up = 4 and X should be set to 3.
11. Constants
---------
Key Description
Ctrl-C ... activate constant menu
Ctrl-P ... constant "pi"
Ctrl-E ... constant "e"
By default You can use 10 constant from constant menu. Constant is
inserted in expression at cursor position.
┌─────── Constants ──────┐
│ 0 me ....... 9.109558E-28 │ - electron mass [g]
│ 1 mp ....... 1.672614E-24 │ - proton mass [g]
│ 2 Euler .... 5.7721566E-01 │ - Euler const
│ 3 GeV*Fm ... 5.0676531698 │ -
│ 4 h/2pi .... 1.0545919E-27 │
│ 5 Compton e. 3.861592E-11 │
│ 6 Compton p. 1.3214409E-13 │
│ 7 Ridberg .. 1.0973731E+05 │
│ 8 Bohr R ... 5.2917715E-09 │
│ 9 Electron R 2.817939E-13 │
│ Your choice :_ │
└─ Exit-Esc ───── CGS ───────┘
To redefine constants You must create a file containing up to 10
of constant's definitions in the form :
<constant_name>=<value>
For example:
Pi=3.14159265359...
e=2.718281182845...
- load RSC with next param:
>RSC /CFileName
- where FileName is Name of File defined constants.
12. Other keys
----------
Key Description
F1 ... summary Help
F2 ... show the variable definitions and
result stack (the last 100 results are
kept on the stack and can be pasted to
the calculator window)
F3 ... clear the RSC display
F4 ... clear the RSC variables
ESC ... hide RSC (i.e. return to DOS, Editor,
Viewer, ...)
U ... Unload RSC (No other resident
programs must have been installed
AFTER RSC)
R ... paste result to cursor position (15 digits max)
TAB ... restore the last expression
H ... pusH expression to the RSC expression
stack
P ... Pop expression from the RSC expression
stack
<Alt><H>
or <Alt><F8> ... activate the history menu
<Alt><C>
or <Alt><F7> ... activate the stack menu
<Alt><T> ... save stack of expressions
13. Edit keys
---------
All expression editions my be executed with next hot-keys:
Key Description
<left> ... move cursor one symbol left
<right> ... move cursor one symbol right
<Del> ... delete symbol under the cursor
<Ins> ... insert/override mode
<Bksp> ... delete symbol before cursor
<Ctrl-F> ... move cursor one word right
<Ctrl-D> ... move cursor one word left
<Shift-Del> ... delete the word after cursor
14. Error Messages
--------------
The error messages appear in the right side of top screen line.
The cursor positions to the causing error symbol(s), which are
blinking. Press any key to remove error message.
Syntax error ............ Invalid function name or an operation
sign omitted
Overflow ................ Calculation result > 1.1E+4392
Stack overflow .......... Too many nested functions
Scale Overflow .......... Expression length is more then 255 chars
No possibility .......... No possibility to unload calculator due
to another (TSR) program loaded after RSC
Argument Error .......... Function is not defined for this
argument value
Argument Negative ....... Function is not defined for the negative
argument value
Average undefined ....... Attempt to use the standard deviation
without the mean value calculation
Division by zero ........ Division by zero
Empty ................... Expression stack is empty
Too many ")" ............ Too many closing parenthesis
Missing "(" ............. Too many opening parenthesis
Missing ")" ............. Missing closing parenthesis
String stack saved ...... Informative message: expression stack is
written to file
"," expected ............ Function requires 2 arguments
Interval Error .......... sign( f(Low_boundary)) = sign( f(Up_boundary))
User break .............. User break during calculations
The error and warning messages appear to start RSC:
File <FileName> not found ... Warning! Start.
File <ConfigFileName> not correct ... Warning! Start.
Unable to install RSC! ... Break.
RSC is already loaded! ... Break.
15. Disclaimer.
-----------
The Resident Scientific Calculator (RSC) is provided on an "as
is" basis without warranty of any kind, expressed or implied.
The person using the software bears all risk as to the quality
and performance of the software. The author will not be held
liable for any special, incidental, consequential, direct or
indirect damages due to incorrect calculations or other
malfunctions.
16. Registration.
-------------
If you like this program and continue to use is, a registration
fee is US$10 for noncommercial use. When registered, you will
receive via e-mail conversion code to remove "UNREGISTERED COPY"
message, full support and are entitled to a free upgrade.
Registered users will get 1 free upgrade. Please mail Your
registration form (see RSC.REG) and enclose CASH (I am not sure
that I would be able to release check or money order in Russia) to:
Igor Evsikov
LCTA, JINR, (Dubna)
PO Box 79, Head Post Office
Moscow 101000
Russia
Please send E-mail message when you mail your registration form !!
We will try to extend support to unregistered users during
their evaluation period. However, we reserve the right to limit
support for unregistered users if their requests become taxing.
********************* Technical Support *************************
**** Questions and comments can be sent to us via e-mail ****
**** evsikov@lcta5.jinr.dubna.su ****
*****************************************************************
17. Acknowledgments.
----------------
We would like to thank the following people:
Prof. Stephen Smith University of Waterloo (Canada)
Frans Gremmen University of Nijmegen (Netherlands)
Dr. Eugen Cherepanov Join Institute of Nuclear Research (Russia)
Prof. D. W. O. Heddle University of London (UK)
Peter J. McKinney (USA)
for valuable notes on previous RSC versions.