Documentation

Test Model Output Against a Baseline

To test the simulation output of a model against a defined baseline, use a baseline test case. In this example, use the sldemo_absbrake model to compare the simulation output to a baseline captured from an earlier state of the model.

Create the Test Case

  1. Open the sldemo_absbrake model.

  2. To open the Test Manager from the model, select Analysis > Test Manager.

  3. From the Test Manager toolstrip, click New to create a test file. Name and save the test file.

    The test file consists of a test suite that contains one baseline test case. They appear in the Test Browser pane.

  4. Right-click the baseline test case in the Test Browser pane, and select Rename. Rename the test case to Slip Baseline Test.

  5. Under System Under Test in the test case, click the Use current model button to load the sldemo_absbrake model into the test case.

  6. To record a baseline from the system under test, under Baseline Criteria, click Capture.

  7. In the Capture Baseline dialog box, for the file format, select MAT. Specify a location to save the baseline to and click Create.

  8. Expand the Baseline Criteria section. The baseline criteria file and the logged signals appear in the table. Set the Absolute Tolerance of the Ww signal to 15.

Tip

To add or remove columns in the baseline criteria table, click the column selector button .

For more information about tolerances and criteria, see Apply Tolerances to Test Criteria.

Run the Test Case and View Results

  1. In the sldemo_absbrake model, set the Desired relative slip constant block to 0.22.

  2. In the Test Manager, select the Slip Baseline Test case in the Test Browser pane.

  3. On the Test Manager toolstrip, click Run.

    In the Results and Artifacts pane, the new test result appears at the top of the table.

  4. Expand the results until you see the baseline criteria result. Right-click the result and select Expand All Under.

    The signal yout.Ww passes, but the overall baseline test fails because other signal comparisons specified in the Baseline Criteria section of the test case were not satisfied.

  5. To view the yout.Ww signal comparison between the model and the baseline criteria, expand Baseline Criteria Result and click the option button next to the yout.Ww signal.

    The Comparison tab opens and shows the criteria comparisons for the yout.Ww signal and the tolerance.

  6. You can also view signal data from the simulation. Expand Sim Output and select the signals you want to plot.

    The Visualize tab opens and plots the simulation output.

For information on how to export results and generate reports from results, see Export Test Results and Generate Reports.

Related Topics

Was this topic helpful?