Main Content

View Model Statistics

This example shows how you can use model statistics to determine the effect of a change on model complexity.

  1. Open the Simple Mechanical System example model.

  2. To view model statistics, in the model window, on the Debug tab, click Simscape > Statistics Viewer.

    The Simscape Statistics window opens, but it does not contain any data. If you open a model, and then open the Statistics Viewer before running the simulation, the statistics data is not available. The Refresh button in the toolbar of the viewer window displays a warning symbol (yellow triangle), and a message at the top of the viewer window tells you to click the Refresh button to populate the viewer with data.

  3. Click the Refresh button. The Simscape Statistics window now displays an overview of the models statistics in a collapsed state.

  4. Click to expand all nodes.

    You can see that, after variable elimination, the model contains five continuous differential variables, no algebraic variables, no discrete variables, and no zero-crossing signals.

  5. To limit the range of motion, add a Translational Hard Stop block to the model diagram, in parallel with the Translational Spring and the Translational Damper blocks, as shown in the following figure.

  6. Refresh the model statistics. Again, expand all the nodes.

    The revised model, after variable elimination, contains six differential variables and five algebraic variables. This happened because you added a nonlinear block (Translational Hard Stop). Therefore, the linear optimization that the solver initially performed on the model no longer applies.

Related Examples

More About