pathsim.blocks.adder module¶
- class pathsim.blocks.adder.Adder(operations=None)[source]¶
Bases:
BlockSumms / adds up all input signals to a single output signal (MISO)
This is how it works in the default case
\[y(t) = \sum_i u_i(t)\]and like this when additional operations are defined
\[y(t) = \sum_i \mathrm{op}_i \cdot u_i(t)\]Example
This is the default initialization that just adds up all the inputs:
A = Adder()
and this is the initialization with specific operations that subtracts the second from first input and neglects all others:
A = Adder('+-')
Note
This block is purely algebraic and its operation (op_alg) will be called multiple times per timestep, each time when Simulation._update(t) is called in the global simulation loop.
- Parameters:
operations (str, optional) – optional string of operations to be applied before summation, i.e. ‘+-’ will compute the difference, ‘None’ will just perform regular sum
- _ops_array¶
operations converted to array
- Type:
array_like