Link Search Menu Expand Document

Math Entity Functions

Sep 28 2022 at 12:00 AM

  1. Absolute
  2. Average
  3. Count
  4. Delta
  5. Multi Division
  6. Multi Max
  7. Multi Min
  8. Multi Product
  9. Multi Subtraction
  10. Multi Sum
  11. To The Power Of
  12. Root
  13. Running Total
  14. Sum
  15. Mode
  16. Median
  17. Min
  18. Max

Absolute

Function Description:

This function determines the absolute value of a decimal number. It is a way of seeing the magnitude of a number, or the non-negative version of it.

Function Structure:

Figure 1 - Absolute

Inputs Required:

  • Value - The value required to be output as an absolute.

Output Expected:

  • Integer - This function returns an absolute value of the entity value being assessed.

Use Case Example(s):

ExampleValueAbsolute Output
155
2-55
35.55.5
4-5.55.5

Use Case Scenario(s):

1. Battery voltage drops over a specified time.
2. Generator fuel tank level variation in the past day.

Average

Function Description:

This function calculates the average of all values received for a single entity within a specified timespan. The timespan determines how long the function will hold the values coming in for before it calculates an average.

NOTE
The function will average the values being received over a rolling timespan. Therefore, once the timespan has elapsed, newer values will be added to the calculation while values older than the timespan provided will be forgotten.

Function Structure:

Figure 2 - Average

Inputs Required:

  • Value - A decimal/integer used to calculate the average.
  • Timespan - The specific timespan over which the entity’s values will be averaged (HH:MM:SS).

Output Expected:

  • Decimal/Integer - The function returns an average of all values received for the entity provided.

Use Case Example(s):

ExampleValueTimespanAverage Output
12, 3, 4, 501:00:003.5
22, -3, 4, -502:30:00-0.5
32.5, 3, 4.5, 503:00:003.75
42.5, -3, 4.5, -501:45:00-0.25
INFO
The number of values that will be averaged in the specified timespan will be dependent on the frequency of the data sending for the entity being assessed. ie: if a value updates every 2 minutes and the average of those values over 20 minutes is required, the function would be averaging 10 data points.

Use Case Scenario(s):

1. Average temperature of server room within a 24-hour timeframe.
2. Average fuel used running a generator to power a site for a 2 hours load shedding timeslot.

Count

Function Description:

This function counts the number of values (individual data points) received for the entity being assessed within a rolling timespan.

Function Structure:

Figure 3 - Count

Inputs Required:

  • Value - A linked entity for which the number of data points will be counted (tallied) for the specified timespan. Note that this is not limited to values (integers or decimals). Any data type is accepted.
  • Timespan - The timespan required for the tally of the data points received by the entity linked. Note that the function does NOT reset after the specified timespan, but rather it operates as a rolling timeframe, in which the newer data points will come in and replace older data points in the count.

Output Expected:

  • Integer - The function returns a count of all data points received within the specified timespan.

Use Case Example(s):

Example 1

DateTimeValueTimespanCount Output
10:00:001600:05:001
10:01:001500:05:002
10:02:008.900:05:003
10:03:00700:05:004
10:04:00700:05:005
10:05:001900:05:006
10:06:001200:05:006
10:07:0015.900:05:007
10:07:301000:05:007
10:08:0013.600:05:007

In the VALUE column, each data point comes in at a different DateTime (like in the above example) but is condensed for the next few examples. The Frequency column shows how often that entity receives data points.

ExampleValues (data set)Entity Frequency (sec)TimespanCount Output
215; 18.7; 3.4; 990001:00:004
3“abc”; “def”; “hij”; “klm”; “nop”; “qrs”12000:10:005
4n/a 00:02:001
5100; 620; 25060002:00:003

Use Case Scenario(s):

1. In order to bill a client, the frequency of data being sent for one site for a day needs to be assessed.
2. Set up an alarm if the count for a sensor that should be sending a data point every minute stops counting, or drops below a count of 10 for a timespan of 10 minutes.

Delta

Function Description:

This function calculates the difference between two data points (integers or decimals) received for an entity within a specified timespan.

