# Calculating Quantity-Based and Non-Quantity-Based in DIAdem

Edition Date: June 2018
Part Number: 370858P-01
View Product Info DIAdem 2017 Help DIAdem 2018 Help DIAdem 2019 Help DIAdem 2020 Help DIAdem 2020 SP1 Help

When executing quantity-based calculations, DIAdem checks whether the selected physical quantities can be used in the same calculation. For example, DIAdem can divide a time and a length but cannot add these quantities. If DIAdem cannot execute the calculation due to inappropriate physical quantities, DIAdem displays an error message.

If two units that are to be calculated belong to the same physical quantity, DIAdem automatically converts the units in such a way that DIAdem can execute the calculation. For example, DIAdem can add lengths that are in meters and inches. For example, if you add 1 cm (centimeter) and 1 in (inch), the result is 3.54 cm. If you do not execute the calculation quantity-based, the result is the numeric value 2. For a quantity-based calculation the quantities used must have a unit symbol.

To calculate quantity-based, you must click Calculate Quantity-Based on the DIAdem ANALYSIS toolbar or assign the value TRUE to the CalcQuantityBased variable.

## Quantity-Based Calculations

To calculate quantity-based in DIAdem, the following conditions must apply:

• All the input data that is included in a calculation has a unit:
• All the input data that is included in the calculation must have unit symbols that are listed in the units catalog. If you use an unknown unit symbol, you must add the unit to the units catalog before the quantity-based calculation starts.
• DIAdem specifies the unit symbol in calculations with numeric channels from the Unit channel property. When calculating with waveform channels, DIAdem also uses the Waveform x-unit as an x-channel unit.
• Several functions use scalar input parameters. These functions calculate with scalar values and use either a fixed unit or the unit of an input, depending on the function. Refer to the respective function Help pages for further information.
• For quantity-based calculations the following rules apply for the physical quantities:

• DIAdem does not change the physical quantity when you add, subtract, average, or execute similar operations. In these functions, DIAdem transfers the input quantity to the output. If you execute calculations with different physical quantities with these functions, an error message displays. For example, you cannot add length and electrical voltage.
• For multiplication, division, differentiation, integration, exponentiation, root extraction, or similar operations, DIAdem specifies the result quantity using the physical dimensions of the physical input quantities. The dimension of the result quantity must have exponential values. For example, you can extract the square root of a surface and gain a length. However, you cannot calculate the square root of a volume because this calculation results in a non-integer exponent in the dimension.
• Several functions require specific physical input quantities and specify the physical result quantity. If the input data has a physical quantity that differs from the required physical quantity, an error message displays. For example, if the function requires time data, you can specify this data in hours, minutes, or other time units. However, if the data you use has physical quantities that specify, for example, a length, an error message displays.
• If the specified units are assigned to different categories, multiplication and division is not possible. If at least one of the specified categories is not assigned to a category, a calculation is possible.
• All results have a unit. DIAdem specifies the unit as follows:
• The result data of a quantity-based calculation are physical quantities and therefore always have a unit. The calculation rules determine the physical quantity of the result data. For example, if you multiply a force by a length, the result quantity is energy.
• If both of the specified units in a division have the same dimension, the result unit is without dimension and without category. In this case the result unit is "1".
• DIAdem specifies the unit of the physical quantity in such a way that the program executes as few conversions as possible and that a unit from the units catalog is the result.
• If only one of the specified units has a category in additions, multiplications, or divisions, the result unit uses this category.
• If the units used are non-linear or have an offset, DIAdem always converts these units into a linear unit. For example, the units °C (degrees Celsius) and °F (degrees Fahrenheit) have an offset. Therefore DIAdem uses the base unit K (Kelvin) when these temperatures are included in a calculation.

If the units catalog does not contain a unit for the physical quantity of a result, DIAdem specifies this result unit formally from the input values. DIAdem sets the units of the physical input values in parenthesis, in the result units. For example, if you multiply a velocity with the unit m/s by a length with the unit m, the result unit is the unit (m^2)/(s). You cannot use the result for further quantity-based calculations, because the result unit is not in the units catalog. You must first add the result quantity to the units catalog.

• DIAdem saves the result units from channel calculations in the Unit property of the result channel. If you calculate with waveform channels, DIAdem also saves the Waveform x-unit.
• If your calculation returns scalar results, the function specifies the result unit. This unit can be a fixed unit or the same unit as an input channel.

## Non-Quantity-Based Calculations

• In non-quantity-based calculations, the units used do not need to be in the Units Catalog and can also be empty.
• If DIAdem calculates non-quantity-based, DIAdem only uses the numeric values for the calculation. The above mentioned rules for physical quantities do not apply. For example, you can add a length and an electrical voltage in non-quantity-based calculations. Note  Additional rules apply for the Calculator and the Calculate command. Refer to the Help page of the Calculate command for further information. The Input and Result Quantities for Quantity-Based Calculations page contains an overview of the input quantities and result quantities of all functions.