BlockWerk Documentation
−

Subtraction

Math

The Subtraction block performs algebraic subtraction of two input signals: output = plus - minus. This provides an explicit and intuitive alternative to using the Sum block with a negative Gain factor. Essential for generating error signals in feedback control systems.

Simulate in BlockWerk

Interactive sandbox directly in your browser — zero installation, WASM-powered.

Simulate in BlockWerk →

Mathematical Model

y(t)=u1(t)−u2(t)y(t) = u_1(t) - u_2(t)

Inputs & Outputs

Direction ID Label Type Status
→ In in1 + number Required
→ In in2 - number Required
← Out out Output number Output

Usage Examples

Reference signal (5) minus measured signal (3) produces error (2).

Remarks & Best Practices

  • Two explicit inputs: plus (minuend) and minus (subtrahend)
  • Zero computational overhead
  • Essential in feedback control: error = setpoint - measured
  • More intuitive than Sum block with negative Gain
  • Commonly used in PID controller error computation

Related Components

  • Sum: Signal addition with configurable inputs
  • Gain: Signal scaling (use for negative Gain)
  • Saturation: Output limiting for error bounds