Main Content

Troubleshooting Units

To help you troubleshoot issues with unit settings, Simulink®uses Model Advisor checks to generate a report useful for larger models.

By default, Simulink flags unit usage issues, such as mismatched units, with warnings. Warnings enable you to continue working despite mismatched units. You can reduce the number of warnings you see by setting the configuration parameterUnits inconsistency messagestonone.

Undefined Units

Simulink does not support custom unit specifications. For more information about supported unit systems and the units they contain, seeAllowed Units.

The Model Advisor checkIdentify undefined units in the modelidentifies undefined units.

Overflow and Underflow Errors or Warning

You can get overflow and underflow errors or warnings when using theUnit Conversionblock. If you get:

  • Overflow messages, change the data type at the output port to one with a better range

  • Underflow messages, change the data type at the output port to one with better precision

Mismatched Units Detected

At the boundary of a component, Simulink detects if the units of two ports do not match. To see the tooltip, hover over the warning badge. If the unit is convertible, Simulink displays advice on fixing the issue.

The Model Advisor checkIdentify unit mismatches in the modelidentifies mismatched units.

Mismatched Units Detected While Loading

At the boundary of a component, Simulink detects if the units of two ports do not match. To see the tooltip, hover the warning badge. When possible, Simulink displays advice on fixing the issue.

The Model Advisor checkIdentify unit mismatches in the modelidentifies mismatched units.

Disallowed Unit Systems

Simulink supports only the unit systems listed in the tables ofallowed units.

The Model Advisor checkIdentify disallowed unit systems in the modelidentifies unit systems that are not allowed in the configured units systems.

Automatic Unit Conversions

If theAllow automatic unit conversionsconfiguration parameter is set, Simulink supports the automatic conversion of units. Simulink flags automatically converted units with thebadge.

For a list of the automatic unit conversions, use the Model Advisor checkIdentify automatic unit conversions in the model.

Unsuccessful Automatic Unit Conversions

If theAllow automatic unit conversionsconfiguration parameter is set, Simulink supports the automatic conversion of units. If Simulink cannot perform the automatic unit conversion, Simulink returns a warning (). In such cases, consider manually specifying the unit.

Tip

Automatic unit conversion is a convenience. For better control of units, you can manually set the units for two connecting ports.

SimscapeUnit Specification Incompatible with万博1manbetx

If these are true:

  • You define a new unit to your unit registry by using thepm_addunitfunction.

  • You use the new unit with theSimulink-PS ConverterorPS-万博1manbetxSimulink转换器block.

  • Your new unit conflicts with an existing one in the Simulink database.

Simulink returns a warning about a potential incorrect calculation ().

See Also

|||||||||||

Related Topics