Hyvisual: a Hybrid System Modeling Framework based on Ptolemy II

Extended Abstract HyVisual is a hybrid systems modeling framework providing a block diagram visual syntax for specifying continuous dynamics and a bubble-and-arc syntax for specifying modal behavior. It is based on Ptolemy II, is written in Java, and is distributed open-source at http://ptolemy.eecs.berkeley.edu/hyvisual/. HyVisual has a rigorous operational semantics described in Lee and Zheng (2005). A key property is that it internally uses superdense time , where signals are modeled as partial functions of the form f : ℝ + Xℕ → V , where ℝ + is the non-negative real numbers and represents time, V is the value set (a data type, such as ℝ n ), and ℕ is the set of natural numbers. Continuous-time functions are total, whereas discrete-event functions are defined only on a discrete subset of ℝ + . The ℕ in the domain permits signals to have multiple values in a well-defined order at a particular time. Using this framework, HyVisual gives a rigorous semantics to discontinuous signals (which have multiple values at the point of discontinuity), to discrete-event signals with multiple events at the same time, and to transient states, where the time spent in the state is zero. An example of a HyVisual model that leverages this is shown in fig. 1, which shows many features of HyVisual. This models Newton's cradle, an apparatus with three (or more) balls hanging from strings (inspired by a one dimensional version in Mosterman (1999)). If the model is initialized with one of the balls displaced as shown in the HyVisual graphical animation at the lower left, then when the ball collides with the middle ball, a transient state results. At that time, the right ball transfers its momentum to the middle ball, and then, without any time elapsing, the middle ball transfers its momentum to the left ball. The two events (state transitions in the state machine at the middle left) are simultaneous but ordered. Other initial conditions can be chosen where two simultaneous events are unordered (e.g., starting with two balls appropriately displaced). HyVisual allows a model to permit nondeterministic choice of enabled transitions.