NOTE
The Delta function will take the value of an entity at the start of the rolling timespan, and compared it to the value of the entity at the end of the timespan to provide the value difference. If the entity value changes multiple times within the specified timespan, the Delta function will continue to use the entity value at the onset of the timer to compare against the value. See the example below for further context.

Function Structure:

Figure 4 - Delta

Inputs Required:

  • Value – The entity being assessed in order to calculate the difference between two data points at the start and end of the specified timespan. Data Type must be an integer or a decimal value.
  • Timespan - The timespan (HH:MM:SS) set in order for the function to know which value to hold for the starting time, and which value it should compared to at the end time, in order for find the delta (or difference between the two values).

Output Expected:

  • Decimal/Integer - The function returns the delta (difference) value for an entity over the specified timespan. The output data type will be that of the assessed entity’s data type (integer or decimal).

Use Case Example(s):

DateTimeValueTimespanDelta OutputComparison values
10:00:005000:10:00050-50
10:02:005000:10:00050-50
10:04:006100:10:001161-50
10:06:006200:10:001262-50
10:08:006000:10:001060-50
10:10:006300:10:001363-50
10:12:006700:10:001767-50
10:14:007000:10:00970-61
10:16:008000:10:001880-62
10:18:008800:10:002888-60
10:20:009000:10:002790-63
10:22:008000:10:001380-67
10:24:005000:10:00-2050-70
10:26:005000:10:00-3050-80

Use Case Scenario(s):

1. Monitor the temperature fluctuations in a server room, and raise an alarm if there is a sudden increase in temperature (large positive delta output).
2. Calculate the distance in kilometers that a salesperson travels in a day.

Multi Division

Function Description:

This function will divide all values received, starting with the first value, and dividing through the sequence of values provided thereafter. Therefore if 3 values are provided, the first value will be divided by the second, and the result will then be divided by the third as the final result.

Function Structure:

Figure 5 - Multi Division

Inputs Required:

  • Value – An entity sending values of data type integer or decimal. Note that other math functions can be used within this function in order to create a more elaborate function, as long as the output is of integer or decimal data type.

    NOTE
    A minimum of two values is required for the function to operate as intended. If only one entity is linked within the function, the output will be the value of that entity.

Output Expected:

  • Decimal/Integer - The function returns the answer to the Division sum in decimal format, after dividing all the numbers received in sequence.

Use Case Example(s):

ExampleValuesMulti Division Output
110, 5, 40.5
21000, -10, 10-10
31, 2, 30.167
41010

Use Case Scenario(s):

1. If you would like to convert kilometers into meters, or hours into days.
2. You could use this in conjunction with other math functions to create the formula to convert degrees Fahrenheit into degrees Celsius as shown in the Figure 6 below.

Figure 6 - Convert Fahrenheit To Celsius

NOTE
Once an entity is linked to the value input space, a space for a second value will appear. This allows the user to have multiple inputs for this function. The user can also use this function in conjunction with other math functions, as shown in Figure 6 - Convert Fahrenheit to Celsius.

Multi Max

Function Description:

This function outputs the live maximum value from a set of data points.

Function Structure:

Entity Functions: Multi Max

Figure 7 - Multi Max structure

Inputs Required:

  • Value - A data point of type int or double. The value box allows for one or more inputs. Once the first value is linked to the input block, a space for another value input will appear.

Output Expected:

  • Int/Double - The function returns the maximum value of the data points provided in integer or double format.
NOTE
The output will always be the current maximum value of the set of data being assessed by the function. The function does not hold the highest value it has ever recorded, but rather resets to match the maximum live value based on the inputs.

Use Case Example(s):

ExampleValue 1Value 2Value 3Value 4Value 5Multi Max (output)
1101112131414
2-49.63  9.6
30894589 89

Use Case Scenario(s):

  1. To figure out the hottest room temperature in a building for a certain floor. This could be useful in detecting the start of a fire in order to begin assessment as soon as possible, and possibly evacuation procedures.
  2. Outputting the maximum current for a three phase meter. This output can then be used to raise an alarm for that meter should the value raise above a certain value.

Multi Min

Function Description:

This function outputs the live minimum value from a set of data points.

Function Structure:

Entity Functions: Multi Min

Figure 8 - Multi Min structure

Inputs Required:

  • Value - A data point of type int or double. The value box allows for one or more inputs. Once the first value is linked to the input block, a space for another value input will appear.

