Continuous

Derivative Block

Computes the numerical time derivative (rate of change) of the input signal

Open Derivative in BlockWerk →

Description

The 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)

dy/dt ≈ (u_n - u_{n-1}) / Δt

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:

Parameters

filterCoefficient

Low-pass filter coefficient for the derivative. Set to 0 (default) for pure differentiation.

First-Step Behavior

On the very first simulation step, the output is always 0. This prevents a potentially infinite or very large spike that would occur from computing the derivative of an undefined-to-defined transition. On the second step and onward, the normal derivative computation is used.

Noise Sensitivity

Pure numerical differentiation amplifies high-frequency noise. If the input signal is noisy:

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

See Also