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 would 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 do not need to be defined elsewhere.

To create equations, you must 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 thus 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 as "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.

Concept Link IconSee Also