Counter

class pathsim.blocks.counter.Counter(start=0, threshold=0.0)[source]

Bases: Block

Counter block that counts the number of detected bidirectional zero-crossing events and sets the output accordingly.

Parameters:
  • start (int) – counter start (initial condition)

  • threshold (float) – threshold for zero crossing

E

internal event manager

Type:

ZeroCrossing

events

internal zero crossing event

Type:

list[ZeroCrossing]

update(t)[source]

update system equation for fixed point loop, here just setting the outputs

Note

no direct passthrough, so the ‘update’ method is optimized for this case

Parameters:

t (float) – evaluation time

class pathsim.blocks.counter.CounterUp(start=0, threshold=0.0)[source]

Bases: Counter

Counter block that counts the number of detected unidirectional zero-crossing events and sets the output accordingly.

Note

This is a modification of ‘Counter’ which only counts unidirectional zero-crossings (low -> high)

Parameters:
  • start (int) – counter start (initial condition)

  • threshold (float) – threshold for zero crossing

E

internal event manager

Type:

ZeroCrossingUp

events

internal zero crossing event

Type:

list[ZeroCrossing]

class pathsim.blocks.counter.CounterDown(start=0, threshold=0.0)[source]

Bases: Counter

Counter block that counts the number of detected unidirectional zero-crossing events and sets the output accordingly.

Note

This is a modification of ‘Counter’ which only counts unidirectional zero-crossings (high -> low)

Parameters:
  • start (int) – counter start (initial condition)

  • threshold (float) – threshold for zero crossing

E

internal event manager

Type:

ZeroCrossingDown

events

internal zero crossing event

Type:

list[ZeroCrossing]