View Model Statistics
This example shows how you can use model statistics to determine the effect of a change on model complexity.
To open an example with a simple mechanical system, enter:
openExample('simscape/SimpleMechanicalSystemExample')
To view model statistics, in the model window, on the Debug tab, click Simscape > Statistics Viewer.
The tool opens, but it does not contain any data. The Update Model button displays a caution symbol to indicate the statistics need to be refreshed.
Click the Update Model button. The window now displays an overview of the models statistics.
The default page contains a summary of the model statistics. Select Variables to display information about the simulation variables. Note that there are no algebraic variables in this version of the model.
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.
Return to the Statistics Viewer tool. Note that the Update Model button again shows a caution symbol to remind you to update the statistics after changing the model configuration. Update the model statistics.
Note the increase in algebraic variables. This is a result of adding a nonlinearity with the Translational Hard Stop block. The solver can no longer use a linear optimization to simulate the model.