Units checking proceeds from the inside out, starting with variables and building up to expressions. If there is an error detected in any sub-expression, the remainder of the expression can only be partially checked. Thus, if you try to add Miles and Kilometers, then divide by Hours, the resulting units are treated as units in error. The following are the most common sources of errors:
• | The left and right hand side of an equation do not have the same units of measure. |
• | Addition, subtraction, and comparison (<, = and so on) are performed on variables (or expressions) having different units of measure. |
• | Functions are called with arguments having units of measure inconsistent with what the function requires. |
Because much of the units checking is performed on expressions, it is necessary to determine the units of measure for an expression. Multiplication causes the units of measure to be multiplied. Division causes the units of measure to be divided. Each of the functions has defined units of measure for its output. (Lookup functions also have defined units of measure for their output.)
Units are compared according to the exact names of the units. Thus, Person and People are treated as different units, as are Mile and Miles. If you are using plurals and different names with the same meaning, you must explicitly set up an equivalence as part of Vensim's startup procedure. The section on Units Synonyms below describes this.