control.summing_junction
- control.summing_junction(inputs=None, output=None, dimension=None, prefix='u', **kwargs)[source]
Create a summing junction as an input/output system.
This function creates a static input/output system that outputs the sum of the inputs, potentially with a change in sign for each individual input. The input/output system that is created by this function can be used as a component in the
interconnect
function.- Parameters
- inputsint, string or list of strings
Description of the inputs to the summing junction. This can be given as an integer count, a string, or a list of strings. If an integer count is specified, the names of the input signals will be of the form ‘u[i]’.
- outputstring, optional
Name of the system output. If not specified, the output will be ‘y’.
- dimensionint, optional
The dimension of the summing junction. If the dimension is set to a positive integer, a multi-input, multi-output summing junction will be created. The input and output signal names will be of the form ‘<signal>[i]’ where ‘signal’ is the input/output signal name specified by the
inputs
andoutput
keywords. Default value is None.- namestring, optional
System name (used for specifying signals). If unspecified, a generic name ‘sys[id]’ is generated with a unique integer id.
- prefixstring, optional
If
inputs
is an integer, create the names of the states using the given prefix (default = ‘u’). The names of the input will be of the form ‘prefix[i]’.
- Returns
- sys
StateSpace
Linear input/output system object with no states and only a direct term that implements the summing junction.
- sys
Examples
>>> P = ct.tf(1, [1, 0], inputs='u', outputs='y') >>> C = ct.tf(10, [1, 1], inputs='e', outputs='u') >>> sumblk = ct.summing_junction(inputs=['r', '-y'], output='e') >>> T = ct.interconnect([P, C, sumblk], inputs='r', outputs='y') >>> T.ninputs, T.noutputs, T.nstates (1, 1, 2)