Derivative
ContinuousThe Derivative block computes the numerical time derivative (rate of change) of an input signal using backward difference approximation. An optional low-pass filter parameter can be used to reduce noise amplification.
Mathematical Model
Pure derivative (filterCoefficient = 0, default)
Filtered derivative (filterCoefficient = N > 0)
Transfer function: H(s) = N*s / (s + N)
Discrete: D[k] = (N * (u[k] - u[k-1]) + D[k-1]) / (1 + N * Δt)
where:
- u_n is the current input
- u\_{n-1} is the previous input
- Δt is the sample time
- N is the filter coefficient (higher = less filtering)
Inputs & Outputs
| Direction | ID | Label | Type | Status |
|---|---|---|---|---|
| → In | in |
Input | number | Required |
| ← Out | out |
Output | number | Output |
Parameters
| Parameters | Label | Type | Default | Description |
|---|---|---|---|---|
filterCoefficient |
Filter Coefficient (N) | number | 100 |
Implements H(s) = N·s/(s+N). N=0 disables the block (output = 0). N sets the filter bandwidth in rad/s — higher N gives a faster, more accurate derivative but amplifies noise. Practical range: 5–100. Rule of thumb: N ≈ 5–10× the highest signal frequency of interest. |
Usage Examples
Ramp Derivative (1 second simulation)
Linear ramp with slope 2 V/s goes into Derivative block. The output is a constant 2 V, showing that the derivative of a linear signal is its slope.
PID Controller D-Term
Connect the error signal to Derivative, scale with Gain, sum with P and I terms.
Remarks & Best Practices
- Pure Differentiation: Backward difference formula, optionally filtered
- Numerically Noisy: High-frequency content is amplified without filtering; use filterCoefficient to mitigate
- Essential for Control: Forms the D-term in proportional-integral-derivative controllers
- Inverse of Integrator: Complementary to the Integrator block for system analysis
- First Step: Always outputs 0 on the first step to avoid initialization spikes
Related Components
- Integrator: Inverse operation (time integration)
- Gain: Signal scaling for proportional gain
- TransferFunction: General continuous-time dynamics
- PIDController: Has built-in filtered derivative