# Appendix B - Unit Analysis

Purpose and Context:

Unit analysis is a simple way for you to stay in control of the process of building and simulating dynamic models. In order to assign a unit of measure to a stock, flow or converter in your model, you must think carefully about what the model element is, how it works, and how it relates to other model elements. Whenever you check the consistency of units - making sure that left and right hand sides of equations resolve to the same units of measure, or ensuring that stocks in a conserved flow chain all have the same units of measure - your thinking about how the process works is necessarily taken to a deeper level. Unit Analysis is a great vehicle for minimizing the number of silly mistakes in your models. More important, it is an excellent vehicle for maximizing the conceptual clarity of your models.

Unit Analysis is primarily a mental discipline. If you don't practice it in the construction of your models, no one will make you do it. That said, the software's unit analysis capabilities greatly facilitate the process of conducting unit analysis in your models.

Basic Operations:

There are two basic operations associated with unit analysis. The first operation involves assigning a unit of measure to the model variable. The second operation of unit analysis is the unit check, which ensures that left and right hand sides of equations have consistent units, and that conserved flow chains have consistent units. You can accomplish both operations by clicking on the Units... button within a stock, converter, or flow dialog.

Assigning units of measure. Figure 4-43 shows the basic unit assignment dialog for a stock or converter, in this case for a converter.

Figure 4-43 Assigning Units of Measure

Note that you can directly assign units for Stocks and converters. Units for flows are assigned by the software based on the units you have assigned to their associated stocks. For example, if you assigned a unit of "widgets" to a stock, and your model is running in months, any flows into or out of the stock would automatically be assigned the units "widgets per month".

Checking the units. The second basic operation associated with unit analysis, the unit check, can easily be accomplished by clicking the Check Units Now button within the Define Units dialog. A unit check adds detail to the dialog, as shown in Figure 4-44, below:

Figure 4-44 Define Units Dialog

In addition to this mode of checking units as you are putting the model together, it is possible to check units in a "batch" mode. To do so, simply choose Check Units under the Run menu. Doing so will highlight all model variables with inconsistent units. You can then go into each variable to resolve the inconsistency.

Finally, when "Enforce Unit Consistency" is checked in the Model Prefs... dialog, an "!" will appear in any entity which fails the unit consistency check. You will be unable to run a simulation until all inconsistencies are resolved.

Notes:

Note that the unit analysis capabilities in the software are not applicable to the following model constructs.

- Arrays

- Outflows from conveyors

- Outflows from ovens

- Unit-converted flows