Zero Crossing Explorer

Visualize and interactively explore zero-crossing events

Description

Use the Zero Crossing Explorer to visualize and analyze zero crossing events that occur for each state in your model.

Open the Zero Crossing Explorer

  • Profile the model using the Solver Profiler. Ensure that the States & Zero Crossing parameter is enabled.

  • Select Zero Crossing in the Explore section of the Solver Profiler toolstrip.

Examples

expand all

Use the Zero Crossing Explorer to examine clusters of zero crossing events

Open the ex_spi_show_zc model and launch the Solver Profiler.

Enable the States & Zero Crossing parameter in the Log section of the toolstrip and run the Solver Profiler.

When profiling has completed, launch the Zero Crossing Explorer

There is an increase in the density of zero crossing events halfway through the simulation. Zoom in on the event density plot between the 5 and 6 second mark

A closer examination reveals that each bounce corresponds to two zero crossings — from positive to negative and vice-versa. This is an artefact of numerically solving state dynamics that approach 0 value. Around 5.48 seconds, the ball being simulated in the model comes to 'rest', hence the isolated single zero crossing event.

Related Examples

Introduced in R2019a