AAA v1.0 User’s Manual
OLD ARITHMETICA
PROGRAMMER'S MANUAL OLD ARITHMETICA USER'S
MANUAL AAA PROGRAMMER'S
MANUAL AAA
SOURCE CODE DOCUMENTATION
Introduction
Requirements
How to Use
Detailed Entry
Illegal Entry
Introduction:
There are many different complex math programs out there, but lets face it,
most of them do so much, that they actually are not all that useful to the
everyday user. Matlab and Mathematica both take numerous hours just to master
the basics of algebra. The purpose of Arithmetica is to combine the
functionality of using a computer promt program, with the ease of using a
simple calculator and a symbolic differentiator (one that can perform
derivatives on user input and return a numeric result.
Requirements:
In order to use AAA you must be runnig Unix.
How to Use:
AAA is very easy to use.
- To begin:
- At unix prompt
type:
- To use input from a
textfile inputfile.txt
- To send output to a
textfile outputfile.txt:
- To use input and sent
to output
- aaa<inputfile.txt
>outputfile.txt
- To quit:
- The # will be treated as a
comment and all input on line beginnig with # will be ignored
- Enter as you would into a
calculator at prompt.
- To enter derivatives into the
symbolic differentiator type in ‘d(the expression, the variable with which
to take the derivative with respect to).
- Numbers
- Simply type the
number in as normal
- Negative Numbers
- A subtraction sign
followed by a number
- Order of Operations is from left ti right
of user entry
- Parenthesis
- Square Root, Absolute
Value
- Exponents
- Multiplication/Division/Modulus
- Addintion/Subtraction
- Parentheses
- Operators
- Variables
- Type in any vaild
string of letters not used as an operator
- This variable can be
assigned a value
- To recall value just
use variable as you would a number
- If variable is used
in an expression only its value is used, not the expression it was
created from
- This will prevent
varaibles from changing without your knowledge
- If no variable
assigned "current" used.
- To access this
value just type current
- Special Operators
- Plus one
++
- Minus one
--
- Plus Equals
+=
- Minus Equals
-=
- Times Equals
*=
- Divided Equals
/=
- Modulus Equals
%=
- Symbolic Differentiator
- Function f(1+t,t=2)
- Derivative of a
constant d(c)
- Deivative of a
variable with respect to itself d(x,x)
- Derivative of a
function d(u,x)
- Derivative of the sum
of two functions d(u+v,x)
- Derivative of the
difference of two functions d(u-v,x)
- Derivative of a the
negative of a function d(-v,x)
- Derivative of product
of two functions d(u*v,x)
- Derivative of the
quotient of two functions d(u/v,x)
- Derivative of a
function or variable to a power d(u^c), where c is a constant
- Derivative of the
square-root of a function d(sqrt(u),x)
- Derivatiive of the
natural log of a function d(ln(u),x)
- Derivative of the
exponential function d(e(u),x)
- Derivative of the sin
of a function d(sin(u), x)
- Derivative of the cos
of a function d(cos(u), x)
- Derivative of the tan
of a function d(tan(u), x)
Detailed
Entry
Numbers- Any integer
Examples:
Negative Numbers-Any negative integer
Examples:
|
-> -1
->-2
->-3
->.-500
->-5000
|
Order of Operations
Examples:
|
-> 1+1*2 is
processed 1*2 then +1
-> (1+1)*2 is porcessed 1+1 then *2
|
Parentheses
Examples:
|
->( is an open parentheses
->) is a closed parentheses
|
Operators
Plus
Examples:
|
->a+b = adds a
and b
->2+3 = 5
->3+5+4 = 12
->-2+5 = 3
->-5+-4 = -9
|
Minus
Examples:
|
->a-b =
subtract a from b
->5-2 = 3
->5-1-2 = 2
->-2-4 =-6
->-4--7 = 3
|
Times
Examples:
|
->a*b =
a times b
->2*3 = 6
->2*4*1 = 8
->-2*4 =-8
->-3*-4 = 12
|
Divided
Examples:
|
->a/b =
a divided by b
->6/3 = 2
->8/2/2 = 2
->-4/1 =-4
->-12/-4 = 3
|
Modulus- use positive numbers -negatives will result in
forced conversion to positives
Examples:
|
->a%b =
a mod b gives remainder
->6%4 = 2
|
Power- raise and int to a positive integer power
Examples:
|
->a^b
= a to the bth power
->2^3 = 8
|
Factorial
Examples:
|
->a!
= a*(a-1)*(a-2)*...1
->3!
= 6
|
Square Root- rounds the sqrt root of positive number
to nearest int
Examples:
|
->sqrt(a)
= a^.5
-> sqrt(16) = 4
->sqrt(5) = 2
|
Absolute Value
Examples:
|
->abs(a)
= abs(-a)=a
->abs(4) = 4
->abs(-8) = 8
|
Variables
Examples:
- If no variable entered stored
as current.
- Use defined variables as any
number.
- When you reassign, variable
gets new value, but nothing dependent on this value
- Makes it so don't
accidentally change a variable you are using especially if it is depndent
on current.
- With current can just enter
operator. If you want to add 2 to current just enter ->+2
Sample session with
variables
|
->x=4+2
6
->x
6
->4*3
12
->current
12
->x*4
24
->x = x+5
11
->x
11
->current
24 //
note it did not change with x
->-5
19 //current-5
->*2
38
|
Special Operators
Plus one ++
Minus one --
Plus Equals +=
Minus Equals -=
Times Equals *=
Divided Equals /=
Modulus Equals %=
Examples:
Sample Session
|
->x=5
5
->x++
6
->x--
5
->x+=4
9
->x
9
->x-=2
7
->x*=2
14
->x/=2
7
->x%=2
1
|
Symbolic Differentiator Examples:
- The user
should store a value to a variable, before using the symbolic
differentiator.
- The
user must specify the variable with which the derivative must be taken
with respect to, otherwise the expression will be evaluated to 0.
- The
output will be a numeric result of the evaluated derivative.
Special Operators/Derivative Rules:
f(1+t,t=c) c
is a constant, will use the value of c and output evaluated result of
expression
ln take
the natural log of an expression
exp e^x
d(c) evaluates
to 0
d(x,x) evaluates
to 1
d(u+v, x) d(u)
+ d(v) with respect to x
d(u-v, x) d(u)
– d(v) with respect to x
d(u*v, x) u
* d(v) + v * d(u) with respect to x
d(u/v, x) v
* d(u) – u * d(v)/ v^2
d(u^c, x) c
* u^(c – 1) * d(u), where c is a constant
d(sqrt(u), x) (1/2)
* d(u)/sqrt(u),
d(ln(u), x) d(u)/u
with respect to x
d(exp(u), x) exp(u)
* d(u) with respect to x
d(sin(u), x) cos(u)
* d(u) with respect to x
d(cos(u), x) -
sin(u) * d(u) with respect to x
d(tan(u), x) (1+
tan(u)^2) * d(u) with respect to x
Sample Session
|
->x=2
2
->d(sin(3*x),x)
2.88051
-> d(ln(x), x)
0.5
-> d(3*x^2, x)
12
-> d(exp(x^2),x)
218.3926
->f(1+t, t=2)
3
|
Illegal Entry
- Undefined characters will be
parsed out
- If enter x$+2
it will become x+2
- If illegal negative entry the
program will dsiplay an error message, but will treat the negative number
as a positive.
- Examples:
- Mod with negatives
- To a negative power
- Square Root of
Negative
- Factorial of
Negative
CREATED BY JESSICA SMITH AND POORNIMA VIJAYASHANKER