Delay

class pathsim.blocks.delay.Delay(tau=0.001)[source]

Bases: Block

Delays the input signal by a time constant ‘tau’ in seconds using an adaptive rolling buffer.

Mathematically this block creates a time delay of the input signal like this:

\[\begin{split}y(t) = \begin{cases} x(t - \tau) & , t \geq \tau \\ 0 & , t < \tau \end{cases}\end{split}\]

Note

The internal adaptive buffer uses interpolation for the evaluation. This is required to be compatible with variable step solvers. It has a drawback however. The order of the ode solver used will degrade when this block is used, due to the interpolation.

Example

The block is initialized like this:

#5 time units delay
D = Delay(tau=5)
Parameters:

tau (float) – delay time constant

_buffer

internal interpolatable adaptive rolling buffer

Type:

AdaptiveBuffer

reset()[source]

Reset the blocks inputs and outputs and also its internal solver, if the block has a solver instance.

update(t)[source]

Evaluation of the buffer at different times via interpolation.

Parameters:

t (float) – evaluation time

sample(t, dt)[source]

Sample input values and time of sampling and add them to the buffer.

Parameters:
  • t (float) – evaluation time for sampling

  • dt (float) – integration timestep