↕

Min/Max

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

Evaluates and outputs the minimum or maximum scalar value across all connected input signals. Supports multiple simultaneous input connections on a single port, making it indispensable for auctioneering override control, multi-sensor safety limits, peak envelope detection, dynamic constraint handling, and selective arbitration between conflicting control commands.

Mathematical Model

For an arbitrary set of KK active input signals u1(t),u2(t),…,uK(t)u_1(t), u_2(t), \dots, u_K(t), the output is determined by the configured operation mode:

y(t)={min⁡(u1(t),u2(t),…,uK(t)),if operation="min"max⁡(u1(t),u2(t),…,uK(t)),if operation="max"y(t) = \begin{cases} \min \left( u_1(t), u_2(t), \dots, u_K(t) \right), & \text{if operation} = \text{"min"} \\ \max \left( u_1(t), u_2(t), \dots, u_K(t) \right), & \text{if operation} = \text{"max"} \end{cases}

In the boundary case where only a single signal is wired to the port (K=1K = 1), the block operates as a transparent unity passthrough:

y(t)=u1(t)y(t) = u_1(t)

Inputs & Outputs

Direction ID Label Type Status
→ In in Input number Required
← Out out Output number Output

Parameters

Parameters Label Type Default Description
operation Operation select min

Usage Examples

Example 1: Auctioneering Low-Select Override Protection

In turbomachinery and boiler control, both a speed governor and an over-temperature limiter calculate permissible fuel actuator positions. Connecting both controller outputs to a MinMax block configured with operation = "min" forms an auctioneering low-select circuit. Under normal operation, the speed governor dictates fuel flow; if cylinder temperatures exceed safe limits, the temperature limiter output drops lower and seamlessly overrides control to prevent thermal damage.

Example 2: Peak Envelope Follower with Leaky Discharge

In acoustic vibration telemetry and power grid ripple monitoring, tracking instantaneous amplitude envelopes requires latching signal peaks. Passing a full-wave rectified sensor signal ∣u(t)∣|u(t)| and a slowly decaying leaky integrator state into a MinMax block set to operation = "max" ensures that rapid positive spikes immediately update the output, while the trailing edge decays smoothly at the integrator's rate.

Remarks & Best Practices

  • Multi-Wire Input Binding: The input terminal supports multiple incoming connections simultaneously (multiple: true), eliminating the need to cascade separate two-input blocks for large signal sets.
  • Auctioneering Control Architecture: Extensively used in industrial safety instrumentation (API 670, IEC 61511) to implement low-select and high-select auctioneering between redundant sensors or competing controllers.
  • High-Performance Rust Execution: Implemented in the WASM engine as a single-pass linear comparison with O(K)\mathcal{O}(K) time complexity and zero memory allocations during simulation ticks.
  • Dynamic Clamping Synergy: Cascading a MinMax (max with lower threshold) and a MinMax (min with upper threshold) allows creating dynamic, signal-dependent saturation boundaries driven by external signals.

Related Components

  • Saturation: Clips a signal between fixed parameter bounds.
  • Switch: Multiplexes between candidate signals using a threshold or logic condition.
  • Relay: Produces discontinuous two-state output with configurable hysteresis.
  • DeadZone: Suppresses signals within an insensitivity interval around zero.