Functions > Utility Functions > Example: Explaining the SIUnitsOf Function
Example: Explaining the SIUnitsOf Function
This example explains the SIUnitsOf function and how it is used to strip the unit of a united variable under the three worksheet Unit Systems - SI, USCS, and CGS.
Prerequisite:
Define three united variables.
Click to copy this expression
Click to copy this expression
Click to copy this expression
On the Math Formatting tab, in the Results group, select (Decimal) from the Result Format list.
Important Information:
Follow the instructions, for each of the following three sections, in the order in which they appear.
The explanations provided in a particular section are valid only when the Unit System is set as specified in Step#2 of that section.
Unit System: SI (m, kg, s)
1. Select the math regions in Step#3 through Step#5 below and then on the Calculation tab, in the Controls group, click Disable Region.
2. On the Math tab, in the Units group, set the worksheet Unit System to SI.
3. Evaluate the three variables.
Click to copy this expression
Click to copy this expression
Click to copy this expression
Mathcad evaluates each variable by converting its original unit to its counterpart in the current Unit System.
4. Apply the SIUnitsOf function to each variable.
Click to copy this expression
Click to copy this expression
Click to copy this expression
The SIUnitsOf function returns the dimension (magnitude and unit) of each variable's original unit scaled to the default SI Unit System. Since the Unit System is set to SI, the scale factor for all variable units is 1.
5. Divide each variable by its SIUnitsOf value.
Click to copy this expression
Click to copy this expression
Click to copy this expression
The result of the division is always a unitless value that equals the magnitude of the variable when evaluated under the selected Unit System.
In the case of variable a, the division operation divides 0.914 m by 1 m and returns the unitless result of 0.914.
This is the technique that Mathcad provides for stripping the unit of a united variable.
6. Before proceeding to the next section, select the math regions in Step#3 through Step#5 above and then on the Calculation tab, in the Controls group, click Disable Region.
Unit System: USCS (ft, lb, s)
1. Select the math regions in Step#3 through Step#5 below and then on the Calculation tab, in the Controls group, click Disable Region.
2. Set the worksheet Unit System to USCS.
3. Evaluate the three variables.
Click to copy this expression
Click to copy this expression
Click to copy this expression
Mathcad evaluates each variable by converting its original unit to its counterpart in the current Unit System.
4. Apply the SIUnitsOf function to each variable.
Click to copy this expression
Click to copy this expression
Click to copy this expression
The SIUnitsOf function returns the dimensions (magnitude and unit) of the variable's original unit scaled to the current Unit System.
To understand where the above scaled values come from, evaluate the SI units (m, kg, s) under the currently set USCS units (ft, lb, s), as follows:
Click to copy this expression
Click to copy this expression
Click to copy this expression
5. Divide each variable by its SIUnitsOf value.
Click to copy this expression
Click to copy this expression
Click to copy this expression
The results are identical to the previous results under the SI Unit System.
In the case of variable b, the division operation divides 0.331 lb by 2.205 lb and returns the unitless result of 0.15.
6. Before proceeding to the next section, select the math regions in Step#3 through Step#5 above and then on the Calculation tab, in the Controls group, click Disable Region.
Unit System: CGS (cm, gm, s)
1. Select the math regions in Step#3 through Step#5 below and then on the Calculation tab, in the Controls group, click Disable Region.
2. Set the worksheet Unit System to CGS.
3. Evaluate the three variables.
Click to copy this expression
Click to copy this expression
Click to copy this expression
Mathcad evaluates each variable by converting its original unit to its counterpart in the current Unit System.
4. Apply the SIUnitsOf function to each variable.
Click to copy this expression
Click to copy this expression
Click to copy this expression
The SIUnitsOf function returns the dimensions (magnitude and unit) of the variable's original unit scaled to the CGS Unit System.
To understand where the above scaled values come from, evaluate the SI units (m, kg, s) in terms of the CGS units (cm, gm, s), as follows:
Click to copy this expression
Click to copy this expression
Click to copy this expression
5. Divide each variable by its SIUnitsOf value.
Click to copy this expression
Click to copy this expression
Click to copy this expression
The results are identical to the previous results under the SI Unit System.
In the case of variable c, the division operation divides 240 s by 1 s and returns the unitless result of 240.
6. Before starting the example over, select the math regions in Step#3 through Step#5 above and then on the Calculation tab, in the Controls group, click Disable Region.
Was this helpful?