Data Builder Help

The Data Builder enables users to define mathematical data functions that depend on columns in a data table. Data function columns are immediately added to the table and become available as input to other data functions. Data functions may also depend on one or more parameters.

Functions and parameters are defined by entering expressions that are "parsed" (interpreted) by the OSP parser. The values of parameters are constants while those of functions depend on data variables such as x, y, t, etc. The parser recognizes the following elements:

- Numbers in decimal or scientific notation (e.g., 1.0E-3)
- Names of parameters, functions and other input variables
- Constants e and pi
- Arithmetic operators + - * / ^
- Boolean operators = > < <= >= <> & | !
- Parentheses to control order of operation
- Mathematical functions shown in Table 1
- If statements in the form if(conditional statement, expression1, expression2). Expression1 is evaluated if the conditional statement is true and expression2 is evaluated if it is false. For example, if (x < 0, x^2, -x^2) is a valid function expression.

abs(x) | acos(x) | acosh(x) | asin(x) | asinh(x) | atan(x) | atanh(x) | atan2(x,y) | ceil(x) | cos(x)
cosh(x) | exp(x) | frac(x) | floor(x) | int(x) | log(x) | max(x,y) | min(x,y) | mod(x,y) | random(x)
round(x) | sign(x) | sin(x) | sinh(x) | sqr(x) | sqrt(x) | step(x) | tan(x) | tanh(x) |

Table 1 Mathematical functions recognized by the OSP Parser

How to use Data Builder

Data Builder displays data functions and their associated parameters in tables with Name and Expression columns. To create a new parameter or function, click the appropriate Add button.

To edit a name or expression, double-click its table cell (gray cells cannot be edited). Names must be unique and can contain no spaces or mathematical symbols. Expressions must be valid mathematical expressions parsable by the OSP parser.

When editing an expression, the names of all available variables are listed in blue in the status bar below the tables. Variables for parameter expressions include only other parameters, while variables for data function expressions also include table column names (e.g., t, x or y). For example, if the parameters "m" and "g" are defined and the table includes a column named "y", then the entry "m*g*y" is a valid expression for gravitational potential energy.

If an invalid expression is entered into a cell the cell turns red and an error message is displayed in the status bar. For example, the expression "mgy" is invalid since the multiplication operators (*) have been omitted. Circular references also result in an error condition.

Data Builder includes several features designed to help students build, modify and compare functions quickly:

1. All edits are undoable and redoable making it easy to quickly flip back and forth between two function expressions or parameter values.
2. Single or multiple table rows can be copied or cut to the clipboard for pasting into other tables.
3. Variables names in the status bar turn red when the mouse is moved over them and can then be inserted directly into expressions by clicking them.