Block Diagram Algebra Routines

The Block Diagram Algebra Module

bdalg.py

This file contains some standard block diagram algebra.

Routines in this module:

series parallel negate feedback

bdalg.feedback(sys1, sys2, sign=-1)

Feedback interconnection between two I/O systems.

Parameters :

sys1: scalar, StateSpace, or TransferFunction :

The primary plant. :

sys2: scalar, StateSpace, or TransferFunction :

The feedback plant (often a feedback controller). :

sign: scalar :

The sign of feedback. `sign` = -1 indicates negative feedback, and :

`sign` = 1 indicates positive feedback. `sign` is an optional argument; it :

assumes a value of -1 if not specified. :

Returns :

out: StateSpace or TransferFunction :

Raises :

ValueError :

if sys1 does not have as many inputs as sys2 has outputs, or if sys2 does not have as many inputs as sys1 has outputs

NotImplementedError :

if an attempt is made to perform a feedback on a MIMO TransferFunction object

See also

series, parallel, Notes, ----, This, TransferFunction, TransferFunction, and, object., then, and, the, scalars, then

bdalg.negate(sys)

Return the negative of a system.

Parameters :sys: StateSpace or TransferFunction :
Returns :out: StateSpace or TransferFunction :

Notes

This function is a wrapper for the __neg__ function in the StateSpace and TransferFunction classes. The output type is the same as the input type.

Examples

>>> sys2 = negate(sys1) # Same as sys2 = -sys1.
bdalg.parallel(sys1, sys2)

Return the parallel connection sys1 + sys2.

sys1: scalar, StateSpace, or TransferFunction sys2: scalar, StateSpace, or TransferFunction

Returns :

out: scalar, StateSpace, or TransferFunction :

Raises :

ValueError :

if sys1 and sys2 do not have the same numbers of inputs and outputs

See also

series, feedback

Notes

This function is a wrapper for the __add__ function in the StateSpace and TransferFunction classes. The output type is usually the type of sys1. If sys1 is a scalar, then the output type is the type of sys2.

>>> sys3 = parallel(sys1, sys2) # Same as sys3 = sys1 + sys2.
bdalg.series(sys1, sys2)

Return the series connection sys2 * sys1 for –> sys1 –> sys2 –>.

sys1: scalar, StateSpace, or TransferFunction sys2: scalar, StateSpace, or TransferFunction

Returns :

out: scalar, StateSpace, or TransferFunction :

Raises :

ValueError :

if sys2.inputs does not equal sys1.outputs

See also

parallel, feedback

Notes

This function is a wrapper for the __mul__ function in the StateSpace and TransferFunction classes. The output type is usually the type of sys2. If sys2 is a scalar, then the output type is the type of sys1.

Examples

>>> sys3 = series(sys1, sys2) # Same as sys3 = sys2 * sys1.

Table Of Contents

Previous topic

Matlab-like Routines

This Page