Documentation Center

  • Trial Software
  • Product Updates

How to Specify Units in Block Dialogs

Simscape™ block dialogs have drop-down combo boxes for units next to a parameter value. For example, in the Constant Volume Chamber block dialog box, the drop-down list for the Chamber volume parameter contains l, gal, in^3, ft^3, mm^3, cm^3, m^3, and km^3, and the drop-down list for the Initial pressure parameter contains Pa, bar, psi, and atm.

You can either select a unit from the drop-down list, or type a commensurate unit name (or a mathematical expression with unit names) directly into the unit combo box of the block dialog. You can use the abbreviations for the units defined in your registry, or any valid mathematical expressions with these abbreviations. For example, you can specify torque in newton-meters (N*m) or pound-feet (lbf*ft). To specify velocity, you can use one of the defined unit abbreviations (mph, fpm, fps), or an expression based on any combination of the defined units of length and time, such as meters/second (m/s), millimeters/second (mm/s), inches/minute (in/min), and so on.

    Note   Affine units (such as Celsius or Fahrenheit) are not allowed in unit expressions. For more information, see About Affine Units.

The following operators are supported in the unit mathematical expressions:

*Multiplication
/Division
^Power
+Plus — for exponents only
-Minus — for exponents only
()Brackets to specify evaluation order

Metric unit prefixes, such as kilo, milli, or micro, are not supported. For example, if you want to use milliliter as a unit of volume, you have to add it to the unit registry:

pm_addunit('ml', 0.001, 'l');

The drop-down lists next to parameter names are automatically populated by those units that are commensurate with the unit of the parameter. If you specify the units by typing, it is your responsibility to enter units that are commensurate with the unit of the parameter. The unit manager performs error checking when you click Apply or OK in the block dialog box, and issues an error if you type an incorrect unit.

In the Simulink-PS Converter and the PS-Simulink Converter block dialog boxes, the drop-down lists are prepopulated with some common input and output units, and it is your responsibility to select or type a unit expression commensurate with the expected input or output units. The error checking for the converter blocks is performed at the time of simulation. See Model Validation for details.

Was this topic helpful?