Derivative
Computes the change from the previous sample divided by dt; the initial condition seeds the previous sample.
Behavior
Section titled “Behavior”y(0) = (u(0) - ic) / dt; for n > 0, y(n) = (u(n) - u(n-1)) / dt.
| Direction | Name | Type |
|---|---|---|
| Input | u |
T |
| Output | y |
T |
Parameters
Section titled “Parameters”| Name | Type | Default | Meaning |
|---|---|---|---|
T |
type (default f64) |
f64 |
Float scalar or float array type |
ic |
T |
ZERO |
Previous sample used at the first tick |
T may be a float scalar or float array; subtraction and scaling are element-wise for arrays. dt must be nonzero.
Example
Section titled “Example”With dt = 0.1, ic = 0, and input samples 0.2, 0.5, 0.5, outputs are 2, 3, 0.