Call me back | My basket | Checkout | Add to email list

     You are here: Website » Knowledge base

« back to website

ChangingProperties / UserDefinedVariables

Defining User Defined Variables


One important reason to use a user defined variable is if you want to keep the original value of a pre-defined variable. When you add a transformation to an external input then the original input is "lost" - for example if you apply a transformation to the longitudinal acceleration then there is no way to then graph the original longitudinal acceleration. Another more subtle difference between standard inputs and user defined variables is in the calculation order:

For standard variables and inputs they are all:

1. transformed/converted using whatever conversion specified, for example from volts to degrees C for a temperature sensor

2. the rate of change filter is applied

3. the linear smoothing filtering is applied

4. the calculus filters are applied

5. finally, the minimum and maximums are applied

When user defined variables are calculated each one is done before the next in order... for "User variable 1" we do steps 1-5 above and then the program proceeds to doing "User variable 2" etc. The effect of this is that you can build up results, so "User variable 2" can depend on the filtered and transformed result of "User variable 1" etc and in some situations this can be a very useful property.


To get the list of available User Defined Variables, you should first expand the “User Defined Variables” node. Once you have done this, select a free variable from the list. The editable options in the User variables are identical to those in pre-defined variables

  • Advanced options (more details here)
    • Calculus
    • Maximum rate of change
  • Units
  • Variable Name
  • Maximum
  • Minimum
  • Smoothed over


Editing the equation for User defined variables

Click on the edit equation node and select “Edit equation for User Define Variable” . A dialog box will appear on the screen.


Use this window to create the exact equation that is needed and click on the OK button.

Equations can be created using following methods.

1. Type the Equation into the custom box

2. Genereate equation from a table

3. Using a VBScript

4. Calling an external DLL


For more detailed discusion of creating equations using the methods 1, 3, and 4, see the User Defined Varialbe Transformations under the Main analysis help. Method 2 is discussed below.


Generating an equation from a table

Once the button is clicked the user will be presented with the following dialog box:

The box is divided into 3 areas:

  • The table to the right of the box is where the table for the calibration data is entered. The input data is entered into the left hand column and the output is entered into the right hand column. The information must be entered in pairs and there must be between 1 and 25 unique points entered for the program to calculate an equation. As you enter or edit each point you will see that the graph and the equation update.
  • The graph to the left of the box displays both the data points that have been entered (they are shown as the + marks) and the equation that has been fitted to the data (the equation is shown as the curve). The graph is scaled according to the input/output data points that are entered into the table. You can edit the points on the graph (which also updates the table). To do this select the point on graph by click on it and then move it using by holding down ctrl and using the cursor keys.
  • Finally at the top of the box the equation is displayed, as well as the standard deviation of the fit. The standard deviation indicated how well the data fits the points, a standard deviation of 0 is a perfect fit, the higher the number, the worse the fit.

There are a couple of things to note:

  • The equation that is fitted to the data is the best fit by minimising the square of the error between the data points and the curve - however it's not always possible to force the equation though all the points, it simply does the best that can be done.
  • Equations are very useful for interpolation, but useless at extrapolation! For example if you calibrate an air temperature sensor from 10 degrees to 80 degrees, then the sensor should only be used over this range - the calibration would not be valid at 100 degrees for example.
  • You can cut and paste the information from the table into and out of excel by highlighting the data and right clicking, then selecting the required option.
  • If you click OK, the the equation is applied to that channel, if you click cancel all the changes are discarded. In all cases once you close the dialog box there is no way to recall the data points that you entered. If you think you might want to go back to the original data at some point, then the user is advised to cut and paste the data to an external source.
Page last modified on July 10, 2009, at 11:03 AM