Main Content

How Range Analysis Works

测距分析模型分析

The model that you want to analyze必须与范围分析兼容。如果您的模型不兼容,则替换不支持的块或划分模型,以便您可以分析兼容的模型的部分。金宝app有关更多信息,请参阅与范围分析的模型兼容性

当您指定时Derived ranges作为范围收集模式,固定点设计器™软件对模型进行静态范围分析,以导出模型中信号的最小和最大范围值。该软件分析了模型行为,并计算每个块出口模拟期间可能发生的值。这些值的范围称为aderived range

该软件基于以下方式静态分析模型中各个计算的范围:

  • Specified design ranges, known as设计最小和最大值values, for example, minimum and maximum values specified for:

    • InportandOutport

    • Block outputs

    • Input, output, and local data used inMATLAB Functionandstateflow图表

    • 金宝app®data objects (Simulink.SignalandSimulink.Parameterobjects)

  • 输入

  • 块中每个计算的语义

If the model contains objects that the analysis cannot support, where possible, the software usesautomatic stubbing

范围分析试图通过使用模型中的所有指定设计范围来缩小导出的范围。您指定的设计范围信息越多,范围分析的可能性就越有可能。随着软件执行分析,它会导出模型的新范围信息。然后,软件尝试将此新信息与指定的范围一起使用,以导出模型中剩余对象的范围。

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. The software approximates floating-point numbers with infinite-precision rational numbers for analysis and then converts to floating point for reporting.

下表总结了分析如何导出范围信息并提供与示例的链接。

When... 分析方式如何运作 Examples

您可以为块输出指定设计最小和最大数据。

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

  • 导出的最小值和最大值

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.

使用块初始条件导出范围

The model contains a parameter with a specified range and the parameter storage class is set toAuto

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

Derive Ranges for Simulink.Parameter Objects

该模型包含具有指定范围的参数,并且不会将参数存储类设置为自动。

分析考虑了为参数指定的范围并忽略该值。

Derive 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.

Troubleshoot Range Analysis of System Objects

The range analysis results might depend on the block sorted order, which determines the order in which the software analyzes the blocks. For more information, seeControl and Display Execution Order

模型包含矛盾的设计范围通知ation.

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.

修复设计范围冲突

自动停线

什么是自动存根?

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

通过自动破坏,当范围分析到不受支持的块时,软件忽略了该块的(“存根”)。金宝app分析忽略了块的行为。结果,块输出可以采用任何值。

软件无法“存根”所有Simulink块,例如金宝appIntegratorblock. See the blocks marked “not stubbable” in金宝app支持范围分析的Simu金宝applink块

与范围分析的模型兼容性

要验证您的模型是否与范围分析兼容,请参阅:

如何派生范围

  1. 验证您的模型是否与范围分析兼容。

  2. 在Si金宝appmulink中,打开模型并将其设置为固定点工具。有关更多信息,请参阅设置模型

  3. From the Simulink应用tab, select固定点工具

  4. In the Fixed-Point Tool, underNew, 选择the迭代定点转换workflow.

  5. 设计下的系统(sud), 选择the system or subsystem of interest.

  6. 范围收集模式, 选择Derived rangesas the method of range collection. This configures the model to collect ranges using idealized floating-point data types.

    默认情况下,该工具使用Design信息从系统中的设计信息收集范围。有关更多信息,请参阅Derive Ranges at the Subsystem Level

  7. 点击准备要使固定点工具检查设计下的系统是否与转换过程兼容,并报告模型中发现的任何问题。

    The Fixed-Point Tool:

    • 检查模型针对固定点指南。

    • Identifies unsupported blocks.

    • Identifies blocks that need design range information.

  8. 点击theCollect Rangesbutton to run the analysis.

    分析试图在设计下所选系统中的对象的范围信息。您的后续步骤取决于分析结果。

    Analysis Results 固定点工具Behavior Next Steps 欲获得更多信息

    Successfully derives range data for the model.

    Displays the derived minimum and maximum values for the blocks in the selected system.

    审查范围来确定结果lts are suitable for proposing data types. If not, you must specify additional design information and rerun the analysis.

    Derive Ranges Using Design Ranges

    Fails because the model contains blocks that the software does not support.

    生成错误并提供有关不受支持的块的信息。金宝app

    要修复错误,请查看错误消息信息并替换不受支持的块。金宝app

    与范围分析的模型兼容性

    Cannot derive range data because the model contains conflicting design range information.

    生成错误。

    要解决此错误,请检查模型中指定的设计范围以识别不一致的设计规范。修改设计范围以使其保持一致。

    修复设计范围冲突

    无法导出对象的范围数据,因为模型上指定的设计范围信息不足。

    Highlights the results for the object.

    检查模型以确定缺少哪些设计范围信息。

    Troubleshoot Range Analysis of System Objects