Zero-order hold
signal.zero_order_hold
Samples the input every Ts seconds and holds that value until the next sample. The first sample is taken at t = Ts; before it the output is 0.
Ports
| Name | Domain | Direction |
|---|---|---|
u | signal | in |
y | signal | out |
Parameters
| Name | Unit | Default | Range | Description |
|---|---|---|---|---|
Ts | s | 0.1 | 0 to ∞ | Sample period |
Variables
| Name | Unit | Start | Description |
|---|---|---|---|
held | 1 | Last sampled input | |
next | s | Ts | Time of the next sample |
Equations
der(held) = 0 der(next) = 0 when time >= next then reinit(held, u), reinit(next, next + Ts) y = held