Main Content

Detect overflow

Diagnostic action to take if the software detects parameter overflow

Model Configuration Pane: Diagnostics / Data Validity

Description

The Detect overflow parameter specifies the diagnostic action to take if the software detects a parameter overflow. A parameter overflow occurs if the data type of a parameter does not have a large enough range of values to accommodate the ideal parameter value. For example, suppose the ideal value of a parameter is 200, and the data type of the parameter is int8. Overflow occurs for this parameter because the maximum value that the int8 data type can represent is 127.

Both parameter overflow and parameter precision loss are quantization errors. While parameter overflow differs from parameter precision loss, the distinction can be nuanced. Parameter precision loss occurs when the ideal parameter value is within the range of the data type and scaling, but the data type does not have an exact representation of the parameter value.

The Detect overflow diagnostic reports all quantization errors greater than the specified Bits of error threshold, which has a default setting of one bit. For very small parameter quantization errors and when the Bits of error threshold is set to One bit, precision loss is reported rather than an overflow when:

(Max+Slope)Videal>(MinSlope)

where:

  • Max is the maximum value the parameter data type can represent.

  • Min is the minimum value the parameter data type can represent.

  • Slope is the slope of the parameter data type. For integers, the slope is 1.

  • Videal is the ideal value of the parameter.

Settings

error (default) | warning | none
error

The software issues an error and terminates the simulation if the software detects a parameter overflow.

warning

The software issues a warning if the software detects a parameter overflow.

none

The software does not issue a diagnostic if the software detects a parameter overflow.

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionerror

Programmatic Use

Parameter: ParameterOverflowMsg
Type: string | character vector
Value: "none" | "warning" | "error"
Default: "error"

Version History

Introduced before R2006a