pySimBlocks.blocks.operators.dead_zone

class pySimBlocks.blocks.operators.dead_zone.DeadZone(name: str, lower_bound: ArrayLike = 0.0, upper_bound: ArrayLike = 0.0, sample_time: float | None = None)[source]

Bases: Block

Discrete-time dead-zone operator.

Suppresses the input within a specified interval and shifts the signal outside it:

y = 0 if lower_bound <= u <= upper_bound

y = u - upper_bound if u > upper_bound

y = u - lower_bound if u < lower_bound

Bounds are applied component-wise and resolved on the first call. Once the input shape is resolved it must remain constant.

lower_raw

Raw lower bound array before broadcasting.

upper_raw

Raw upper bound array before broadcasting.

lower_bound

Broadcasted lower bound matched to the input shape, or None before the first resolution.

upper_bound

Broadcasted upper bound matched to the input shape, or None before the first resolution.

direct_feedthrough = True

True if outputs depend directly on inputs.

initialize(t0: float) None[source]

Resolve bounds from the initial input and compute the initial output.

Parameters:

t0 – Initial simulation time in seconds.

Raises:
  • RuntimeError – If input 'in' is None at initialization.

  • ValueError – If input is not 2D or bounds have incompatible shapes.

output_update(t: float, dt: float) None[source]

Apply the dead zone to the input and write the result to the output port.

Parameters:
  • t – Current simulation time in seconds.

  • dt – Current time step in seconds.

Raises:
  • RuntimeError – If input 'in' is None.

  • ValueError – If input is not 2D or its shape changed after initialization.

state_update(t: float, dt: float) None[source]

No-op: DeadZone is a stateless block.

Parameters:
  • t – Current simulation time in seconds.

  • dt – Current time step in seconds.