next up previous contents
Next: Appendices Up: Commands currently recognized Previous: Programming

Arguments: names, arithmetic and functions

For most arguments, instead of entering a number you can give one of the following names: XMAX, XMIN, YMAX, YMIN, XMAXP, XMINP, YMAXP or YMINP. XMAX, for example, is the maximum x value of the data (including the error bars). XMAXP is the x coordinate of the right hand y axis. Using the command DATALIMITS changes the values of these parameters. The following names are also recognized: NUMBERPOINTS (number of data values), XCURSOR and YCURSOR (the coordinates of the graphics cursor after the CURSOR command has been used), PI (3.142...), TWOPI (6.2...), C (speed of light), E (electronic charge), H (Planck's constant), K (Boltzmann's constant). All physical constants are SI! If you have used the command MOMENTS then the parameters MEAN and SIGMA can be used which are the mean and the standard deviation of the y array.

If you are inside a loop the variable LOOP is also available. The user accessible variable A1 through A5 can be given values using the ASSIGN command. Any variables specified using the VARIABLE command may also be used. These also have precedence over the built in constants. For example, a user defined variable named ``C'' can have the value set using ASSIGN and need not be the speed of light.

Very simple arithmetic operations are also possible in the input. Only two operands are allowed and there must be no spaces between these and the operator. Examples are:
c**2
evaluated as a single value: the speed of light squared.
c^2
this is equivalent to the expression above.
1+2
evaluated as a single value: 3.
1 +2
because of the space this will be evaluated as two numbers: 1 and 2.
1/2,-1/2 a1*mean
evaluated as three numbers: 0.5, -0.5 and the product of the mean of the data set and the user assigned variable A1.

Simple functions of arguments are also possible. For example, these are valid arguments:\

sin{10}
sqrt{4.1}
inverse{3/2}
tan{a1}
acos{a1**2}
cos{a1} tan{a2} 3+2

As with XFUNCTION etc. trigonometric functions assume degrees. Functions presently available include:
sin, cos, tan, sqrt, square, cbrt, cube, log, loge, log2, exp, exp10, abs, factorial, inverse, asin, acos, atan, sinh, cosh, tanh, j0, j1, round (IEEE rounding), ceil and floor. In addition to these data values are also available as ``functions'' i.e. x, y, z, xerr and yerr. x{3} for example is the ``X'' value of the 3rd data point. The results of least squares fits are available via fitvalue and fiterror. e.g. fitvalue{2} is the result of the fit for parameter no. 2. It is advised not to directly use fitvalue and fiterror as input to the CURFIT command.



next up previous contents
Next: Appendices Up: Commands currently recognized Previous: Programming



Robin Corbet
Sat May 3 16:56:08 EDT 1997