The Static Units System in Ptolemy II provides the means to constrain a model in terms of the allowable units of measure for the actors, and ports on the actors. It is static, in that the constraints do not relevant when the model is run. Rather, the constraints are used to determine if the model is correct.
In order to illustrate these concepts, the Fermenter model, shown here, will be used.
The purpose of this model is simulate the growth process in a fermenter. There are three submodels; 1) growth models the number of cells being produced as a function of the current number of cells and the vat temperature, 2) HeatProduction models the amount of heat produced (in calories) as a function of the amount of work done (in joules), and 3) HeatExchanger models the removal of heat from the vat as a function of the rate at which water flows through the cooling jacket around the vat.
Note the units column which shows that, the TempVessel port has units degree, the TempCW port has units degree, the output port has units calories/second, and, the flow port has units gallons/hour.
This shows that there are two units constraints for the AddSubtract actor. The expression $plus=$minus says that the plus and minus ports must have the same units. That is, it is incorrect to subtract gallons/hour from gallons. Similarly, the expression $output=$minus says that the output port must have the same units as the minus port.
Some of the units constraints in the model are inconsistent. In addition to the HeatExchanger port unitconstraints, and AddSubtract actor unit constraints illustrated above, the HeatProduction.heat port has the units calories. Since the HeatProduction.heat port is connected (via the AddSubtract actor) to the HeatExchanger.output port which has units calories/second the model is inconsistent in terms of the units constraints.
The UnitsConstraint Solver can be used to discover, and analyse these inconsistencies. (Right mouse-click and select UnitsConstraint Solver).