# Units

Units are at the heart of Insight Maker. The flows into a stock should have the same units as the contents of that stock. Similarly, you should be able to specify the units for the different variables and converters in your model.

Insight Maker allows you to enforce units using its unit mechanisms. As you construct your model, you may define the units for the different parts of your model. For instance, you may add a stock representing a lake with units of Cubic Meters. You may have a river flowing into the lake with units of Cubic Meters per Second. When you run a simulation, Insight Maker will check to make sure that the units you have defined are consistent. If they are not consistent (for instance you try to subtract a number with units of Meters from one with units of Liters) Insight Maker will display an error and terminate the simulation.

When you define a number in Insight Maker, it is automatically defined as Unitless. When the value of a valued primitive (stock, flow, variable, or converter) whose units are defined is referenced elsewhere in your model, Insight Maker will evaluate its equation. If the result of this evaluation is a Unitless number, Insight Maker will then assign the units of that primitive to the value. If, however, the value is not Unitless and the units conflict with the primitive’s units, then an error will be displayed.

You may define a number with specified units in your equations using a special, curly-bracket notation like follows:

`{2 Meters} + {10 Centimeters}`

The above equation defines a value of 2.1 meters. Insight Maker has the ability to carry out automatic unit conversion between certain sets of units. If you subtract a value of 10 centimeters from a value of 2 meters the result will be 190 centimeters or 1.9 meters.

As another example, we could calculate the production of a product (we'll call then "Widgets") over time:

`{7 Widgets/Year} * {10 Years}`

This would evaluate to 70 Widgets.

Here are some additional examples of unit operations within Insight Maker:

 Equation Results `1 + 3` 4 (No Units) `{1 Centimeter} + {3 Centimeters}` 4 Centimeters `{1 Meter} + {3 Centimeters}` 1.03 Meters `{1 Grams} + {3 Centimeters}` Error – Inconsistent Units `1 + {3 Centimeters}` Error – Inconsistent Units `2 * 7` 14 (No Units) `2 * {7 Meters}` 14 Meters `{2 Meters} * {7 Meters}` 14 Square Meters `{2 Meters} / {4 Seconds}` 0.5 Meters / Seconds `{2 Meters/Seconds} / 4` 0.5 Meters/Seconds `{25 Square Meters}^(1/2)` 5 Meters `3 * {200 Centimeters} * {4 Square Meters}` 24 Cubic Meters `{100 Inches} - {1 Meters}` 154 Centimeters `{10 Meters/Second} * {1 Minute}` 600 Meters `{7 Widgets/Years^2} * {10 Years}` 70 Widgets/Year

Insight Maker comes with a large number of units built-in. However, it also contains the ability for you to define custom units, like "Widgets".