Gain
Description of the Gain component in Schematic Editor, which multiplies the input value by a constant.
Component Icon
Description
The Gain component multiplies an input value by a constant. The mathematical operations available are elementwise gain (y = K.*u) or matrix gain (y = K*u).
The constant for the Gain component can also be set as Tunable if changing of the constant during runtime is needed. Please refer to the Tunable components documentation for more information.
 Elementwise multiplication: is performed by multiplying each element
of the input signal by the corresponding element in the gain matrix.
Examples:
 Scalar multiplication: The Gain value is a scalar and the input
of the gain component is also a scalar. The output of gain component
is a simple multiplication of these values.

$\underset{x}{\underset{\u23df}{2}}*\underset{K}{\underset{\u23df}{3}}=\underset{y}{\underset{\u23df}{6}}$

 Elementwise multiplication: The Gain value is a scalar and the
input of the Gain component is a vector of size ‘n’. The output of the
Gain component is a vector of size ‘n’ where each element is a
multiplication of each element of the input by the gain.

$\underset{x}{\underset{\u23df}{[2,3,5]}}*\underset{K}{\underset{\u23df}{3}}=\underset{y}{\underset{\u23df}{[6,9,15]}}$

 Elementwise multiplication: The Gain value is a vector of
size ‘n’ and the input of the Gain component is a scalar. The output
of the Gain component is a vector of size ‘n’ where each element is a
multiplication of the input by each element of the gain.

$\underset{x}{\underset{\u23df}{3}}*\underset{K}{\underset{\u23df}{[2,3,5]}}=\underset{y}{\underset{\u23df}{[6,9,15]}}$

 Elementwise multiplication: The Gain value and the input of
the Gain component are both vectors of size ‘n’. The output of the
Gain component is a vector of size ‘n’ where each element is an
elementwise multiplication of the input by the gain.

$\underset{x}{\underset{\u23df}{[2,3,5]}}*\underset{K}{\underset{\u23df}{[1,2,3]}}=\underset{y}{\underset{\u23df}{[2,6,15]}}$

 Scalar multiplication: The Gain value is a scalar and the input
of the gain component is also a scalar. The output of gain component
is a simple multiplication of these values.
 Matrix multiplication: The input and gain are matrixmultiplied with
the input as the first element. The Gain value is a matrix of length m x n and
the input of the Gain component is a vector of length m. The output of the Gain
component is a vector with n elements.

$\underset{x}{\underset{\u23df}{[1,3,2]}}*\underset{K}{\underset{\u23df}{\left[\begin{array}{ccc}1& 2& 3\\ 4& 5& 6\\ 7& 8& 9\end{array}\right]}}=\underset{y}{\underset{\u23df}{[27,33,39]}}$

Ports
 Input port (in)
 Supported types: uint, int, and real.
 Vector support: yes.
 Output port (out)
 Supported types: uint, int, and real.
 Output type is inherited from the input signals.
 Vector support: yes.
 Vector length is calculated according to the form of the input signal and the gain of the component.
 Supported types: uint, int, and real.
Properties
 Gain
 Type in the value, vector of values, or matrix of values of the gain by which to multiply the input.
 Multiplication
 Choose the type of operation to be performed by the component. This property can be selected as “Elementwise” or “Matrix”.
 Tunable
 Enables runtime tuning of the selected component. This will allow you to change values for gain during simulation without the need to recompile the model. Tunable properties are available in HIL SCADA in Model Explorer.
 Execution rate:
 Type in the desired signal processing execution rate. This value must be compatible with other signal processing components of the same circuit: the value must be a multiple of the fastest execution rate in the circuit. There can be up to four different execution rates. To specify the execution rate, you can use either decimal (e.g. 0.001) or exponential values (e.g. 1e3) in seconds. Alternatively, you can type in ‘inherit’ in which case the component will be assigned execution rate based on the execution rate of the components it is receiving input from.