03.08.2013 Views

PTOLEMY II - CiteSeerX

PTOLEMY II - CiteSeerX

PTOLEMY II - CiteSeerX

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

2.10 Hybrid Systems and Modal Models<br />

Using Vergil<br />

Hybrid systems are models that combine continuous dynamics with discrete mode changes. They<br />

are created in Ptolemy <strong>II</strong> by creating a ModalModel, found in the HigherOrderActors library. We start<br />

by examining a pre-built modal model, and conclude by illustrating how to construct one. Modal models<br />

can be constructed with other domains besides CT, but this section will concentrate on CT. Feel free<br />

to examine other examples of modal models given in the quick tour, figure 2.3.<br />

2.10.1 Examining a Pre-Built Model<br />

Consider the bouncing ball example, which can be found under “Bouncing Ball” in figure 2.3 (in<br />

the “Hybrid Systems” entry). The top-level contents of this model is shown in figure 2.54. It contains a<br />

Ball Model, a TimedPlotter, and PeriodicSampler, and an Animate Ball composite actor. The Ball<br />

Model is an instance of the ModalModel found in the HigherOrderActors library, but renamed. If you<br />

execute the model, you should see a plot like that in the figure and a 3-D animation that is constructed<br />

using the GR (graphics) domain. The continuous dynamics correspond to the times when the ball is in<br />

the air, and the discrete events correspond to the times when the ball hits the surface and bounces.<br />

FIGURE 2.53. Discrete-event model with feedback, which requires a delay actor such as TimedDelay.<br />

Notice the library of domain-specific actors at the left.<br />

82 Ptolemy <strong>II</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!