It is likely that a number, especially a real number, required as input for an EASAP will represent a measurement of some kind, and then a ‘unit’ of measure will be associated with this number. To accommodate this situation, EASAPs allow the use of ‘units’ to be defined. There are two basic uses of units in an EASAP:
The first case can be handled quite simply by stating the unit of measure for the input in the Label: parameter for the associated REALBOX or INTEGERBOX . For example, if users are to enter the speed of a car, you could specify the Label: parameter as:
Car Speed [mph]
To apply the second use of units, you need to know about some additional capabilities available to you for using pre-existing sets of units and defining new sets of units. These capabilities are supported using the three singleton objects:
|BASE UNITS||Used to define the system of units to be used for the five base dimensions.|
|DEFAULT UNITS||A sub-branch that contains a list of pre-existing sets of units.|
|USER UNITS||Used to define new sets of units not found under DEFAULT UNITS.|
Even though the list of units under the DEFAULT UNITS sub-branch is fairly extensive, it is by no means comprehensive. Therefore, at some time, you may need to create a new set of units to meet the needs of the particular EASAP that you are constructing. You will create new sets of units under the USER UNITS sub-branch. To create a new set of units, you first create a DIMENSIONAL GROUP and then add Child CONVERSION's below the DIMENSIONAL GROUP.
Tip: If the new set of units is to be a sub-set or super-set of an existing set under DEFAULT UNITS, you can copy and paste the relevant DIMENSIONAL GROUP from the DEFAULT UNITS sub-branch on to the USER UNITS sub-branch and then modify the units CONVERSION accordingly.
Once a set of units has been defined, there are uses within an EASAP where either the complete set is referenced by using the DIMENSIONAL GROUP name or an individual unit is referenced by using a Unit: parameter setting of a CONVERSION. The different uses for units are described in the following sections.
There are two areas where using units in REALBOX and INTEGERBOX come into play:
For the first item, all that you do is set the value of the Units: parameter by selecting a name of a DIMENSIONAL GROUP from a CHOICE LIST. This list contains all of the available DIMENSIONAL GROUP's found under both the DEFAULT UNITS and USER UNITS sub-branches. This selection method is highlighted below.
The second item involves selecting a unit name from a CHOICE LIST that will appear at the far right side of the Parameter Value input box. After selection, the unit name will appear after the parameter value separated by a comma as shown below.
By default, the values of all objects having units defined get converted to base units internally within an EASAP. Therefore, when an object name is used in an expression, its value will be evaluated in terms of base units. Now this condition can be over-ridden through use of ‘inline units’.
Inline units are characterized by putting the desired unit name in brackets immediately after the object name. An example is as follows:
W [ft] * t [in]/10
The inline units syntax in the expression above will cause the objects W and t to be evaluated as feet and inches, respectively, instead of the base unit of meters. In the case above, if the objects W and t both had values of 1.0, then W would be converted from 1.0 ft to 0.3048 m and t would be converted from 1.0 in to 0.0254 m.
Inline units will need to be used when users use a mathematical expression containing a number as a term in an INPUTBOX with a units choice list next to it. For example, the expression, W + 1.0, should contain inline units in order to function as expected. The expression should be modified to be:
W + 1.0 [ft]
where ft is the desired unit for the term, 1.0. Otherwise, the 1.0 will be assumed to be in base units of meters, and when the expression is evaluated, 3.281 feet will be added to W instead of just 1.0 foot.