MATLAB: Do I receive a warning about step size 0 in the MATLAB command window when I simulate a Simulink model

0continuousinfiniteloopsimulinksize;solverstepvariable

When I run the simulation for a Simulink model, I receive the following warning in the MATLAB command window and the simulation goes into an infinite loop. I have chosen the default ode45 variable step solver since I have some continuous states in my model.
Next step size (0) is smaller than minimum step size (0) at time 0 because distance between zero crossings is smaller than the minimum step size.

Best Answer

This bug has been fixed in Release 2006b (R2006b). For previous product releases, read below for any possible workarounds:
When the variable step solver reaches a zero crossing point, the step size is reduced in order to achieve more accuracy near the zero crossing point. The step size 0 may be a result of this reduction in step size. Since the step size is zero, the simulation cannot advance and hence goes into an infinite loop.
If you change the solver to a fixed step solver and still receive an error, there may be a singularity in the solution. If not, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances).