You are looking at historical revision 23028 of this page. It may differ significantly from its current revision.

• eggs

## signal-diagram

### Description

signal-diagram implements functional reactive combinators that are used to build signal flow functions out of pure functions.

signal-diagram is inspired by functional reactive libraries such as Yampa and Opis.

signal-diagram provides a set of combinators to construct signal functions, which are functions operating on continuous time varying values. Every signal function has named input and output signals.

signal-diagram can generate executable code from a signal function definition in Scheme, Standard ML, and GNU Octave.

#### Basic combinators

[procedure] IDENTITY

Constructs a signal function that copies its input to the ouput.

[procedure] PURE f

Constructs a signal function with no side effects.

[procedure] RELATION r f

Defines the relation r within the signal function f.

[procedure] UNION f g

Constructs a signal function whose input is the union of the inputs of signal functions f and g, and whose output is the union of the outputs of f and g.

[procedure] SEQUENCE f g

Constructs a signal function that feeds its input to signal function f, then takes the resulting output and feeds it to g, along with any additional inputs required by g.

[procedure] PIPE f g

Constructs a signal function that feeds its input to signal function f, then takes the resulting output and feeds it to g, without any any additional inputs.

[procedure] SENSE ss f

Constructs a signal function that selects only the signals enumerated in ss from its input, and feeds the result to the signal function f.

[procedure] ACTUATE ss f

Renames the outputs of f to the names specified in ss.

[procedure] RTRANSITION f g ef eg

Recurrent transition: constructs a signal function that behaves like f until the boolean signal specified by ef is true, when the signal function is switched to behave like g. If the boolean signal eg becomes true, the signal function is switched back to f.

[procedure] TRANSITION f g ef

Singularly occurring transition: constructs a signal function that behaves like f until the boolean signal specified by ef is true, when the signal function is switched to behave like g.

[procedure] TRANSIENT f g ef

Singularly occurring transition: constructs a signal function that behaves like f until the boolean signal specified by ef is true, when the signal function is switched to behave like g for (one invocation), and is then immediately switched back to f.

[procedure] LOOP ss f

Constructs a signal function that remembers the values of the signals output by f that are specified in ss. If the signal function is invoked multiple times, the values of the signals in ss are taken not from the input, but from the remembered values.

[procedure] INTEGRAL i d f

One step numerical integration on the pure function f given independent variable i and dependent variable d.

[procedure] INTEGRALH i d h f

One step numerical integration on the pure function f given independent variable i, dependent variable d, and step h.

#### Combinators for systems of equations

The following combinators are provided by library signal-diagram-dynamics:

[procedure] ASSIGN eqn ...
[procedure] ODE eqn ...
[procedure] DAE eqn ...

#### Code generation procedures

[procedure] codegen/Octave
[procedure] codegen/scheme
[procedure] codegen/ML

### Version History

• 1.0 Initial release

``` Copyright 2010-2011 Ivan Raikov and the Okinawa Institute of Science
and Technology.

This program is free software: you can redistribute it and/or modify
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

A full copy of the GPL license can be found at