ECALC is an RPN calculator with an emphasis on the sort of display and
calculations required by an audio electronics engineer.
The program is written in Basic using DrWimp and is a translation of one
originally written in Tcl/Tk for Linux/Unix. The structure simple enough
that it could easily be modified or extended. As supplied it runs under
BASIC64 (see the !Run file). It will run unmodified under ordinary BASIC
The RPN style calculator is greatly superior to the algebraic type for
pretty well any calculation that can realistically be carried out without
programming. It does, however, require that the user has at least some
understanding of how algebraic formulae and numbers work which is probably
why the algebraic type is dominant.
The program has no on-screen 'keyboard' but instead is controlled directly
from the computer keyboard when the entry field in the display window has
focus. The window includes a display of the first five levels of the stack,
which has a fixed depth of 100. The stack is never empty but is filled with
zeros beyond the used levels.
Error recovery is possible with undo and last x.
Angles may be in degrees or radians; toggle deg/rad by select clicking on
the word at the top left corner of the window.
All functions are entered as character strings, the most common
ones being single characters. This, and the ability to enter several
operations at once, makes the calculator really easy to use.
Only real numbers are handled and all calculations are carried out
using double precision floating point (BASIC64).
Numbers may be entered as 3300 3.3e3 3k3
and are case sensitive e.g. 2m2 = 2.2e-3
2M2 = 2.2e6
Numbers may also be entered in any of the
conventional mathematical forms.
Numbers are always displayed in engineering format, i.e. mantissa and exponent
with the exponent always a multiple of 3. Normally the exponent is removed and
the decimal point replaced by the appropriate letter (see 'math' and 'elec').
---------------------------------
Examples
A series of numbers and operations may be entered at once, separated by
spaces or commas. Any action is carried out when return <ret> is pressed.
e.g.
resistors in parallel: 22k 150k pp <ret> > 19k19 -150k pp <ret> > 22k00
noise voltage in a 15k resistor, 20kHz bandwidth (default):
15k vn rb x <ret> > 2u222 dbu <ret> > -110.8
num^2 by multiplication: 125 # x <ret> > 15k62 sqr <ret> > 125.0
three resistors in parallel, longhand: 1/(1/a+1/b+1/c)
22k r 33k r 150k r a a r <ret> > 12k13
three resistors in parallel using the pp function
22k 33k pp 150k pp <ret> > 12k13
db loss in a potential divider, 100k to source 2k2 to ground
100k 2k2 pd db <ret> > -33.34
3dB frequency of 2k2 and 15uF
2k2 15u cf <ret> > 4.823
What resistor will achieve the same cut off frequency with 10nF
4.823 10n cf <ret> > 3M300
In any of the examples, spaces may be replaced by returns, making
intermediate results available. These results may be saved on the
stack using # <ret> or in the memory using ms <ret> or a right click
on any of the displayed stack registers.
----------------------------------
The menu operation 'save' saves the calculator state; 'recall' retrieves
the previously saved state.
Key Words:
nA, na
to
nG#, nAb frequency from note (A 440)
# , ' duplicate
2# , 2' dup x & y
2] swap z & y
] swap x & y
[ drop
2x 2X
2d 0.5X
a , + add
abs absolute
acos acos
asin asin
atan atan
al2 antilog 2^x
all antilog 10^x
bw set bandwidth for rb
cf R, C and frequency calculation
clear ccc clear stack and last x
cos cosine
ct cents from frequency ratio
d , / divide
db dB from voltage ratio
dbu dBu from voltage
dbw dB from power ratio
elec electrical format (e.g. 3k3)
exp exponent e^x
figs set displayed significant figures
mmi convert mm to inches ( x * (1.0/25.4) )
l2 log2
ll log_10
ln log_e
lra rms add voltage dBs
lx push last x
math math format (e.g. 3.3e3)
imm convert inches to mm ( x * 25.4 )
mr recall (push) memory
ms transfer x to memory (a right click on any
stack register also copies it to memory)
n negate
nn nearest note with deviation in cents pushed on stack
O X 2 (octave up)
o X 1/2 (octave down)
pi push pi
pow , ^ y^x
pd potential divider, y to input x to ground
pp resistors x & y in parallel
pv convert x to nearest preferred value
qq , QQ quit
r reciprocal
ra root of sum of squares (RMS add)
rb push sqare root of bandwidth
rn resistor producing x voltage noise in 1 Hz bandwidth
rnb resistor producing x voltage noise in the set bandwidth
rs root of difference of squares (RMS subtract)
s , - subtract
sin sine
sq square
sqr square root
tan tangent
undo undo last operation
vn noise voltage of resistor x in 1 Hz bandwidth
vnb noise voltage of resistor x in the set bandwidth
x , * multiply
xct frequency ratio from cents
xdb voltage ratio from db
xdbu voltage from dbu
xdbw power ratio from db
Ecalc is free software released under the GNU General Public License;
see the file 'COPYING' within the application.
The DrWimp library on which it depends for access
to the RISCOS Wimp functions can be obtained here.
Download The application with full source.
Download The application with full source, linked
with the necessary parts of the DrWimp library.