Output Expected:

  • Int/Double - The function returns the minimum value of the data points provided in integer or double format.
NOTE
The output will always be the current minimum value of the set of data being assessed by the function. The function does not hold the lowest value it has ever recorded, but rather resets to match the minimum live value based on the inputs.

Use Case Example(s):

ExampleValue 1Value 2Value 3Value 4Value 5Multi Max (output)
1101112131410
2-49.63  -4
30894589 0

Use Case Scenario(s):

  1. Assessing multiple batteries as a backup power source for a building, output the lowest remaining capacity being recorded on these batteries such that an alarm can be raised when any of the batteries’ capacity drops below a certain percentage.
  2. Outputting the minimum current for a three phase meter. This output can then be used to assess whether there is a phase not being utilised on a meter. This scenario could be used in conjunction with the multi max function in order to determine the difference between the maximum and minimum currents on a meter such that load balancing can be done.

Multi Product

Function Description:

This function will multiply all values received, starting with the first value, and multiplying through the sequence of values provided thereafter. Therefore if 3 values are provided, the first value will be multiplied by the second, and the result will then be multiplied by the third as the final result.

Function Structure:

Figure 9 - Multi Product

Inputs Required:

  • Value - An entity sending values of data type integer or decimal. Note that other math functions can be used within this function in order to create a more elaborate function, as long as the the output is of integer or decimal data type.
NOTE
A minimum of two values is required for the function to operate as intended. If only one entity is linked within the function, the output will be the value of that entity.

Output Expected:

  • Decimal/Integer - The function returns the answer to the Product (multiplication) sum in decimal format, after multiplying all the numbers received in sequence.

Use Case Example(s):

ExampleValuesMulti Product Output
11, 2, 3, 4, 5.0, 6, 7, 8.1, 9, 103674160
212, 372
31, -1, 2-2
45050

Use Case Scenario(s):

1. Use in order to convert days to hours, or kilometres to metres.
2. Calculate the volume of a cube when given the length, width and height.

NOTE
Once an entity is linked to the value input space, a space for a second value will appear. This allows the user to have multiple inputs for this function. The user can also use this function in conjunction with other math functions, as shown in Figure - Convert Fahrenheit to Celsius.

Multi Subtraction

Function Description:

This function will subtract all values received, starting with the first value, and subtracting through the sequence of values provided thereafter. Therefore if 3 values are provided, the second value will be subtracted from the first, and then the third number will be subtracted from the first result to provide the final result of the subtraction sequence.

Function Structure:

Figure 10 - Multi Subtract

Inputs Required:

  • Value - An entity sending values of data type integer or decimal. Note that other math functions can be used within this function in order to create a more elaborate function, so long as the output is of integer or decimal data type.
NOTE
A minimum of two values is required for the function to operate as intended. If only one entity is linked within the function, the output will be the value of that entity.

Output Expected:

  • Decimal/Integer - The function returns the answer to the Subtraction sum in decimal format, after subtracting all the numbers received in sequence.

Use Case Example(s):

ExampleValuesMulti Subtraction Output
1100, 15, 4, 40, 1.5, 5.833.7
210, 5, -49
31, 2, 3-4
41010

Use Case Scenario(s):

1. How much voltage did a battery consume within the last month.
2. How many litres of fuel is left in the bowser after refueling generators.

NOTE
Once an entity is linked to the value input space, a space for a second value will appear. This allows the user to have multiple inputs for this function. The user can also use this function in conjunction with other math functions, as shown in Figure - Convert Fahrenheit to Celsius.

Multi Sum

Function Description:

This function will add all values received, starting with the first value, and adding the rest through the sequence of values provided thereafter. Therefore if 3 values are provided, the first value will be added to the second, and the third value added to the result of the first sum to provide the final result.

Function Structure:

Figure 11 - Multi Sum

Inputs Required:

  • Value - An entity sending values of data type integer or decimal. Note that other math functions can be used within this function in order to create a more elaborate function, as long as the the output is of integer or decimal data type.
NOTE
A minimum of two values is required for the function to operate as intended. If only one entity is linked within the function, the output will be the value of that entity.

Output Expected:

  • Decimal/Integer - The function returns the answer to the Sum in decimal format, after adding all the numbers received in sequence.

