BlockWerk Documentation
⏸

Hold

Discrete

Sample-and-hold block that samples the input at regular intervals and holds or interpolates the value between samples.

Simulate in BlockWerk

Interactive sandbox directly in your browser — zero installation, WASM-powered.

Simulate in BlockWerk →

Mathematical Model

Zero-Order Hold (ZOH):

y(t)=u(tk)for tk≤t<tk+1y(t) = u(t_k) \quad \text{for } t_k \le t < t_{k+1}

First-Order Hold (FOH):

y(t) = u(t_k) + (u(t_k) - u(t_{k-1}))/T · (t - t_k)  for t_k ≤ t < t_{k+1}

where t_k = k · T and T is the sample time.

Inputs & Outputs

Direction ID Label Type Status
→ In in In number Required
← Out out Out number Output

Parameters

Parameters Label Type Default Description
mode Hold Mode select zoh
sampleTime Sample Time number 0.01

Usage Examples

  • Zie de ingebouwde voorbeelden in de handleiding voor een demonstratie van dit blok.

Remarks & Best Practices

  • ZOH vs FOH: Zero-Order Hold produces a staircase output (common in DACs); First-Order Hold linearly extrapolates (smoother but can overshoot)
  • Sample time: Must be ≥ the simulation base timestep; values below the base step are clamped
  • Rate transition: Use Hold to bridge subsystems running at different sample rates
  • ZOH mode: Most numerically stable; recommended unless FOH's smoother output is explicitly needed
  • FOH mode: Requires two prior samples; initial behaviour differs on the first step after a rate transition

Related Components