model ChatteringEvents1 "Exhibits chattering after t = 0.5, with generated events"
  Real x(start = 1, fixed = true);
  Real y;
  Real z;
equation
  z = if x > 0 then -1 else 1;
  y = 2 * z;
  der(x) = y;
  annotation(Documentation(info = "<html>
<p>After t = 0.5, chattering takes place, due to the discontinuity in the right hand side of the first equation.</p>
<p>Chattering can be detected because lots of tightly spaced events are generated. The feedback to the user should allow to identify the equation from which the zero crossing function that generates the events originates.</p>
</html>"), experiment(StopTime = 1));
end ChatteringEvents1;