Use Case Example(s):

ExampleValuesMulti Sum Output
11, 2, 3, 4.0, 5.0, 6, 7, 8.1, 9, 1055.1
2123, 456, 7891368.0
31010

Use Case Scenario(s):

1. With a diesel generator, how much fuel did it consume within the last month.
2. What were my personal expenses for the month. See Figure 9 - Sum expenses scenario for a build use case.

Figure 12 - Sum Expenses Scenario

NOTE
Once an entity is linked to the value input space, a space for a second value will appear. This allows the user to have multiple inputs for this function. The user can also use this function in conjunction with other math functions, as shown in Figure - Sum Expenses Scenario.

To The Power Of

Function Description:

This function will compute an entity’s value to the power of a specified exponent. In layman’s terms, an entity value will be multiplied by itself as many times as is specified by the value of the exponent.

Function Structure:

Figure 13 - To The Power Of

Inputs Required:

  • Base - An entity sending values of data type integer or decimal, that will be computed to the power of the Exponent.
  • Exponent - A value that determines how many times to use the base number in multiplication.

Output Expected:

  • Decimal/Integer - The function returns the answer (integer or decimal format) to the Power of computation.

Use Case Example(s):

ExampleBaseExponentTo The Power Of Output (Value)
12224
260603216000

Use Case Scenario(s):

1. With the monitoring of temperatures, if a gauge reaches twice its recommended temperature, raise an alarm.
2. If a vehicle exceeds a speed limit of three times the minimum speed, raise an alarm.

Root

Function Description:

A root of a number is calculated by dividing the number by itself an exact number of times specified by the root factor. The most common root types are Square Root, √a, and Cubed Root, 3√a.

Function Structure:

Figure 14 - Root

Inputs Required:

  • Value - An entity sending values of data type integer or decimal, that will be the base Value. The value that is being rooted by the specified factor.
  • Factor - A value of data type integer or decimal, by with the Value will be rooted. Common Factor values are 2, for square root, and 3, for cubed root.

Output Expected:

  • Decimal/Integer - The function returns the answer (integer or decimal format) to the Root computation.

Use Case Example(s):

ExampleValueFactorRoot Return (Value)
165536416
2144212
372939
4500055.493
5144-20.083
6-1442NaN

Use Case Scenario(s):

1. To measure the consumption per square meter within a building for energy saving.

Running Total

Function Description:

This function sums up the number of all values received for a single entity continuously.

Function Structure:

Figure 15 - Running Total

Inputs Required:

  • Value - An entity whose values (of integer or decimal data type) are to be continuously added together.

Output Expected:

  • Decimal/Integer - The function returns the sum of the values of the entity being assessed as they come in, in integer or decimal format.

Use Case Example(s):

ExampleValuesRunning Total Output
12, 3, 4, 514
22, -3, 4, -5-2
32.5, 3, 4.5, 515
42.5, 3, -4.5, -5-4

Use Case Scenario(s):

1. Odometer value for a car that keeps adding more kilometers to the total as the car travels.
2. Calculate the total runtime of a generator, which should never reset such that proper service schedules can be maintained.
3. Calculate the total energy consumption of a household since installation of the energy meter.

Sum

Function Description:

This function sums up the number of all values received for a single entity for a specified rolling timespan.

Function Structure:

Figure 16 - Sum

Inputs Required:

  • Value - An entity whose values (of integer or decimal data type) are to be added together for the specified rolling timespan.
  • Timespan - The specific timespan over which the entity’s values will be summed/added (HH:MM:SS). Note that this is a rolling timespan, which means that as newer values for the entity are received, the values older than the specified timespan will be replaced with the new values in the sum.

Output Expected:

  • Decimal/Integer - The function returns the sum of the values received by the entity being assessed over the specified rolling timespan.

Use Case Example(s):

