chickadee » signal-diagram

Outdated egg!

This is an egg for CHICKEN 4, the unsupported old release. You're almost certainly looking for the CHICKEN 5 version of this egg, if it exists.

If it does not exist, there may be equivalent functionality provided by another egg; have a look at the egg index. Otherwise, please consider porting this egg to the current version of CHICKEN.

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.

Pure signal functions and functional expressions

Basic combinators

IDENTITY fprocedure

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

PURE fprocedure

Constructs a signal function with no side effects.

RELATION r fprocedure

Defines the relation r within the signal function f.

UNION f gprocedure

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.

SEQUENCE f gprocedure

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.

PIPE f gprocedure

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.

SENSE ss fprocedure

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

ACTUATE ss fprocedure

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

RTRANSITION f g ef eg sprocedure

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. s is the name of the state variable that indicates the current state: if false, the state is f, otherwise the state is g.

TRANSITION f g ef eprocedure

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. s is the name of the state variable that indicates the current state: if false, the state is f, otherwise the state is g.

TRANSIENT f g efprocedure

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.

ON f efprocedure

Constructs a signal function that behaves like f only when the boolean signal specified by ef is true, otherwise copies the input to the output.

INTEGRAL i d fprocedure

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

INTEGRALH i d h fprocedure

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:

ASSIGNprocedure
ODEprocedure
DAEprocedure

Code generation procedures

codegen/Octaveprocedure
codegen/schemeprocedure
codegen/MLprocedure

Requires

Version History

License

 Copyright 2010-2014 Ivan Raikov


 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 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
 <http://www.gnu.org/licenses/>.

Contents »