Gain
Multiply an input by an adjustable gain.
- signal
- Modelica Standard Library
- 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:PowerSine waveClockAbsSignSqrtSinCosUnary minus
Ports
Inputs 1
-
u
Input signal.
Outputs 1
-
y
Output signal, k · u.
Parameters
-
Gain
k1The constant factor. Any real number; a negative gain inverts the signal.
Equations
Modelica
y = k · u
Implementation
Modelica Standard Library 4.1.0
MSL documentation Modelica.Blocks.Math.GainAssumptions 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.