Physical systems can be naturally modeled by combining continuous and
discrete models. Such hybrid models may simplify the modeling task of complex
system, as well as increase simulation performance. Moreover, modern simulation
engines can often efficiently generate simulation traces, but how do we know
that the simulation results are correct? If we detect an error, is the error in
the model or in the simulation itself? This paper discusses the problem of
simulation safety, with the focus on hybrid modeling and simulation. In
particular, two key aspects are studied: safe zero-crossing detection and
deterministic hybrid event handling. The problems and solutions are discussed
and partially implemented in Modelica and Ptolemy II