Main Content

Consecutive zero-crossings violation

Diagnostic behavior when zero-crossing violation occurs

Model Configuration Pane: Diagnostics


This parameter specifies whether the software issues a warning, an error, or no diagnostic when a zero-crossing violation occurs. A zero-crossing violation occurs when the number of consecutive zero crossings detected in simulation exceeds the value specified for the Number of consecutive zero crossings parameter.

The diagnostic message includes this information:

  • Current simulation time

  • Number of consecutive zero crossings counted

  • Type and name of the block where the software detected the zero crossings

This diagnostic applies only to simulations of models that have zero-crossing detection enabled and use a variable-step solver.


error (default) | warning | none

The software issues an error and terminates the simulation.


The software issues a warning.


The software does not issue a diagnostic.

Recommended Settings

DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionwarning or error

Programmatic Use

Parameter: MaxConsecutiveZCsMsg
Value: 'error' | 'none' | 'warning'
Default: 'error'

Version History

Introduced before R2006a