Gain
MathMultiplies the input signal by a constant scalar gain factor . Serves as the fundamental scaling element in linear dynamical systems, signal processing pipelines, and feedback control architectures. Forms the proportional action in PID controllers, enables conversion between physical engineering units (such as RPM to radians per second), sets open-loop gain margins in Bode stability analysis, and calibrates sensor transducer sensitivity.
Mathematical Model
In continuous and discrete time domains, the gain block performs an instantaneous linear scaling:
In the Laplace domain () and frequency domain (), the transfer function exhibits a constant magnitude and zero frequency-dependent phase lag:
Inputs & Outputs
| Direction | ID | Label | Type | Status |
|---|---|---|---|---|
| → In | in |
Input | number | Required |
| ← Out | out |
Output | number | Output |
Parameters
| Parameters | Label | Type | Default | Description |
|---|---|---|---|---|
gain |
Gain (K) | number | 1 |
Multiplication factor for the input signal |
Usage Examples
Example 1: Proportional Feedback Control Loop
In a position servomechanism, the tracking error from a Subtraction block is fed into a Gain block configured with gain = 25.0 (). The amplified error signal drives the motor actuator, increasing closed-loop stiffness, reducing steady-state tracking offset, and shifting closed-loop system poles toward faster response times.
Example 2: Transducer Unit Conversion (RPM to rad/s)
Rotational speed encoders on turbine shafts report velocity in revolutions per minute (RPM). Wiring the sensor output into a Gain block with gain = 0.104719755 () converts the rotational measurement into SI units of angular velocity (), providing properly scaled telemetry for downstream kinetic energy and torque calculations.
Remarks & Best Practices
- Memoryless Linear Operation: Evaluated as an instantaneous algebraic operator with zero internal state memory, introducing no parasitic phase delay or high-frequency distortion.
- Algebraic Loop Caution: In pure algebraic feedback loops where an actuator instantaneously feeds into a controller without dynamic lag (such as direct feedback through a Gain and Sum block), an algebraic loop occurs unless broken with an
IntegratororUnitDelay. - Decibel Gain Scaling: In Bode frequency analysis, a gain of represents , represents , and represents attenuation.
- High-Performance WASM Execution: Implemented in the Rust WASM core as a single floating-point multiplication instruction with zero heap allocations, ensuring high computational throughput.
Frequently Asked Questions (FAQ)
Q: How does open-loop gain tuning trade off disturbance rejection against noise amplification?
In negative feedback , output tracking error obeys , where Sensitivity and Complementary Sensitivity satisfy . Increasing gain suppresses load disturbances (), but forces , passing sensor noise directly to the actuator. In addition, Bode's sensitivity integral dictates that pushing below 0 dB inevitably amplifies over adjacent frequencies.
Related Components
- Sum: Combines multiple input signals algebraically.
- Product: Multiplies two or more dynamic time-varying signals together.
- Constant: Injects fixed numeric values or offsets into block diagrams.
- PIDController: Packaged three-term controller with configurable proportional, integral, and derivative gains.