Creating Equations for Units

When you create a unit of measure, you can define an equation that tells the software how to calculate the unit of measure.

Define an equation by referencing other units and one or more operators.

For example, to create a unit of measure called "kilometers per day", you'd define an equation ("Kilometers/Day") that references two other existing units, "kilometers" and "days", with the operator "/". For a "cubic yard" unit of measure, the equation ("yards^3") is created by referencing the unit of "yard" and specifying that the equation should be cubed ("^3"). The referenced units of measure don't need to be defined elsewhere.

To create equations, you have to observe the following rules:

Resolving Units with Equations

When the software encounters a unit with an equation, it substitutes the equation in place of the unit. If the substitution includes other units with equations, it substitutes those in turn, until only primary units (those with no equations) remain. Aliases are also replaced by their corresponding unit.

The resulting expression is then simplified by canceling entries in the numerator and denominator. Unit equations serve as a bridge, allowing the variable "speed = distance/duration" to have units "Meters Per Second" when "distance" has units "Meter" and "duration" has units "Seconds." In detail:

  1. The units for "distance/duration" are computed by the equation "Meter/Seconds".
  2. Meter is an alias and is replaced with the primary unit "Meters".
  3. The unit "Meters Per Second" is replaced by its equation "Meters/Seconds", which is a built in definition.
  4. The resulting expressions are reduced to "Meters^1*Seconds^-1", with the order alphabetical by positive exponent then alphabetical by negative exponent.
  5. The two reduced expressions are compared. In this case, they match, so the units are reported as a match for this variable.

All of this computation is done in the background, so that you can immediately see which variables have issues with their units by selecting from the list of unit warnings appearing in the Run toolbar.

Concept Link IconSee Also