Model Verification at Default Simulation Snapshot Time

This example shows how to assert that bounds on the linear system characteristics of a nonlinear Simulink® model, computed at the default simulation snapshot time of 0, are satisfied during simulation.

  1. Open a nonlinear Simulink model. For example:

    watertank
  2. Open the Simulink Library Browser by selecting View > Library Browser in the Simulink Editor.

  3. Add a model verification block to the Simulink model.

    1. In the Simulink Control Design library, select Model Verification.

    2. Drag and drop a block, such as the Check Pole-Zero Characteristics block, into the Simulink Editor.

      The model now resembles the following figure.

  4. Double-click the block to open the Block Parameters dialog box.

    To learn more about the block parameters, see the block reference pages.

  5. Specify the linearization input and output to compute the closed-loop poles and zeros.

      Tip   If you have defined the linearization input and output in your Simulink model, click to automatically populate the Linearization inputs/outputs table with I/Os from the model.

    1. To specify an input:

      1. Click adjacent to the Linearization inputs/outputs table.

        The Block Parameters dialog expands to display a Click a signal in the model to select it area.

      2. In the Simulink model, click the output signal of the Desired Water Level block to select it.

        The Click a signal in the model to select it area updates to display the selected signal.

          Tip   You can select multiple signals at once in the Simulink model. All selected signals appear in the Click a signal in the model to select it area.

      3. Click to add the signal to the Linearization inputs/outputs table.

    2. To specify an output:

      1. In the Simulink model, click the output signal of the Water-Tank System block to select it.

        The Click a signal in the model to select it area updates to display the selected signal.

      2. Click to add the signal to the Linearization inputs/outputs table.

          Note:   To find the location in the Simulink model corresponding to a signal in the Linearization inputs/outputs table, select the signal in the table and click .

      3. In the Configuration drop-down list of the Linearization inputs/outputs table, select Output Measurement for watertank/Water-Tank System: 1.

          Note:   The I/Os include the feedback loop in the Simulink model. The software computes the poles and zeros of the closed-loop system.

      4. Click to collapse the Click a signal in the model to select it area.

  6. Specify bounds for assertion. In this example, you use the default approximate second-order bounds, specified in Bounds tab of the Block Parameters dialog box.

    View the bounds on the pole-zero map by clicking Show Plot to open a plot window.

  7. Stop the simulation if assertion fails by selecting Stop simulation when assertion fails in the Assertion tab.

  8. Click Apply to apply all changed settings to the block.

  9. Simulate the model by clicking in the plot window.

    Alternatively, you can simulate the model from the Simulink Editor.

    The software linearizes the portion of the model between the linearization input and output at the default simulation time of 0, specified in Snapshot times block parameter. When the software detects that a pole violates a specified bound, the simulation stops. The Diagnostics Viewer opens reporting the block that asserts.

    Click Open to highlight the block that asserts in the Simulink model.

    The closed-loop pole and zero locations of the computed linear system appear as x and o markings in the plot window. You can also view the bound violation in the plot.

Was this topic helpful?