View Function


Applies to: 2D, 3D and Studio.

View Function draws functions you write yourself -- up to twenty-five of them at once, over a range you choose -- without any data being involved. Use it to see what an equation looks like, to compare a family of curves or surfaces, to try a model before fitting it, or to generate data from an expression.

One procedure serves both dimensions. The pair of buttons at the top of the dialog chooses which:

·    y = f(x) -- functions of one variable, drawn as curves.

·    z = f(x,y) -- functions of two variables, drawn as surfaces.

Choosing one relabels the function slots, enables or grays the Y range, and retitles the window. Your choice is remembered, so the dialog opens the way you last left it.

Writing the Functions

There are twenty-four expression slots, labelled Y[1] to Y[24] -- or Z[1] to Z[24] in the two-variable identity. Each takes one expression: type it and it is a function. Leave a slot empty and it is ignored.

Below them is a twenty-fifth slot labelled Custom:, which is different in kind. It is several lines tall and takes a short script: intermediate results on their own lines, and then a final line beginning Y= (or Z=) that gives the function its value.

Use the numbered slots for anything that fits on one line, and Custom when a function is clearer written in steps.

Constants

A0 through A9 are ten constants you can use in any slot. They are what make a slot worth keeping: write A0*exp(-A1*x) once, and explore the family by changing two numbers rather than retyping the expression.

The Range

Min X and Max X set the domain. In the two-variable identity, Min Y and Max Y set the second axis; in the one-variable identity they are grayed, because a curve has only one domain.

Inserting a Function by Name

The category list and the function list beside it hold the parser's whole catalogue. Choose a category, choose a function, and it is inserted at the cursor with its arguments in place -- useful when you know what you want and not quite how it is spelled.

Seeing the Result

Press OK and the functions are drawn.

·    One variable: every defined function is a curve in one frame, sharing axes, so the family can be read against itself.

·    Two variables: every defined function gets its own pane, tiled across the window. Surfaces are drawn separately because two surfaces in one frame hide each other.

What you see is the function itself, evaluated everywhere it is drawn -- not a set of points joined up. No data markers appear, because there is no data.

If a function will not compile, only that one is lost. The rest are drawn normally, and the slot with the mistake simply has no curve or no pane.

Keeping the Functions

Add stores the set as a node in the notebook; Update replaces the node you arrived from. The node keeps the text you wrote, so opening it again returns you to this dialog with your expressions intact -- nothing is lost to a compiled form.

The node is drawn in blue in the notebook tree, which marks it as a function node: something the program can evaluate anywhere, rather than a fixed list of values.

Turning the Functions into Data

Most procedures work on data, so a function must be digitized before it can be fitted, listed or exported. Two controls here do that:

·    X Pts and Y Pts set the density. The defaults are 51 x 51 for surfaces and 1001 points for curves.

·    Discrete Data, when checked, creates one digitized child node per active function when you press Add or Update -- one for each function still showing.

The density you set is stored on the node, whether or not you tick Discrete Data. So if you digitize the node later, from the Data menu, it uses the density you chose here.

Saving a Set of Functions

Save writes the current set to a file and Read loads one back, so a set of functions worth keeping is not confined to one notebook.

Function files from TableCurve 3D are read directly. If you have a library of function files from the earlier product, open them with Read -- they are recognised and converted.

When you read a file, TableCurve works out for itself whether it holds one-variable or two-variable functions, and switches identity to match. If a script was written for one dimension and is read into the other, its final line is adjusted automatically -- you do not have to rewrite it.

See Also

·    Data Nodes and Function Nodes -- what the blue colour means, and digitizing.

·    Data Nodes and Function Nodes -- digitizing a function node afterwards, at any density, as often as you like.

·    Find Optimum Visualization -- choosing how a digitized surface is drawn.

·    Parser Functions -- the expression language these slots accept.