Skip to content

Calculator

Use the Calculator to create calculations of measurements to visualize in data displays.

Calculator overview

Get an overview of the Calculator features.

To access the Calculator, click Calculator in the Tools panel.

  1. Calculation tools
    • Click New to create a new calculation. Click the down arrow to create a constant or model range.
    • Click Delete to delete the selected calculation.
    • Click Accept when finished entering your calculation.
    • Use the up and down arrows to move the selected calculation up or down the list.
    • Click Visibility Show or Hide Tools to select which tools to show or hide.
  2. Calculation list

    Use to create calculations, constants, and model ranges. A calculation requires a name, followed by an equal operator (=), then followed by the calculation. You can also enter units for the calculation.

  3. Mathematical form

    Displays the selected calculation in the common mathematical format.

  4. Calculation mode and properties

    • Set the angular units to degrees (DEG) or radians (RAD).
    • Set the mode to Timer Mode when calculations use measurements from photogates.
    • Click Properties to set the names, symbols, and numerical format of the selected calculation.
  5. Measurement picker and special characters
    • Click Data Summary to insert a measurement in a calculation.
    • Use the special character buttons to add a superscript, subscript, or Greek letter to the calculation name.
  6. Function buttons

    Click a function button to add it to a calculation. Use the menu on the left to select a different category. Hover over a function to view a description of how to use it in the space below.

  7. Operators

    Click a button to add an operator to a calculation.

  8. Function description

    Displays a description of how to use a function when hovering the mouse cursor over the button.

Create and use a calculation

Use the Calculator to create an equation using sensor measurements and view the calculation in a data display.

Tip

Use the QuickCalc feature in the Graph display to quickly display measurements using simple calculations without having to use the Calculator.

  1. Select Calculator from the Tools panel.
  2. Click New to create a new equation. The Calculator provides a default name for the calculation followed by an equals operator =.
  3. Enter a new name for the calculation, if desired.
  4. Enter the calculation on the right side of the equation.

    • To insert a measurement, click the measurement picker or enter a left square bracket [.
    • To insert a function or operator, use the function buttons or type the function using your keyboard.

    Note

    If your calculation contains a constant (such as m in the preceding example), the Calculator automatically creates a definition for the constant on the next line. You need to provide a value for the constant for it to be valid.

  5. Enter units for the calculation. As you enter the units, select a unit from the drop-down list to associate the calculation with a measurement type.

To use the calculation in a display, click the display's measurement selector, just as you would when selecting a sensor measurement. The calculation name appears towards the bottom of the list under Equations/Constants.

Create a user-defined constant

Use the Calculator to define a constant value to use in equations.

  1. Click Calculator from the Tools panel.
  2. Click the down arrow next to New, then select Add New Constant. The calculator creates a default name and value for the constant.
  3. Enter a new name and value for the constant.
  4. Enter units for the constant. As you enter the units, select a unit from the drop-down list to associate the calculation with a measurement type.

Use a constant in an equation

Insert a constant in an equation using one of the following methods:

  • Type the name of the constant.
  • Click the measurement picker and go to Constants in the Equations/Constants section. Select either a user-defined constant or one of the provided experimental constants.

Use a function in a calculation

This section describes how to use each function provided in the Calculator by category.

Scientific

  • sin

    Trigonometric sine function.

    sin(x)
    

    x = data or value

  • cos

    Trigonometric cosine function.

    cos(x)
    

    x = data or value

  • tan

    Trigonometric tangent function.

    tan(x)
    

    x = data or value

  • arcsin

    Trigonometric arcsine function.

    arcsin(x)
    

    x = data or value

  • arccos

    Trigonometric arccosine function.

    arccos(x)
    

    x = data or value

  • arctan

    Trigonometric arctangent function.

    arctan(x)
    

    x = data or value

  • x2

    Squares the preceding value.

  • e^x

    Raises e to the x power.

    exp(x)
    

    x = data or value

  • 10^x

    Raises 10 to the succeeding value.

  • Calculates the square root.

    sqrt(x)
    

    x = data or value

  • LN

    Calculates the natural logarithm of x.

    ln(x)
    

    x = data or value

  • LOG

    Calculates the logarithm (base 10) of x.

    log(x)
    

    x = data or value

  • y^x

    Raises y to the x power.

  • 1/x

    Inverts the preceding value.

  • !

    Calculates the factorial of x. All non-integer values of x will be rounded prior to calculating the factorial.

    factorial(x)
    

    x = data or value

  • ABS

    Calculates the absolute value of x.

    abs(x)
    

    x = data or value

  • EE

    Scientific E notation representing "times ten raised to the power of."

  • °

    Degree symbol.

Statistics

  • Σ min

    Determines the running minimum value of the data source x.

    min(x)
    

    x = data only

  • Σ max

    Determines the running maximum value of the data source x.

    max(x)
    

    x = data only

  • Σ avg

    Calculates the running average value (mean) of the data source x.

    avg(x)
    

    x = data only

  • Σ σ

    Calculates the running standard deviation of the data source x.

    stddev(x)
    

    x = data only

  • Σ count

    Calculates the running count (number of data points) of the data source x.

    count(x)
    

    x = data only

  • Σ sum

    Calculates the running sum of the data source x.

    sum(x)
    

    x = data only

  • Single min

    Determines the overall minimum value of the data source x. Returns a single value.

    singleMin(x)
    

    x = data only

  • Single max

    Determines the overall maximum value of the data source x. Returns a single value.

    singleMax(x)
    

    x = data only

  • Single avg

    Determines the overall average (mean) value of the data source x. Returns a single value.

    singleAvg(x)
    

    x = data only

  • Single σ

    Determines the overall standard deviation of the data source x. Returns a single value.

    singleStddev(x)
    

    x = data only

  • Single count

    Determines the overall count (number of data points) value of the data source x. Returns a single value.

    singleCount(x)
    

    x = data only

  • Single sum

    Determines the overall minimum value of the data source x. Returns a single value.

    singleMin(x)
    

    x = data only

Special

  • integral

    Calculates the numerical integral of the data source y with respect to the data source x by determining the running sum of the area under each y data point with respect to its corresponding x data point.

    integral(y,x)
    

    y = data only

    x = data only

  • derivative

    Calculates the numerical derivative of the data source y with respect to the data source x by calculating the slope of a line segment from one data point in the sequence to a second data point in the sequence n-1 points away. If n = 2, the derivative values will be the slope between the first and second point, second and third point, and so on. If n = 5, the derivative values will be the slope between the first and fifth point, second and sixth point, third and seventh point, and so on.

    derivative(n,y,x)
    

    n = integer value ≥ 2

    y = data only

    x = data only

  • first

    Returns a data set with all values equal to the first value of the data source x. The length of the returned data set will be identical to the length of the data source x.

    first(x)
    

    x = data only

  • previous

    Returns a data set with each value equal to the nth previous value from the data source x. The returned data set will have n fewer data points than the data source x.

    previous(n,x)
    

    n = integer value ≥ 1

    x = data only

  • period

    Determines the period of the data source x (assuming it is oscillating) by detecting peaks in the data and measuring the time between peaks. The values 'peak%' and 'valley%' set the thresholds to finding the peaks in the data source x. If peak% and valley% are both equal to 10, the function searches for peaks in the top and bottom 10% of the data range. The value 'time' is the time range over which the algorithm is detecting peaks. The peak%, valley%, and time values can be adjusted to tune the function for best results.

    period(peak%, valley%, time, x)
    

    peak% = value only

    valley% = value only

    time = value only

    x = data only

  • amplitude

    Determines the amplitude of the data source x (assuming it is oscillating) by detecting peaks and valleys in the data and measuring half the thresholds to finding the peaks and valleys in the data source x. If peak% and valley% are both equal to 10, the function searches for peaks and valleys in the top and bottom 10% of the data range. The value 'time' is the time range over which the algorithm is detecting peaks and valleys. The peak%, valley%, and time values can be adjusted to tune the function for best results.

    amplitude(peak%, valley%, time, x)
    

    peak% = value only

    valley% = value only

    time = value only

    x = data only

  • modulo

    Returns the remainder of y/x.

    mod(y, x)
    
  • random

    Returns a random value between zero and one.

    random()
    
  • timeof

    Returns the Time values, or other independent variable values, associated with each value in the data source x.

    timeof(x)
    

    x = data only

  • timeat

    Returns the Time value, or other independent variable value, associated with the value in the data source x whose index is equal to n.

    timeat(n, x)
    

    n = integer value ≥ 1

    x = data only

  • valueat

    Returns the data value from the data source x whose index is equal to n.

    valueat(n, x)
    

    n = integer value ≥ 1

    x = data only

  • timeAtValue

    Returns the Time values, or other independent variable values, associated with each value in the data source x that is equal to value.

    timeatvalue(x, value)
    

    x = data only

    value = value only

  • peakamp

    Calculates half the distance between the maximum and minimum values in every time interval 'time' for the data source x.

    peakamp(time, x)
    

    n = integer value ≥ 1

    x = data only

  • diff

    Returns a data set with each value equal to the difference between the current value and the nth previous value in data source x. The returned data set will have n fewer data points than the data source x.

    diff(n, x)
    

    n = integer value ≥ 1

    x = data only

  • finalValue

    Determines the final value of the data source x. Returns a single value.

    finalValue(x)
    

    x = data only

Filter

  • filter

    Returns a copy of the data source x with all values less than min and greater than max removed.

    filter(min, max, x)
    

    min = value only

    max = value only

    x = data only

  • limit

    Returns a copy of the data source x with all values less than min set equal to min, and all values greater than max set equal to max.

    limit(min, max, x)
    

    min = value only

    max = value only

    x = data only

  • smooth

    Smooths the data from the data source x using the Savitzky-Golay method. Increasing n increases the amount of smoothing. The parameter n must be an odd number greater than or equal to 5.

    smooth(n, x)
    

    n = integer value ≥ 5

    x = data only

  • avgfilter

    Smooths the data from the data source x by averaging every n values into one value. The number of points in the resultant data set will have a factor of n fewer points than the original data source x.

    avgfilter(n, x)
    

    n = integer value ≥ 2

    x = data only

  • change filter

    Returns a copy of the data source x that includes the first value and only those other values with a change in value greater than change compared to the prior value. All other values are removed.

    chgfilter(change, x)
    

    change = value only

    x = data only

  • time filter

    Returns a copy of the data source x with all values removed whose corresponding Time values, or other independent variable values, are less than time. The resultant data is then translated by the amount equal to time. This function is useful for time shifting dependent variable values.

    timefilter(time, x)
    

    time = value only

    x = data only

  • inrange

    Determines if the values in the data source x are within the range between min and max. For all x values within the range, the function returns 1, and for all values outside the range, the function returns 0.

    inrange(min, max, x)
    

    min = value only

    max = value only

    x = data only

Logic

Note

Logic expressions used in calculations must be enclosed in parentheses.

  • AND

    The function is equal to 1 if both A and B are non-zero. Otherwise, the function is equal to 0.

    and(A, B)
    

    A = data or value

    B = data or value

  • OR

    The function is equal to 1 if either A, B, or both are non-zero. Otherwise, the function is equal to 0.

    or(A, B)
    

    A = data or value

    B = data or value

  • XOR

    The function is equal to 1 if A or B, but not both, are non-zero. Otherwise, the function is equal to 0.

    xor(A, B)
    

    A = data or value

    B = data or value

  • NAND

    The function is equal to 1 if both A, B, or both are zero. Otherwise, the function is equal to 0.

    nand(A, B)
    

    A = data or value

    B = data or value

  • NOR

    The function is equal to 1 if both A and B are zero. Otherwise, the function is equal to 0.

    nor(A, B)
    

    A = data or value

    B = data or value

  • NOT

    The function is equal to 1 if A is equal to zero. The function is equal to 0 when A is a non-zero number.

    not(A)
    

    A = data or value

  • <

    Test for less than.

  • >

    Test for greater than.

  • Test for inequality.

  • Test for less than or equal.

  • Test for greater than or equal.

  • Test for equality.

Custom

  • Exhalation Rate

    Calculate the rate of exhalation using a Spirometer's Flow Rate and a constant value.

    Exhalation Rate = FlowRate + ((timeof(FlowRate) + 30)/(330/ExhaleConstant)) + 0.01
    

    FlowRate = Flow Rate measurement (in L/s) from a Spirometer

    ExhaleConstant = Calibration constant value

  • Vol O2 Consumed

    Calculation of oxygen consumed using a Dissolved Oxygen measurement. Uses the Exhalation Rate calculation.

    Vol O2 Consumed = integral( (0.209-(DO2*0.01))*("Exhalation Rate"), Time )
    

    DO2 = Oxygen Concentration measurement (in mg/L) from a Dissolved Oxygen Sensor.

    Exhalation Rate = Calculate the rate of exhalation using a Spirometer's Flow Rate and a constant value.

  • Respiration Intensity

    Calculation of the rate of oxygen consumed per mass. Uses the Vol O2 Consumed calculation.

    Respiration Intensity = smooth(7, ("Vol O2 Consumed"/timeof("Vol O2 Consumed")*3600)/BodyMass)
    

    Vol O2 Consumed = Calculation of oxygen consumed using a Dissolved Oxygen measurement. Uses the Exhalation Rate calculation.

    BodyMass = Person's mass in kg.