next up previous contents index
Next: Operations on functions Up: Manual Previous: Manual   Contents   Index


Definitions

A numerical function $f(x)$ is always represented by pairs $(x_i, f(x_i))$ with
$x_1 < x_2 < \ldots < x_n$. If it is necessary to evaluate the function outside the points $x_i$ we assume that $f(x)$ is linear between two sucessive $x_i$. Before $x_1$ it is constant and its value is $f(x_1)$ and after $x_n$ it is constant and its value is $f(x_n)$.

Functions can be defined in simple or double precision (but simple precision may be abandoned in future versions of funct).

To define a function the x-range must be defined first. For example the command xrange used to create a double precision x-range needs 3 parameters :

 - funct -> xrange xr n1 n2

creates a x-range in double precision with n2 points. The first parameter n1 indicates the type of the x-range. It must be 0 or 1. The two types differ by the way the variable $x$ of the functions $f(x)$ having this x-range is represented. For type 0, there are no conditions on the $x_i$, except that $x_1 < x_2 < \ldots < x_n$. For type 1, it is assumed that the $x_i$ are equally spaced, so it is sufficient to know the initial value $x_1$ and the step between two successive $x_i$.

Once the x-range has been created it must be defined. For type 1 x-ranges it is only necessary to indicate the initial value of the x's and the increment, with the command

 - funct -> fix_xrange xr orig incr

Here xr is the name of the x-range, orig is the first value of x, and incr the distance between sucessive x's. The two last parameters can be numerical expressions that will be translated by the expression evaluator of interpcom.

If the x-range is of type 0, the command must be

 - funct -> fix_xrange xr m x

where m will be evaluated as an integer, and x will be the value of the m-th x.

Now we can create functions having this x-range :

 - funct -> function f xr
 - funct -> function_C fC xr

will create a real double precision function f and a complex double precision function fC with x-range xr. There are similar commands for simple precision x-ranges and functions.

Functions can be destroyed with the command destroy of interpcom, and x-ranges too. Note that when a x-range is destroyed, all the functions that use it are also destroyed.


next up previous contents index
Next: Operations on functions Up: Manual Previous: Manual   Contents   Index
2009-11-12