This model demonstrates the use of a modal model to implement hysteresis, but where, with a specified probability, the model fails to switch levels on decting a threshold crossing. Instead, the switch happens after some delay. Note that the amount of delay in this model is not explicitly specified. It depends on not only the probablity of the failure but also the step size used by the ODE solver.