# Math channels

Some applications require the recording and graphing of a calculated parameter containing data from one or more measurement channels. PicoLog 6 is equipped with an equation editor to perform simple calculations such as A–B, or more complex functions such as log, sqrt, abs, round, min, max, mean and median.

Math channels are treated like any normal channel, so you can perform functions like alarms, graphing and annotations on them.

## Arithmetic functions

Brackets:

Standard arithmetic functions

Power: x ^ y Calculates the power of x to y.

Exponential: e ^ x Calculate the exponent of a value

Modulus: x % y Calculates the modulus, the remainder of an integer division

Factorial: x! Compute the factorial of a value Factorial only supports an integer value as argument.

Log: log(x [,base]) Calculate the logarithm of a value, square brackets are optional parameters. Optionally use Log 10: log10(x) Calculate the 10-base logarithm of a value.

ln: log(x, e) Calculate the logarithm to the base e of x

Square root: sqrt(x) Calculate the square root of a value

Absolute: abs(x) Calculate the absolute value of a number

Ceiling: ceil(x) Round a value towards plus infinity

Floor: floor(x) Round a value towards minus infinity

Round: round(x[, n]) - Round towards nearest integer

## Boolean Operators

and: x and y Boolean AND two values

or: x or y Boolean OR two values

not: not x Boolean NOT value

xor: x xor y Boolean XOR two values

## Statistical functions

Maximum: max(a, b, c...) Compares all the values in the list and return the maximum number

Minimum: min(a, b, c...) Compares all the values in the list and return the minimum number

Mean: mean(a, b, c...) Computes the mean value from the list of values

Median: median(a, b, c...) Computes the median value from the list of values

## Trigonometric functions

Sine: sin(x) Calculate the sine of a value.

Cosine: cos(x) Calculate the cosine of a value

Tangent: tan(x) Calculate the tangent of a value

## Special functions

Conditional expression: operand1 ? operand2 : operand3 - The conditional operator (? :) is a ternary operator (it takes three operands). E.g. x > 0 ? x*4 : x*3  The conditional operator works as follows:

• If operand1 evaluates to true, operand2 is evaluated
• If operand1 evaluates to false, operand3 is evaluated

Device disconnected: x == disconnected where x is the data from a channel

## Constants

Pi: The number pi is a mathematical constant that is the ratio of a circle's circumference to its diameter (3.141592653589793)

1.4e3 = 1400

22e-3 = 0.022