Skip to Main Content Skip to Search
Product Documentation

Model Verification at Multiple Simulation Snapshots

This example shows how to:

  1. Open a nonlinear Simulink model. For example:

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

  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 Bode Characteristics block, into the model window.

      The model now resembles the following figure.

      For more information on the blocks, see the Model Verification block reference pages.

  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 I/O points.

      Tip   If your model already contains I/O points, the block automatically detects these points and displays them.

    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 PID Controller block to select it.

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

      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.

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

      4. Select the Open Loop option for watertank/Water-Tank System : 1.

      The Linearization inputs/outputs table now resembles the following figure.

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

      Tip   Alternatively, before you add the Linear Analysis Plots block, right-click the signals in the Simulink model and select Linearization Points > Input Points and Linearization Points > Output Points. Linearization I/O annotations appear in the model and the selected signals appear in the Linearization inputs/outputs table.

  6. Specify simulation snapshot times.

    1. In the Linearizations tab, verify that Simulation snapshots is selected in Linearize on.

    2. In the Snapshot times field, type [0 1 5 10].

  7. Specify multiple bound segments for assertion in the Bounds tab of the Block Parameters dialog box. In this example, enter the following lower magnitude bounds:

    • Frequency (rad/sec){[0.001 0.003],[0.01 0.04]}

    • Magnitude (dB){[20 20],[15 15]}

    Click Show Plot to view the bounds on the Bode magnitude plot.

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

    Alternatively, you can simulate the model from the model window.

    The software linearizes the portion of the model between the linearization input and output at the simulation times of 0,1, 5 and 10. When the software detects that the linear system computed at times 0 and 1 violate a specified lower magnitude bound, the following warning messages appear at the MATLAB prompt:

    Warning: Assertion detected in 'watertank_check_bode/Check Bode
    Characteristics' at time 0 
    Warning: Assertion detected in 'watertank_check_bode/Check Bode
    Characteristics' at time 1 

    You can also view the bound violations in the plot window.

  9. Modify a bound graphically. For example, to modify the upper magnitude bound graphically:

    1. In the plot window, click the bound segment to select it and then drag it to the desired location.

    2. Click Update block to update the new values in the Block Parameters dialog box.

  10. Disable the lower bounds to exclude them from asserting. Clear the Include lower magnitude bounds in assertion option in the Block Parameters dialog box. Then, click Apply.

    The lower bounds are now grey-out in the plot window, indicating that they are excluded from assertion.

  11. Resimulate the model to check if bounds are satisfied.

    The software satisfies the specified upper magnitude bound, and therefore the software no longer reports an assertion failure.

  


Free Control Systems Interactive Kit

Learn more about resources for designing, testing, and implementing control systems.

Get free kit

Trials Available

Try the latest control systems products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS