Quantcast

Documentation Center

  • Trial Software
  • Product Updates

How Range Analysis Works

Analyzing a Model with Range Analysis

The model that you want to analyze must be compatible with range analysis. If your model is not compatible, either replace unsupported blocks or divide the model so that you can analyze the parts of the model that are compatible. For more information, see Model Compatibility with Range Analysis.

The Fixed-Point Designer™ software performs a static range analysis of your model to derive minimum and maximum range values for signals in the model. The software analyzes the model behavior and computes the values that can occur during simulation for each block Outport. The range of these values is called a derived range.

The software statically analyzes the ranges of the individual computations in the model based on:

  • Specified design ranges, known as design minimum and maximum values, for example, minimum and maximum values specified for:

    • Inport and Outport blocks

    • Block outputs

    • Input, output, and local data used in MATLAB Function and Stateflow Chart blocks

    • Simulink® data objects (Simulink.Signal and Simulink.Parameter objects)

  • Inputs

  • The semantics of each calculation in the blocks

If the model contains objects that the analysis cannot support, where possible, the software uses automatic stubbing.

The range analysis tries to narrow the derived range by using all the specified design ranges in the model. The more design range information you specify, the more likely the range analysis is to succeed. As the software performs the analysis, it derives new range information for the model. The software then attempts to use this new information, together with the specified ranges, to derive ranges for the remaining objects in the model.

For models that contain floating-point operations, range analysis might report a range that is slightly larger than expected. This difference is due to rounding errors because the software approximates floating-point numbers with infinite-precision rational numbers for analysis and then converts to floating point for reporting.

The following table summarizes how the analysis derives range information and provides links to examples.

When...How the Analysis WorksExamples

You specify design minimum and maximum data for a block output.

The derived range at the block output is based on these specified values and on the following values for blocks connected to its inputs and outputs:

  • Specified minimum and maximum values

  • Derived minimum and maximum values

Derive Ranges Using Design Ranges

A parameter on a block has initial conditions and a design range.

The analysis takes both factors into account by taking the union of the design range and the initial conditions.

Derive Ranges Using Block Initial Conditions

The model contains a parameter with a specified range and the parameter storage class is set to Auto.

The analysis does not take into account the range specified for the parameter. Instead, it uses the parameter value.

Derive Ranges Using Design Ranges for Simulink.Parameter Objects

The model contains a parameter with a specified range and the parameter storage class is not set to Auto.

The analysis takes into account the range specified for the parameter and ignores the value.

Derive Ranges Using Design Ranges for Simulink.Parameter Objects

The model contains insufficient design range information.

The analysis cannot determine derived ranges. Specify more design range information and rerun the analysis.

Providing More Design Range Information

The analysis results might depend on block sorting order which determines the order in which the software analyzes the blocks. For more information, see Control and Display the Sorted Order.

The model contains conflicting design range information.

The analysis cannot determine the derived minimum or derived maximum value for an object. The Fixed-Point Tool generates an error. To fix this error, examine the design ranges specified in the model to identify inconsistent design specifications. Modify them to make them consistent.

Fixing Design Range Conflicts

Automatic Stubbing

What is Automatic Stubbing?

Automatic stubbing is when the software considers only the interface of the unsupported objects in a model, not their actual behavior. Automatic stubbing lets you analyze a model that contains objects that the Fixed-Point Designer software does not support. However, if any unsupported model element affects the derivation results, the analysis might achieve only partial results.

How Automatic Stubbing Works

With automatic stubbing, when the range analysis comes to an unsupported block, the software ignores ("stubs") that block. The analysis ignores the behavior of the block. As a result, the block output can take any value.

The software cannot "stub" all Simulink blocks, such as the Integrator block. See the blocks marked "not stubbable" in Supported and Unsupported Simulink Blocks.

Model Compatibility with Range Analysis

To verify that your model is compatible with range analysis, see:

Was this topic helpful?