block MatrixGain "Output the product of a gain matrix with the input signal vector"
parameter Real K[:,:] = [1,0; 0,1] "Gain matrix which is multiplied with the input";
extends Interfaces.MIMO(final nin = size(K, 2), final nout = size(K, 1));
equation
y = K * u;
annotation (
Documentation(info = "<html>\n<p>\nThis blocks computes output vector <strong>y</strong> as <em>product</em> of the\ngain matrix <strong>K</strong> with the input signal vector <strong>u</strong>:\n</p>\n<pre>\n <strong>y</strong> = <strong>K</strong> * <strong>u</strong>;\n</pre>\n<p>\nExample:\n</p>\n<pre>\n parameter: <strong>K</strong> = [0.12 2; 3 1.5]\n\n results in the following equations:\n\n | y[1] | | 0.12 2.00 | | u[1] |\n | | = | | * | |\n | y[2] | | 3.00 1.50 | | u[2] |\n</pre>\n\n</html>"),
Icon(
coordinateSystem(
preserveAspectRatio = true,
extent = {
{-100, -100},
{100, 100}}),
graphics = {
Text(
extent = {
{-90, -60},
{90, 60}},
lineColor = {160, 160, 164},
textString = "*K")}),
Diagram(
coordinateSystem(
preserveAspectRatio = true,
extent = {
{-100, -100},
{100, 100}}),
graphics = {
Rectangle(
extent = {
{-100, -100},
{100, 100}},
lineColor = {0, 0, 255},
fillColor = {255, 255, 255},
fillPattern = FillPattern.Solid),
Text(
extent = {
{-90, -60},
{90, 60}},
lineColor = {160, 160, 164},
textString = "*K")}));
end MatrixGain;