DateTimeValueTimespanSum OutputValues Being Summed
10:00:002000:10:002020
10:02:001400:10:003420+14
10:04:002100:10:005520+14+21
10:06:0022.500:10:0077.520+14+21+22.5
10:08:002000:10:0097.520+14+21+22.5+20
10:10:002000:10:00117.520+14+21+22.5+20+20
10:12:002900:10:00126.514+21+22.5+20+20+29
10:14:001800:10:00130.521+22.5+20+20+29+18
10:16:0015.500:10:0012522.5+20+20+29+18+15.5
10:18:001900:10:00121.520+20+29+18+15.5+19
10:20:002200:10:00123.520+29+18+15.5+19+22
10:22:0022.500:10:0012629+18+15.5+19+22+22.5
10:24:002600:10:0012318+15.5+19+22+22.5+26
10:26:002600:10:0013115.5+19+22+22.5+26+26

Use Case Scenario(s):

1. Calculating the total energy consumption for a day.
2. Door opening and closing over a specified time. If, when the door is open, the solution is configured to send a 1, and a 0 if the door is closed, the sum result will be how many times the door was opened within the specified timespan.

Mode

Function Description:

This function calculates the mode of a range of values over a specified timespan. In basic statistics, the mode is the most frequently occurring value on the list.

NOTE
If the given range of values contains more than one “potential” mode value (e.g. both 3 and 4 qualify for mode with the same number of elements), a null is returned.

Function Structure:

Figure 17 - Mode

Inputs Required:

  • Value - An entity whose values (of integer or decimal data type) are to be assessed to find the mode, or most commonly occurring number, from the set of values received for the specified rolling timespan.
  • Timespan - The specific timespan over which the entity’s values will be assessed to find the mode (HH:MM:SS). Note that this is a rolling timespan, which means that as newer values for the entity are received, the values older than the specified timespan will be replaced with the new values for the mode calculation.

Output Expected:

  • Decimal/Integer - The function returns the mode (most commonly occurring value) of the value set received by the entity being assessed over the specified rolling timespan.

Use Case Example(s):

DateTimeValueTimespanMode OutputData Set Being Analysed
10:00:002000:10:002020
10:02:001400:10:00n/a20; 14
10:04:002100:10:00n/a20; 14; 21
10:06:0022.500:10:00n/a20; 14; 21; 22.5
10:08:002000:10:002020; 14; 21; 22.5; 20
10:10:002100:10:00n/a20; 14; 21; 22.5; 20; 21
10:12:002000:10:002014; 21; 22.5; 20; 21; 20
10:14:001800:10:002021; 22.5; 20; 21; 20; 18
10:16:001400:10:002022.5; 20; 21; 20; 18; 14
10:18:001400:10:00n/a20; 21; 20; 18; 14; 14
10:20:002200:10:001421; 20; 18; 14; 14; 22
10:22:001600:10:001420; 18; 14; 14; 22; 16
10:24:001400:10:001418; 14; 14; 22; 16; 14
10:26:002000:10:001414; 14; 22; 16; 14; 20

Use Case Scenario(s):

1.To determine the most common temperature setting in an office room for the working day.
2.To determine which setting the generator was on most regularly throughout the day to correlate with the maintenance schedule.

Median

Function Description:

This function calculates the median of a given range of values over a given timespan. In basic statistics, the median is the middle value in a list, ordered from smallest to largest.

Function Structure:

Figure 18 - Median

Inputs Required:

  • Value - An entity whose values (of integer or decimal data type) are to be assessed to find the median, or middle value, in a set of values ordered from smallest to largest for the specified rolling timespan.
  • Timespan - The specific timespan over which the entity’s values will be assessed to find the median (HH:MM:SS). Note that this is a rolling timespan, which means that as newer values for the entity are received, the values older than the specified timespan will be replaced with the new values for the median calculation.

Output Expected:

  • Decinaml/Integer - The function returns the median (middle number) in a set of values ranging from smallest to largest received by the entity being assessed over the specified rolling timespan.

Use Case Example(s):

DateTimeValueTimespanMedian OutputData Set Being Analysed
10:00:002000:10:002020
10:02:001400:10:001720; 14
10:04:002100:10:002020; 14; 21
10:06:0022.500:10:0020.520; 14; 21; 22.5
10:08:002000:10:002020; 14; 21; 22.5; 20
10:10:002100:10:0020.520; 14; 21; 22.5; 20; 21
10:12:002000:10:0020.514; 21; 22.5; 20; 21; 20
10:14:001800:10:0020.521; 22.5; 20; 21; 20; 18
10:16:001400:10:002022.5; 20; 21; 20; 18; 14
10:18:001400:10:001920; 21; 20; 18; 14; 14
10:20:002200:10:001921; 20; 18; 14; 14; 22
10:22:001600:10:001720; 18; 14; 14; 22; 16
10:24:001400:10:001518; 14; 14; 22; 16; 14
10:26:002000:10:001514; 14; 22; 16; 14; 20

