Main Content

Zero-Crossing Events

The ex_spi_show_zc model simulates a ball bouncing on a hard surface.

Select the Zero Crossing option in Configure section of toolstrip, then click the Run button on the Solver Profiler. The model simulates in 648 steps and triggers 45 zero crossing events. To highlight the zero crossing events on the step size plot, click the Zero Crossing tab from the Diagnostics pane and select the ex_spi_show_zc/Switch block that is causing the zero-crossing events. Notice that the zero crossing events are displayed on the Step Size plot as yellow dots.

The result indicates that when the ball drops on the hard surface, it bounces 45 times before coming to a stop. The solver resets after each bounce, increasing the computational load. Having many resets improves accuracy at the cost of computation load. Therefore, it is important to know this tradeoff when modeling.

If this modeling construct belonged to a larger model, the Solver Profiler would help you locate it. You could then modify the model to improve solver performance. For example, you can decide to reduce the accuracy of the contact dynamic by increasing the damping factor, which would reduce the number of bounce events. Increasing the damping from 100 to 500 makes the ball bounce only 9 times, allowing the simulation to complete in only 161 steps.

You can observe more details about Zero Crossing events from Zero Crossing Explorer. To do this, ensure Zero Crossing option from Configure is selected before profiling the model. Then click Zero Crossing in the Explore section of the Solver Profiler toolstrip. See Zero Crossing Explorer.

See Also

| |