pathsim.blocks.sources module

class pathsim.blocks.sources.Constant(value=1)[source]

Bases: Block

Produces a constant output signal (SISO)

Notes

same as ‘Source’ with func=lambda t:value, therefore one could argue that it is redundant

Parameters:

value (float) – constant defining block output

update(t)[source]

update system equation fixed point loop

Parameters:

t (float) – evaluation time

Returns:

error – relative error to previous iteration for convergence control

Return type:

float

class pathsim.blocks.sources.Source(func=<function Source.<lambda>>)[source]

Bases: Block

Source that produces an arbitrary time dependent output, defined by the func (callable).

Example

For example a ramp: `pyhon S = Source(lambda t : t) `

or a simple sinusoid `python import numpy as np S = Source(np.sin) `

Parameters:

func (callable) – function defining time dependent block output

update(t)[source]

update system equation fixed point loop by evaluating the internal function ‘func’

Parameters:

t (float) – evaluation time

Returns:

error – relative error to previous iteration for convergence control

Return type:

float