Hold
DiscreteSample-and-hold block that samples the input at regular intervals and holds or interpolates the value between samples.
Mathematical Model
Zero-Order Hold (ZOH):
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
- UnitDelay: Delays by exactly one sample
- DiscreteIntegrator: Discrete-time accumulator