uyk=$(k)Gain Icon

Gain

Output the product of a gain value with the input signal.

This component extends from SISO

Usage

Gain(k)

Parameters:

NameDescriptionUnitsDefault value
k

Connectors

  • u - This connector represents a real signal as an input to a component (RealInput)
  • y - This connector represents a real signal as an output from a component (RealOutput)

Behavior

\[ \begin{align} y\left( t \right) &= k u\left( t \right) \end{align} \]

Source

# Output the product of a gain value with the input signal.
component Gain
  extends SISO
  parameter k::Real
relations
  y = k*u
metadata {
  "JuliaSim": {
    "labels": [{"label": "k=$(k)", "x": 500, "y": 500, "rot": 0}],
    "icons": {"default": "jsml://BlockComponents/Gain.svg"}
  }
}
end
Flattened Source
# Output the product of a gain value with the input signal.
component Gain
  u = RealInput() [{
    "JuliaSim": {
      "placement": {"icon": {"iconName": "input", "x1": -50, "y1": 450, "x2": 50, "y2": 550}}
    }
  }]
  y = RealOutput() [{
    "JuliaSim": {
      "placement": {"icon": {"iconName": "output", "x1": 950, "y1": 450, "x2": 1050, "y2": 550}}
    }
  }]
  parameter k::Real
relations
  y = k*u
metadata {
  "JuliaSim": {
    "labels": [{"label": "k=$(k)", "x": 500, "y": 500, "rot": 0}],
    "icons": {"default": "jsml://BlockComponents/Gain.svg"}
  }
}
end

Test Cases

  • Examples
  • Experiments
  • Analyses