Adder

class pathsim.blocks.adder.Adder(operations=None)[source]

Bases: Block

Summs / 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

dict that maps string operations to numerical

Type:

dict

_ops_array

operations converted to array

Type:

array_like

op_alg

internal algebraic operator

Type:

Operator

update(t)[source]

update system equation in fixed point loop for algebraic loops, with optional error control

Parameters:

t (float) – evaluation time