Quick Tour
The following links open models that highlight the
key features of Ptolemy II. To run the models,
follow the link, then select "Run Window" from the "View" menu. The
diagrams are fully editable, so feel free to explore. The top-level
parameters are the model are shown in the run window. Edit these to
explore the models. They can be edited while the models are running.
You can also access the complete
list of demos.
-
Simple Signal Processing (See also
Maximum Entropy Spectrum,
Fourier Series, and
Sound Spectrum)
This example shows simple spectral estimation of the product
of two sinusoids in noise. It illustrates models for signal
processing, hierarchical models,
the Expression actor, and the FFT actor.
This model is build using the synchronous dataflow (SDF) domain,
which statically schedules the firing of the actors.
-
Continuous-Time Modeling (see also
Square Wave Response)
This example shows a continuous-time
nonlinear feedback system that exhibits
chaotic behavior (this system is called a Lorenz attractor).
It illustrates the continuous-time (CT) domain,
which uses an underlying solver for ordinary differential equations.
-
Discrete-Event Modeling (see also
Router
and
Timing Paradox).
This example shows
a famous paradox in probability called the inspection paradox.
It illustrates use of the discrete-event (DE) domain, where
events occur on a time line and are processed chronologically.
In this example, random
data stimulates a model and statistics are collected and reported
in various ways.
-
Mixed-Signal Modeling (see also
Switching Continuous)
This example shows how to combine continuous-time modeling
with discrete-event modeling to get mixed-signal modeling.
The example models a MEMS accelerometer where a digital circuit
implements feedback control and A/D conversion (a design due to
Mark Lemkin).
-
Modal Models
A modal model is one whose behavior depends on its "mode"
of operation. A modal model in Ptolemy II uses the
finite state machine (FSM) domain
combined hierarchically with other models. A state in the FSM represents
a mode of operation, and can have a refinement that gives the behavior
in that mode.
The refinement can be another FSM or some other model using some other
Ptolemy domain. This example combines DE, FSM, and SDF to model a
system where regularly sampled signals are perturbed by irregular
events in time.
-
Hybrid Systems (see also
Car Tracking
,
and Bouncing Ball and
Furuta Pendulum
).
Hybrid systems are a special case of modal models
where the FSM domain is combined with the CT domain
to get mixed continuous-time and discrete-event models.
This example models a physical system consisting of two point masses
on springs that stick together when they collide.
-
Process Networks (see also
QR).
This example illustrates the process networks (PN) domain,
where each actor executes in a separate Ptolemy II thread.
The example calculates numbers whose prime
factors are 2, 3, and 5, only, and produces
them in an ordered sequence.
-
Synchronous/Reactive Modeling.
This example illustrates the synchronous/reactive (SR) domain,
which is inspired by the synchronous languages Esterel, Lustre, and Signal.
The example uses the fixed-point semantics of SR to arbitrate access
to a shared medium using a token-ring protocol.
-
The Type System.
This model illustrates the very sophisticated type system
of Ptolemy II, where type constraints propagate transparently,
actors are polymorphic, and composite types such as records and
arrays are supported.
This example illustrates composite types, where records are
constructed out of tokens with various types. Here, a record
models a packet in a packet-switched network, where variable
delays may result in out-of-order arrival of packets.
-
Higher-order expressions.
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 model much more compact.
- Sketched Signal
(see also Fourier Series).
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 (see also
Matlab in CT).
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.
- Interactive
User Interface (see also
Bouncer).
This model illustrates features of the user interface that
make it easier to create models that execute with rich interaction
with the user. In this example, sliders in the run control parameter
control the values of "port parameters," which in turn control the
execution of a model.
-
Unit Systems
This model illustrates the use of Ptolemy II unit systems. 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. The Ptolemy II unit system allows us to express
quantities equivalently with different units, and keeps track of the
units through mathematical operations. For example, one centimeter
divided by one millisecond is equal to 10 meters/second. This is
expressed in the expression language as "1*cm/ms" or "10 m/second",
where "cm", "ms", "m", and "second" are defined in the unit system. A
unit system is a modular component that one drags into a model.
-
Network Integration.
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
http://ptolemy.eecs.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 (see also Fourier Series).
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.
Experimental Facilities
Ptolemy II has a number of less well-developed experimental
capabilities that may continue to evolve over time.
These are illustrated in the following examples.
- Higher-Order Components.
Higher-order components are components that operate on components.
This example contains a component that is a composite actor that
replicates itself some specified number of times to operate on
multiple channels of input. This capability was created by
Zoltan Kemenczy and Sean Simmons, Research In Motion, Ltd.
- Push/Pull
Component Interaction.
The CI (component interaction) domain models communication between
components that uses a combination of push and pull. This model
illustrates the use of these styles of communication to route packets
through queues using some policy that depends on the queue sizes.
- Python Integration
This example shows a trivial implementation of the Scale actor
using the Python language. The advantage of using Python
is that Python is an interpreted language, so changes
to the actor body can be made on the fly without restarting
Ptolemy II. New users may find it easier to prototype
actors in Python and then reimplement them as necessary
as standard Ptolemy II actors.
- Cal: a textual notation for writing dataflow actors.
-
Discrete-Time Models.
This example shows a simple pulse-amplitude modulation, physical
layer communication system. It illustrates the discrete-time (DT)
domain, live parameter editing and
the scope-style plotter (which shows an eye diagram).
Note that discrete-time models can also be represented using the
SDF domain, which is not explicit about the passage of time.
-
Code Generation
This release includes a limited prototype of our code generation facility
that will generate .class files for non-hierarchical SDF models.
This example leads to more information about this capability.
-
Three-Dimensional Graphics (see also
Universe,
Sticky Masses)
and Bouncing Ball).
NOTE: This model requires that you have
installed Java 3D from Sun
(see http://java.sun.com/products/java-media/3D/).
This example shows a continuous-time physical model of pendulum
animated in the graphics (GR) domain, in which graphical components
can be assembled and dynamically manipulated. Note that clicking
and dragging in the graphics window rotates the model.
For further details, see the
GR domain.
-
Timed Multitasking.
This example illustrates the timed multitasking (TM) domain,
which is inspired by the Giotto language, and has features of
priority-driven real-time operating systems. In this example,
two control systems share a computational resource. Depending
on the scheduling strategy chosen (preemptive or nonpreemptive)
and the priorities, the two control systems may be both stable,
or one may be stable, or the other may be stable.