d/dt

Derivative

Continuous
Run the live example Free · no sign-up · runs in your browser

Computes the continuous-time rate of change (time derivative du/dtdu/dt) of an incoming signal with integrated first-order high-frequency low-pass filtering. Pure mathematical differentiation (H(s)=sH(s) = s) is physically non-realizable and exhibits unbounded high-frequency gain, which severely magnifies measurement noise and numerical quantization errors. The Derivative block implements a proper transfer function with a high-frequency filtering pole parameterized by the filter coefficient NN, delivering clean rate estimation and phase-lead stabilization in control systems.

Mathematical Model

In the Laplace domain (ss), the filtered derivative transfer function is defined as:

H(s)=Y(s)U(s)=N⋅ss+NH(s) = \frac{Y(s)}{U(s)} = \frac{N \cdot s}{s + N}

where NN denotes filterCoefficient (filter bandwidth in rad/s\text{rad/s}).

At operational frequencies below the filter pole (ω≪N\omega \ll N), the block closely approximates ideal continuous differentiation:

H(jω)≈jω  ⟹  ∣H(jω)∣≈ω,∠H(jω)≈+90∘H(j\omega) \approx j\omega \implies |H(j\omega)| \approx \omega, \quad \angle H(j\omega) \approx +90^\circ

At high frequencies beyond the pole (ω≫N\omega \gg N), the gain rolls off and plateaus at a finite upper bound:

lim⁡ω→∞∣H(jω)∣=N\lim_{\omega \to \infty} |H(j\omega)| = N

In discrete numerical simulation over timestep Δt=tk−tk−1\Delta t = t_k - t_{k-1}, the recurrence equation is computed as:

y[k]=N⋅(u[k]−u[k−1])+y[k−1]1+N⋅Δty[k] = \frac{N \cdot (u[k] - u[k-1]) + y[k-1]}{1 + N \cdot \Delta t}

Setting N=0N = 0 disables the block and forces the output to zero.

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

Example 1: Velocity Feedback Damping from Position Transducers

In precision galvanometric mirror scanning, an analog sensor monitors angular deflection θ(t)\theta(t). Routing position into a Derivative block with filterCoefficient = 250 rad/s computes angular velocity ω(t)≈θ˙(t)\omega(t) \approx \dot{\theta}(t), feeding an inner velocity loop that damps structural resonance while filtering out megahertz photodiode sensor noise.

Example 2: Early Detection of Chemical Exothermic Runaway

In chemical batch reactor monitoring, the instantaneous rate of temperature rise (dT/dtdT/dt) serves as a primary precursor for exothermic runaway. Passing a thermocouple temperature signal into a Derivative block with filterCoefficient = 20 rad/s calculates the heating rate in real time, triggering emergency cooling jacket valves long before absolute temperature alarm limits are breached.

Remarks & Best Practices

  • High-Frequency Noise Attenuation: Pure mathematical differentiation magnifies high-frequency noise infinitely (+20 dB/decade+20\text{ dB/decade}). The integrated pole at s=−Ns = -N bounds maximum gain to NN, protecting actuators from chatter.
  • First-Step Startup Guard: On the initial simulation step (t=0t = 0), the block outputs zero (y[0]=0y[0] = 0) to eliminate transient derivative spikes caused by abrupt initial condition assignments.
  • Phase Lead Stabilization: Imparts positive phase lead (up to +90∘+90^\circ) across low-to-medium frequencies, a property widely exploited in PD controllers to improve phase margin and damp overshoot.
  • Choice of Filter Bandwidth: Choosing NN too low introduces excessive phase lag that erodes stability; choosing NN too high passes raw high-frequency noise directly into actuators.

Frequently Asked Questions (FAQ)

Q: Why does differentiating an unconditioned signal cause simulation instability?

In continuous math, the derivative of a step function is an infinite Dirac delta δ(t)\delta(t). In discrete numerical simulation, a step change produces a spike of magnitude Δy/Δt\Delta y / \Delta t. As step size Δt→0\Delta t \to 0, this spike approaches infinity, breaking downstream saturation blocks and ODE solvers. Always pass discontinuous signals through a low-pass filter before differentiation.

Related Components

  • Integrator: Inverse mathematical operation (∫u dt\int u \, dt).
  • DiscreteDerivative: Explicit backward-difference discrete-time differentiator.
  • PIDController: Integrated proportional-integral-derivative controller with built-in filtered D-action.
  • LeadLag: Dynamic phase lead and lag compensator for frequency-domain shaping.