Units of Measure (UOM)
This article covers Seeq's support for units of measure including conversion, mathematical operations, and recognition of datasource units.
Overview
The general units approach in Seeq is to define a set of fundamental dimensions from which all units of measurement (UOM's) can be derived. A dimension is a unit category such as length or time. Within a dimension, units are compatible meaning conversions are available. For example, meter and inch are both of dimension length and therefore compatible. Kilogram and meter are not compatible because they are not in the same dimension.
When a time series has units affiliated with it, Seeq can perform unit conversions and make sensible decisions when performing math and other operations on data. For example, what is greater? 31 °F
or 5 °C
?
Below are tables of the units that are supported by Seeq in each release. In addition to the units listed, many derived units are not listed but still supported. A derived unit is made by using multiplication, division, or powers to combine units. Examples of derived units are kg/s
or m²
. Note that a unit like m²
has several acceptable forms: m²
, m^2
, m*m
, m·m
.
Display Units
This page describes units as they are used in calculation. For presentation purposes, see Display Units.
Datasource Units
See Datasource Unit Handling for configuring units as they come into Seeq from a datasource.
Supported Units
See Supported Units for supported units and prefixes.
Tool and Formula Units
Seeq accepts all listed units and derived units in Seeq formulas and tools. Specific formula functions of interest are convertUnits()
, setUnits()
and reduceUnits()
.
Seeq formula has trouble when units contain parentheses. For example, the 5$/(kg*h).tosignal()
is rejected by Seeq formula. The workaround is to add some 1's like this: 5$/(1kg*1h).tosignal()
Exceptional Units
Some units are harder to express in our dimensional model which can lead to odd behavior. This section documents the most notable examples but you may run across others that behave similarly.
Temperature arithmetic
1m+1ft
is a well-defined formula. The answer could be presented in several different units of measure (meters, feet, miles, centimeters, etc.) but they are all the same after unit conversion. (Seeq will answer 1.3048m
because Seeq converts the second unit into the first unit and then performs the operation.)
Temperature (in C or F) is trickier because it uses relative scales instead of absolute scales. This can lead to some unexpected behavior within Seeq.
Consider this formula: 1C+1F
Seeq's answer is
-16.22C
. This is derived by converting the temperature 1F into C (-17.22C) and then adding.A potential option is
1.5555C.
This is derived from saying a single degree change in Fahrenheit is 5/9s of a degree change in Celsius.Other potential option is
256.93C
. This is derived from changing both units into Kelvin, adding them, and converting back to Celsius.
Consider this formula averaging two temperatures: (30C+90F)/2
The average is the answer Seeq will give, 31.11C
.
The 'degree change' option (second option, hence forth referred to as the "delta calculation") would produce a different (and for averaging purposes, wrong) answer, 80C
.
The 'Kelvin' option (third option), derived from converting to K and back also produces the average, 304.26K or 31.11C.
Therefore, as the default, the averaging behavior makes sense, even if it excludes the ability to do delta calculations. However, it can lead to some puzzling behavior. For instance, 1F+1C
, the reverse of the above formula, results in 34.6F
. This is a different answer from the earlier -16.22C
(even accounting for unit conversion). While initially confusing, this is reasonable behavior. The starting points of 1F
and 1C
are very different, and the deltas added are fairly close. In addition, the averaging behavior we desire still holds:
(1C+1F)/2 = -16.22C/2 = -8.11C = 17.3F
(1F+1C)/2 = 34.6F/2 =17.3F = -8.11C
Normally, unit conversion operations are commutative. The order can be rearranged to get the same results.
(100m/3).convertUnits('cm') == 100m.convertUnits('cm')/3
The answer will be the same regardless of when you decide to convert. However with temperature, we see that the order does matter. Performing a division and then converting is not the same as converting and then dividing.
10F.convertUnits('C')/3 = 4.1C
(10F/3).convertUnits('C')/3 = 5.3C
Delta Temperature
If you would like to perform delta operations such as 1C+1ΔF
, we suggest manually multiplying by the scaling factor.
1C+(1F.setUnits('C') * (5/9))
Seeq does not directly support delta units of any kind.
Percent Units
When performing multiplication or division, Seeq treats %
as a scaling factor (see version note below). When mixing percent and unitless, the unit of the left hand value is used as the output unit. Examples include:
50% * 10 = 500%
10 * 50% = 5
10m * 50% = 5m
50% * 10m = 5m
When performing addition, subtraction, or comparisons, Seeq automatically promotes a unitless value to the unit of the other. Examples include
5m + 1 = 6m
8 - 5m = 3m
(6 > 3m) = true
This helps in normal calculations but can cause confusion when the unit is %
. This demonstrates the special behavior:
100% - 1 = 99%
1 - 100% = -99%
(100% == 1) = false
1 > 50% = false
These all demonstrate how we can’t express that 100% and 1 are the same quantity.
Prior to June 2024 (and R65 and earlier), when performing multiplication or division on signals that mixed unitless and percent, the resulting unit would be percent, regardless of whether the percent value was on the the left or right. Scalar multiplication/division would prefer the left value.
We recommend not using the %
unit. Instead, have a unitless quantity and use Display Units.
Gauge and Absolute Pressure
Seeq has no ability to know the context of a gauge unit to allow it to convert to other pressure expressions.
As such, we do not explicitly include a
or g
to represent absolute or gauge pressure in our units. Instead you can use Display Units to show that distinction.
Conversions from a gauge pressure to an absolute pressure must be done manually. See setUnits()
in the Formula documentation.
All pressure units have this limitation:
UOM | Label | Unsupported Measurement Names |
---|---|---|
Bar |
| barg, bara, bard |
Inches of Water (60 °F) |
| inH20a, inH20g |
Pascal |
| paa, pad, pag |
Pounds Per Square Inch |
| psia, psig, psid |
Actual, Standard and Normal Flow Rates / Volumes
Seeq has no ability to know the context of an actual, standard or normal volume. What definition of standard is being used? What are the relative densities? What temperature and pressure are being converted to?
As such, we do not explicitly include A
, S
or N
as prefixes for volume units. Instead you can use Display Units to show that distinction.
All volume units have this limitation:
UOM | Label | Unsupported Measurement Names |
---|---|---|
Cubic Meter |
| SCM, ACM, NCM |
Cubic Feet |
| SCF, ACF, NCF |
Our smart parsing will sometimes interpret Nm^3
as N^3m^3.
Connector Property Transforms can be used to properly map this on m^3
and then Display Units can be used to display as the desired unit.
Power Triangle
W
(Watt), VA
(Volt-Ampere Apparent) and var
(Volt-Ampere Reactive) are all supported but J/s
will map onto var
.
When doing math with these signals, you may need to set the units of the result. For example, the formula $myW + $myVA
will result in a signal with units of Watts. If one of the others was desired, you could change the formula to ($myW + $myVA).convertUnits('var')
.
Multiplier numbers aren't supported
Units with numbers in the unit name such as 1000m
are not supported. In this example, this is not the number 1000
with the unit m
, it is a unit called 1000m
.
Sample with | ||
---|---|---|
Value | UOM | |
Supported | 14 |
|
Not supported | 14 |
|
Most units of this form can be transformed to a unit Seeq will recognize. However, depending on the intention, there may not be a transformation for units such as 1000M3/D
. If (1000m)^3/d
was intended, this can be transformed to km^3/d
. There is no transform for 1000(m^3)/d
.
Examples | |
---|---|
Unrecognized Unit | Recognized Alternate Unit |
|
|
|
|
| not supported |
| not supported |
These limitations can be bypassed by Display Units for presentation purposes.
Currency
There is no currency conversion. Attempting to mix currencies results in an error.
Note that all units must come after the number, so it is expressed 5$
and not $5
.
Verifying Seeq's Unit Conversions
Are you curious about the unit conversions that Seeq is using? You can check for yourself using the Formula tool.
Step 1: Create a formula for constant signal with value of 1 meter
.
1m.toSignal()
Step 2: Create a 2nd formula converting that signal to new units (feet)
$a.convertUnits('ft')
where $a
is the signal from Step 1. You'll see that it now has a value of 3.2808 ft
. If you had used units of Weber
instead of feet
,
$a.convertUnits('Wb')
an error is returned: m is not compatible with Wb
Don't forget about the formula parentheses tip mentioned earlier in this article.