Use Case Scenario(s):

1. Gathering the heights of all children in a classroom, calculating the median value will determine the central height value, in order to divide the children into two groups: Short and Tall.
2. In an office room where people adjust the thermostat constantly due to different comfort levels, the median value can be calculated to determine a temperature that will be fair to all.

Min

Function Description:

This function calculates the minimum number in a set of values received from a single entity for a specified rolling timespan.

Function Structure:

Figure 19 - Min

Inputs Required:

  • Value - An entity whose values (of integer or decimal data type) are to be assessed to find the minimum value in the data set being received during the specified rolling timespan.
  • Timespan - The specific timespan over which the entity’s values will be assessed to find the minimum value (HH:MM:SS). Note that this is a rolling timespan, which means that as newer values for the entity are received, the values older than the specified timespan will be replaced with the new values for the minimum calculation.

Output Expected:

  • Decimal/Integer* - The function returns the minimum value in a set of values received by the entity being assessed over the specified rolling timespan.

Use Case Example(s):

DateTimeValueTimespanMin OutputData Set Being Analysed
10:00:002000:10:002020
10:02:001400:10:001420; 14
10:04:002100:10:001420; 14; 21
10:06:0022.500:10:001420; 14; 21; 22.5
10:08:002000:10:001420; 14; 21; 22.5; 20
10:10:002100:10:001420; 14; 21; 22.5; 20; 21
10:12:002000:10:001414; 21; 22.5; 20; 21; 20
10:14:001800:10:001821; 22.5; 20; 21; 20; 18
10:16:001400:10:001422.5; 20; 21; 20; 18; 14
10:18:00-500:10:00-520; 21; 20; 18; 14; -5
10:20:002200:10:00-521; 20; 18; 14; -5; 22
10:22:00900:10:00-520; 18; 14; -5; 22; 9
10:24:001400:10:00-527; 20; 21; 20; 18; 14
10:26:002000:10:00-514; -5; 22; 9; 14; 20
10:28:001500:10:00-5-5; 22; 9; 14; 20; 15
10:30:001400:10:00922; 9; 14; 20; 15; 14

Use Case Scenario(s):

1. Check the lowest temperature, power and energy readings for the day.
2. Determine the lowest point the voltage drops to for a battery in use.

Max

Function Description:

This function calculates the maximum number in a set of values received from a single entity for a specified rolling timespan.

Function Structure:

Figure 20 - Max

Inputs Required:

  • Value - An entity whose values (of integer or decimal data type) are to be assessed to find the maximum value in the data set being received during the specified rolling timespan.
  • Timespan - The specific timespan over which the entity’s values will be assessed to find the maximum value (HH:MM:SS). Note that this is a rolling timespan, which means that as newer values for the entity are received, the values older than the specified timespan will be replaced with the new values for the maximum calculation.

Output Expected:

  • Decimal/Integer - The function returns the maximum value in a set of values received by the entity being assessed over the specified rolling timespan.

Use Case Example(s):

DateTimeValueTimespanMax OutputData Set Being Analysed
10:00:002000:10:002020
10:02:001400:10:002020; 14
10:04:002100:10:002120; 14; 21
10:06:002700:10:002720; 14; 21; 27
10:08:002000:10:002720; 14; 21; 27; 20
10:10:002100:10:002720; 14; 21; 27; 20; 21
10:12:002000:10:002714; 21; 27; 20; 21; 20
10:14:001800:10:002721; 27; 20; 21; 20; 18
10:16:001400:10:002727; 20; 21; 20; 18; 14
10:18:00-500:10:002120; 21; 20; 18; 14; -5
10:20:00900:10:002121; 20; 18; 14; -5; 9
10:22:002200:10:002220; 18; 14; -5; 9; 9

Use Case Scenario(s):

1. Check highest temperature, power and energy readings for the day.
2. Determine the highest current (amp) draw on a battery is when in use.