Dimensional analysis is the idea of attaching units of measurement (eg metre or second) to the quantities being computed. It provides an additional constraint that the system must satisfy, reducing the chance of wiring errors. Two different units being added together will throw up an error — you cannot add 2 metres to 3 kilograms. But it should be possible add 2 metres to 3 feet, and get the correct answer. You may need to explicitly add a multiply operation to convert from one unit to another, for example, dividing the 3 feet by 3.281 before adding it to the 2 metres, providing a total of 2.914 meters.
Using Dimensional Analysis in Minsky
To attach units to quantities in Minsky, you use the units
field of the variable/parameters/constants edit dialog box. Each word
typed in this box describes a separate unit. ^
followed by an integer is used to represent a power. Finally, a single
``/'' indicates that the following units are on the denominator,
dividing the first set of units by the second. So to represent the
unit of acceleration, you can equivalently type all of the following:
m/s^2
m/s s
m/s^-2
metre/second^2
metre second^-2
metre / second second
Note – setting the time dimension is done in the simulation menu.
All function objects require dimensionless inputs. You can use dimensional analysis to avoid, for example, incorrectly feeding a degree measurement into a sine function, by requiring them to be multiplied by a radiansPerDegree parameter.