Tour of Ptolemy II
If you are viewing this from within Vergil, the graphical
editor for Ptolemy II, then
many of the following links will open models that highlight the
key features of Ptolemy II. If you are using an ordinary
web browser, then you will see the XML definition of the models.
To run the models in Vergil,
click on the red triangle in the toolbar. The
diagrams are fully editable, so feel free to explore.
You can also access the complete list of demos
. Contents:
Ptolemy II can be used to build sophisticated application domain-specific modeling capabilities
and frameworks. These frameworks can be packaged as separate executable
applications (e.g. HyVisual or VisualSense)
or accessed from within Ptolemy II. Here, we illustrate some such frameworks.
-
Stochastic hybrid systems:
Noise
(see also
IncreasingRatePoisson,
HysteresisWithRandomDelay,
Brownian
).
Stochastic hybrid systems add random behavior to continuous-time models mixed
with discrete events. The
Noise
) models
show bandlimited Gaussian noise processe.
IncreasingRatePoisson
models spontaneous mode transitions governed by a Poisson process.
The HysteresisWithRandomDelay
example uses similar spontaneous mode transitions to model random delay in mode transitions.
The Brownian example
models a stochastic differential equation describing a random walk process.
- Signal Processing:
MaximumEntropySpectrum
(See also
LMSAdaptive,
SynthesizedVoice,
FourierSeries, and
SoundSpectrum)
Ptolemy II includes an extensive library and models of computation suitable for
digital signal processing, communication systems design, and image and video processing.
The MaximumEntropySpectrum
example shows spectral estimation of sinusoids in noise.
It illustrates models the use of synchronous dataflow (SDF) for signal
processing, and also shows many basic capabilities like
hierarchical models,
the Expression actor, and the signal processing actor library.
A particular capability of Ptolemy II is the ability to mix models of computation.
These examples illustrate some of these capabilities.
Many common models of computation have been implemented in
Ptolemy II. This section illustrates some of them.
- Synchronous Dataflow:
Spectrum (See also
MaximumEntropySpectrum,
FourierSeries, and
SoundSpectrum)
This example shows simple spectral estimation of the product
of two sinusoids in noise. It illustrates models the use of synchronous dataflow (SDF) for signal
processing, and also shows many basic capabilities like
hierarchical models,
the Expression actor, and the signal processing actor library.
In SDF, the firing of actors is statically scheduled, and at the start of execution,
boundedness and deadlock conditions are checked.
- Continuous-Time Modeling:
Lorenz (see also
Lorenz with DifferentialSystem,
SquareWave,
Sinusoid)
This example shows a continuous-time
nonlinear feedback system that exhibits
chaotic behavior (this system is called a Lorenz attractor).
It illustrates the continuous domain,
which uses an underlying solver for ordinary differential equations
and cleanly supports mixtures of discrete events and continuous-time
signals.
Ptolemy II models are built on an underlying framework that provides a rich
set of generic capabilities that are available in all models.
This section illustrates that infrastructure.
- Expression Language:
Transmission.
To simplify creating new components, Ptolemy II contains a functional
expression language. The expression language is integrated with the
type system, allowing static type checking of polymorphic expressions
with few type annotations. The expression language also allows new,
encapsulated functions, called function closures, to be defined and
passed as data. This model illustrates how function closures can be
used to make models much more compact.
- Interactive Signal Plotter:
Sketch
(see also FourierSeries).
This model illustrates the use of plotter to provide input
as well as rendering output from a model. Right click and drag
on the plot to trace out a new signal. The model runs each time you
do this.
- Matlab Integration:
MatlabExpression
(see also
Matlab in Continuous).
This example uses the Matlab interface created by
Zoltan Kemenczy and Sean Simmons, of Research in Motion Ltd.,
to plot a 3-D surface. This works only if Matlab is installed locally.
-
Classes, subclasses, and inner classes:
ClassesIllustrated (see also
Noisy sinewaves
).
Actor-oriented classes, subclasses, and
inner classes with inheritance are a special feature of Ptolemy II.
They provide modularity mechanisms analogous to those of object-oriented
design, but adapted to actor-oriented design. This capability permits, for
example, defining a class of models that can have instances and subclasses.
The instances and subclasses inherit all the features of the class, and
track any changes that are made to the class.
- Model Animations:
AnimateVergil
Ptolemy II models can, while executing, control their visual rendition
in Vergil, the visual editor for Ptolemy II.
In this example, a model alters the position in the Vergil diagram
of one of its own actors.
- Statically Checked Units System:
StaticUnits
This model illustrates the use of the statically
checked units system. A unit system
defines a set of interrelated dimensions and measures. For example, in
the time dimension, we might have seconds, minutes, hours, days, weeks,
and fortnights. Ptolemy II includes two experimental units systems,
one that is statically checked and one that is dynamically checked.
- Network Integration:
Networked.
This example illustrates that models may be defined in a networked,
distributed fashion.
This model contains a component that is defined on the Ptolemy project
website. When you open the model, you will be alerted to the fact
that it requires loading a model definition from a remote source.
If you agree to proceed, then you will have a model with a remotely
defined component. The component itself is at
https://ptolemy.berkeley.edu/xml/models/Waveform.xml.
You can open that definition by clicking on the hyperlink, or by
using the "Open URL" command in the File menu.
- Audio:
KarplusStrong (see also SoundSpectrum).
Ptolemy II includes actors that interface to the audio system on
the executing machine, assuming it has one.
This example shows the Karplus-Strong algorithm, which synthesizes
a musical sound that closely resembles a plucked string instrument.
It illustrates the audio capabilities of Ptolemy II.
- Fixed-Point Arithmetic:
FixFIR
(see also
FixPoint)
Ptolemy II data types include a fixed-point data type, where
a model can explicitly control the binary representation of numbers
and the mechanisms used to handle overflow and rounding.
Ptolemy II includes several actor libraries that provide sophisticated
functions. A few of those are illustrated by the models here.
- Array:
Actors that operate on matrices and arrays.