Gain
Multiply an input by an adjustable gain.
- signal
- Gradara equations
- 2 ports
- 1 parameter
gainLibraryMathDescription
Multiplies its input by a constant. Use it for fixed scaling, unit conversion, and proportional control.
The block has no state and passes changes straight through.
Example
Math functions Gain, absolute value, square root, sign, negation, and power of a sine; sine and cosine of time.
u = 2 sin(πt/2)Gain 0.5|u|√|u|sign(u)−uu²Timesin(t)cos(t)
Also in this example:Sine waveClockAbsSignSqrtSinCosUnary minusPower
Ports
Inputs 1
-
in
uInput signal.
Outputs 1
-
out
yOutput signal, k · u.
Parameters
-
Gain
k1The constant factor. Any real number; a negative gain inverts the signal.
Equations
Modelica
y = k · u
Implementation
The block’s Modelica model
y = k*u;
Assumptions and limitations
- The gain is fixed during a run. For a gain that changes, multiply by a signal with Product.
Used in
These larger examples use it too. Open them from Examples in the app.
- Data center cooling control
- 480 VAC → 24 VDC flyback
- PMSM · Field-oriented control
See also
Select a block in Gradara and press F1 to open its page offline.