By default, algebraics will be converted to grobs and display on
the stack in a similar form as equation writer, except much faster!
They can be disabled in the STK
screen if you like the standard form.
This is based on EQStk 9.2 but has a few differences:
AGROB
xlib. User functions are
only available in the Cappuccino flavour of Java.AGROB
Java's AGROB
uses the string decomp routine to decompile objects, with
the following exceptions:
The tag is ignored, and thus the test defaults to testing for the following lists of exceptions.
Grobs already are in the required form, so nothing is done.
Global names are displayed with the '' delimiters. Note that 'Phi.2' is considered an ID and is displayed as in the normal stack. The following subscripts and special grobs only to apply to algebraics, such as 'Phi.2/3'.
Subscripts in algebraics can be generated as follows:
In the following examples the decreasing font size is left for the imagination of the reader:
X.Y.Z ==> X X1 ==> X
Y 1
Z
Due to the restricted internal font, and for easy access to some symbols the following names create special grobs:
The user should try typing above names when Java is active to see what the results are. Planck's constant is actually Dirac's constant (H-Bar) but is left the same for EQStk compatibility.
Local variable names are displayed without the '' delimiters.
Units are shown as in the built-in Equation Writer. For example:
m
1_m/s ==> 1_--
s
Arrays having more than two dimensions are shown using the current string
decomp. For one or two dimensions the objects in the array are decompiled
using the general rules for AGROB
, the results are then arranged in a
grid and are surrounded with brackets. One dimensional arrays are shown as
column vectors.
Arrays containing more than 20 objects will not be passed to the AGROB
in the stack, but you can still use the scroller or AGROB
xlib.
Note: Java's list support only applies in the scroller or direct AGROB
calls.
An empty list is converted using the current string decomp.
A list of lists all of equal length is considered a two dimensional array, and execution is similar as for arrays with the exception of using surrounding parenthesis instead of brackets.
Otherwise the list is generated as a column vector with surrounding parentheses.
All objects inside the algebraic are displayed using the regular rules. The functions in the algebraic then cause the grobs to be merged as is proper for the function. By default all functions simply display the name of the function followed by the arguments in parenthesis, with the following exceptions:
+ Arguments displayed with + in the middle
- Arguments displayed with - in the middle
NEG Argument displayed with - in the front
* Arguments displayed with a dot in the middle
/ Arguments displayed on top of each other w/ a line in between
^ Second argument displayed as exponent
INV Argument displayed with "-1" exponent
SQ Argument displayed with "2" exponent
EXP Argument displayed as exponent for "e"
ALOG Argument displayed as exponent for "10"
CONJ Argument displayed with "*" exponent
ABS Argument displayed with surrounding ||
SQRT Argument displayed with surrounding square root
XROOT Arguments displayed as written on paper
! Argument displayed with following "!"
MOD Arguments displayed with " mod " in the middle
NOT Argument displayed with a special NOT symbol in front
AND Arguments displayed with a special AND symbol in the middle
OR Arguments displayed with a special OR symbol in the middle
XOR Arguments displayed with a special XOR symbol in the middle
= Arguments displayed with "=" in the middle
== Arguments displayed with "==" in the middle
<> Arguments displayed with "<>" in the middle
< Arguments displayed with "<" in the middle
> Arguments displayed with ">" in the middle
<= Arguments displayed with "<=" in the middle
>= Arguments displayed with ">=" in the middle
The following cases are a bit more complex:
A series of derivatives with respect to X is causes the argument to be shown with the proper number of ticks (') as the 'exponent'.
A series of derivatives with respect to mixed variables is shown as taking partial derivatives of the argument.
Examples: (d denotes the derivative function)
'' '
'dX(dX(Y))+a*dX(Y)+b=0' ==> Y +aY +b=0
d
'dY(dX(F(X,Y)))=0' ==> ----(F(X,Y))=0
dYdX
Integral function is displayed as written on paper. As a special feature '?' as an integration limit is not displayed.
Examples: (S denotes the integral function, 00 infinity)
'S(0,00,EXP(-SQ(X)/2),X))=SQRT(PI/2)'
00
/ 2
| -x
| -- ---
| 2 |PI
==> |e dX = |--
/ \|2
0
'S(?,?,S(?,?,S(?,?,1/(X^2+Y^2+Z^2),X),Y),Z)'
///
||| 1
==> |||--------dXdYdZ
||| 2 2 2
|||X +Y +Z
///
Summation function is displayed as written on paper.
Example: (Z denotes the summation function)
'Z(I=1,n,SQ(I))=1/3*n^3+1/2*n^2+1/6*n)'
n
-- 2 1 3 1 2 1
> (I ) = -n + -n + -n
-- 3 2 6
I=1
is displayed as in the built-in Equation Writer.
Note: User functions are only available in the Cappuccino flavour of Java.
The user can create their own functions for example by typing 'F(X,Y)'
directly or executing { X Y } 'F'
APPLY. The AGROB
parser
utilizes this feature for executing various functions on the arguments as
follows:
'Mul(expr1,expr2)' ==> Multiplication with no mult. mark
'Der(expr,n)' ==> nth derivative of expr (tick form)
'DER(expr,n)' ==> nth derivative of expr (d/dx form)
'der(expr,n1,n2..)' ==> nth partial derivatives of expr
'Grad(expr)' ==> Gradient
'Div(expr)' ==> Divergence
'Curl(expr)' ==> Curl
'Lap(expr)' ==> Laplacian
'LapT(expr)' ==> Laplace transform
'FouT(expr)' ==> Fourier transform
'ILapT(expr)' ==> Inverse Laplace transform
'IFouT(expr)' ==> Inverse Fourier transfrom
'Cross(expr1,expr2)' ==> expr1 x expr2
'If(expr1,expr2)' ==> expr2 ,expr1
'So(expr1,expr2)' ==> expr1 ==> expr2
'Equ(expr1,expr2)' ==> expr1 <==> expr2
'PM(expr1,expr2)' ==> expr1 plus/minus expr2
'MP(expr1,expr2)' ==> expr1 minus/plus expr2
'pm(expr)' ==> plus/minus expr
'mp(expr)' ==> minus/plus expr
The following are more about formatting than actually providing some mathematical functions:
'Par(expr)' ==> Parenthesis are drawn around the argument
'Vector(expr)' ==> An arrow is drawn above the argument
'Top(expr1..exprN)' ==> The arguments are shown on top of each
other, aligned to left border.
'Lt(expr1..exprN)' ==> The argument is given a left brace "{"
For multiple arguments Top is called 1st
'Rt(expr1..exprN)' ==> The argument is given a right brace "}"
For multiple arguments Top is called 1st
'fm(expr)' ==> Decrement font size for expr
'fp(expr)' ==> Increment font size for expt
The user should note that all of above are just pseudo-functions, the only
thing they do is to arrange the arguments in a convenient way. Thus for
example true functions do not 'see' the pseudo-functions to have any special
priorities, and thus parenthesis may not be shown when needed. The
Par
pseudo-function is provided for use in such cases.
To support the common notation for special functions the following patterns at the end of the function name are recognized:
'.n' ==> First argument is shown as subindex.
Remaining arguments, if any, are shown in parenthesis.
'.nm' ==> First argument is shown as subindex, second as topindex.
Remaining arguments, if any, are shown in parenthesis.
Examples:
'J.n(n,x)' ==> J (x) (Bessel function)
n
m
'P.nm(n-1,m,x)' ==> P (x) (Associated Legendre function)
n-1