## Modelica.Blocks.Math

Mathematical functions as input/output blocks

### Information

This package contains basic mathematical operations, such as summation and multiplication, and basic mathematical functions, such as sqrt and sin, as input/output blocks. All blocks of this library can be either connected with continuous blocks or with sampled-data blocks. In particular the following operations and functions are provided:

       TwoInputs     Change causality of input signals.
       TwoOutputs    Change causality of output signals.
       Gain          Output the input multiplied by a scalar gain
       MatrixGain    Output the product of a gain matrix with the input
       Sum           Output the sum of the elements of the input vector
       Feedback      Output difference between commanded and feedback input
       Add           Output the sum of the two inputs
       Add3          Output the sum of the three inputs
       Product       Output product of the two inputs
       Division      Output first input divided by second input
       Abs           Output the absolute value of the input
       Sign          Output the sign of the input
       Sqrt          Output the square root of the input
       Sin           Output the sine of the input
       Cos           Output the cosine of the input
       Tan           Output the tangent of the input
       Asin          Output the arc sine of the input
       Acos          Output the arc cosine of the input
       Atan          Output the arc tangent of the input
       Atan2         Output atan(u1/u2) of the inputs u1 and u2
       Sinh          Output the hyperbolic sine of the input
       Cosh          Output the hyperbolic cosine of the input
       Tanh          Output the hyperbolic tangent of the input
       Exp           Output the exponential (base e) of the input
       Log           Output the natural (base e) logarithm of the input
       Log10         Output the base 10 logarithm of the input
       RealToInteger Output the nearest Integer value to the input
       IntegerToReal Output the input as Real value
       Max           Output the maximum of the two inputs
       Min           Output the minimum of the two inputs
       Edge          Set output to true at rising edge of the input
       BooleanChange Set output to true when Boolean input changes
       IntegerChange Set output to true when Integer input changes

Main Author:
  Martin Otter
  Deutsches Zentrum fuer Luft und Raumfahrt e.V. (DLR)
  Oberpfaffenhofen
  Postfach 1116
  D-82230 Wessling
  email: Martin.Otter@dlr.de

Release Notes:

- October 21, 2002 by Martin Otter and Christian Schweiger:
  New blocks added: RealToInteger, IntegerToReal, Max, Min, Edge, BooleanChange, IntegerChange.
- August 7, 1999 by Martin Otter:
  Realized (partly based on an existing Dymola library of Dieter Moormann and Hilding Elmqvist).

Copyright © 1999-2002, Modelica Association and DLR.

The Modelica package is free software; it can be redistributed and/or modified under the terms of the Modelica license, see the license conditions and the accompanying disclaimer in the documentation of package Modelica in file "Modelica/package.mo".

## Modelica.Blocks.Math.Gain

Output the element-wise product of a gain vector with the input signal vector

### Information

This block computes the output y=outPort.signal as element-wise product of gain k with the input u = inPort.signal:

        y[i] = k[i] * u[i];

Release Notes:

- August 7, 1999 by Martin Otter:
  Realized.

### Parameters

Name | Default | Description
--- | --- | ---
k[:] | {1} | Gain vector multiplied element-wise with input vector

### Modelica definition

    block Gain
      "Output the element-wise product of a gain vector with the input signal vector"

      parameter Real k[:]={1}
        "Gain vector multiplied element-wise with input vector";
    protected
      Real u[size(k, 1)] "Input signals";
      Real y[size(k, 1)] "Output signals";
    public
      Interfaces.InPort inPort(final n=size(k, 1)) "Input signal connector";
      Interfaces.OutPort outPort(final n=size(k, 1)) "Output signal connector";
    equation
      u = inPort.signal;
      y = outPort.signal;
      for i in 1:size(k, 1) loop
        y[i] = k[i]*u[i];
      end for;
    end Gain;

## Modelica.Blocks.Math.Add3

Output the sum of the three inputs

### Information

This block computes the output y=outPort.signal as sum of the three input signals u1=inPort1.signal, u2=inPort2.signal and u3=inPort3.signal:

        y = k1*u1 + k2*u2 + k3*u3;

Example:

         parameter:   n = 2, k1= +2, k2= -3, k3=1;

      results in the following equations:

         y[1] = 2 * u1[1] - 3 * u2[1] + u3[1];
         y[2] = 2 * u1[2] - 3 * u2[2] + u3[2];

Release Notes:

- August 7, 1999 by Martin Otter:
  Realized.

### Parameters

Name | Default | Description
--- | --- | ---
k1 | +1 | Gain of upper input
k2 | +1 | Gain of middle input
k3 | +1 | Gain of lower input
n | 1 | Dimension of input and output vectors.

### Modelica definition

    block Add3 "Output the sum of the three inputs"
      extends Interfaces.BlockIcon;

      parameter Real k1=+1 "Gain of upper input";
      parameter Real k2=+1 "Gain of middle input";
      parameter Real k3=+1 "Gain of lower input";
      parameter Integer n=1 "Dimension of input and output vectors.";
      Interfaces.InPort inPort1(final n=n) "Connector 1 of Real input signals";
      Interfaces.InPort inPort2(final n=n) "Connector 2 of Real input signals";
      Interfaces.InPort inPort3(final n=n) "Connector 3 of Real input signals";
      Interfaces.OutPort outPort(final n=n) "Connector of Real output signals";
    equation
      outPort.signal = k1*inPort1.signal + k2*inPort2.signal + k3*inPort3.signal;
    end Add3;

## Modelica.Blocks.Math.Add

Output the sum of the two inputs

### Information

This block computes the output y=outPort.signal as sum of the two input signals u1=inPort1.signal and u2=inPort2.signal:

        y = k1*u1 + k2*u2;

Example:

         parameter:   n = 2, k1= +2, k2= -3

      results in the following equations:

         y[1] = 2 * u1[1] - 3 * u2[1]
         y[2] = 2 * u1[2] - 3 * u2[2]

Release Notes:

- August 7, 1999 by Martin Otter:
  Realized.

### Parameters

Name | Default | Description
--- | --- | ---
n | 1 | Dimension of input and output vectors.
k1 | +1 | Gain of upper input
k2 | +1 | Gain of lower input

### Modelica definition

    block Add "Output the sum of the two inputs"
      extends Interfaces.MI2MO;
      parameter Real k1=+1 "Gain of upper input";
      parameter Real k2=+1 "Gain of lower input";
    equation
      y = k1*u1 + k2*u2;
    end Add;

## Modelica.Blocks.Math.TwoInputs

Change causality of input signals (e.g. for inverse models)

### Information

This block is used to enable assignment of values to variables preliminary defined as outputs (e.g. useful for inverse model generation).

Release Notes:

- June 28, 2001 by Michael Thümmel:
  Realized.

### Parameters

Name | Default | Description
--- | --- | ---
n | 1 | number of input signals

### Modelica definition

    block TwoInputs
      "Change causality of input signals (e.g. for inverse models)"

      extends Interfaces.BlockIcon;
      parameter Integer n=1 "number of input signals";

      Interfaces.InPort inPort1(n=n);
      Interfaces.InPort inPort2(n=n);
    equation
      inPort1.signal = inPort2.signal;
    end TwoInputs;

## Modelica.Blocks.Math.TwoOutputs

Change causality of output signals (e.g. for inverse models)

### Information

This block is used to enable assignment of values to variables preliminary defined as inputs (e.g. useful for inverse model generation).

Release Notes:

- June 28, 2001 by Michael Thümmel:
  Realized.

### Parameters

Name | Default | Description
--- | --- | ---
n | 1 | number of input signals

### Modelica definition

    block TwoOutputs
      "Change causality of output signals (e.g. for inverse models)"
      extends Interfaces.BlockIcon;
      parameter Integer n=1 "number of input signals";

      Interfaces.OutPort OutPort1(n=n);
      Interfaces.OutPort OutPort2(n=n);
    equation
      OutPort1.signal = OutPort2.signal;
    end TwoOutputs;

## Modelica.Blocks.Math.MatrixGain

Output the product of a gain matrix with the input signal vector

### Information

This block computes the output y=outPort.signal as product of the gain matrix K with the input signal vector u = inPort.signal:

        y = K * u;

Example:

       parameter: K = [0.12 2; 3 1.5]

       results in the following equations:

         | y[1] |     | 0.12  2.00 |   | u[1] |
         |      |  =  |            | * |      |
         | y[2] |     | 3.00  1.50 |   | u[2] |

Release Notes:

- August 7, 1999 by Martin Otter:
  Realized.

### Parameters

Name | Default | Description
--- | --- | ---
K[:, :] | [1, 0; 0, 1] | Gain matrix which is multiplied with the input

### Modelica definition

    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;
    end MatrixGain;

## Modelica.Blocks.Math.Sum

Output the sum of the elements of the input vector

### Information

This block computes the output y=outPort.signal[1] as sum of the elements of the input signal vector u=inPort.signal:

        y = u[1] + u[2] + ... + u[nin];

Example: With parameter `nin = 3` results the following equation:

        y = u[1] + u[2] + u[3];

Optionally, the `parameter Real k[nin]=ones(nin)` could be changed to weight the sum elements in order to calculate the scalar product

        y = k*u = k[1]*u[1] + k[2]*u[2] + ... + k[nin]*u[nin]  .

Release Notes:

- Oct. 25, 2002 by Christian Schweiger:
  Realized an improved implementation with avoidance of an algorithm section, which would lead to expensive function calls.
- Oct. 24, 1999 by Martin Otter:
  Realized.

### Parameters

Name | Default | Description
--- | --- | ---
nin | 1 | Number of inputs
k[nin] | ones(nin) | Optional: sum coefficients

### Modelica definition

    block Sum "Output the sum of the elements of the input vector"
      extends Interfaces.MISO;

      parameter Real k[nin]=ones(nin) "Optional: sum coefficients";

    equation
      y = k*u;
    end Sum;

## Modelica.Blocks.Math.Feedback

Output difference between commanded and feedback input

### Information

This block computes the output y=outPort.signal as difference of the commanded input u1=inPort1.signal and the feedback input u2=inPort2.signal:

        y = u1 - u2;

Example:

         parameter:   n = 2

      results in the following equations:

         y[1] = u1[1] - u2[1]
         y[2] = u1[2] - u2[2]

Release Notes:

- August 7, 1999 by Martin Otter:
  Realized.

### Parameters

Name | Default | Description
--- | --- | ---
n | 1 | size of input and feedback signal

### Modelica definition

    block Feedback
      "Output difference between commanded and feedback input"
      parameter Integer n=1 "size of input and feedback signal";
      Interfaces.InPort inPort1(final n=n);
      Interfaces.InPort inPort2(final n=n);
      Interfaces.OutPort outPort(final n=n);
    equation
      outPort.signal = inPort1.signal - inPort2.signal;
    end Feedback;

## Modelica.Blocks.Math.Product

Output product of the two inputs

### Information

This block computes the output y=outPort.signal element-wise as product of the corresponding elements of the two inputs u1=inPort1.signal and u2=inPort2.signal:

        y[i] = u1[i] * u2[i];

Release Notes:

- August 7, 1999 by Martin Otter:
  Realized.

### Parameters

Name | Default | Description
--- | --- | ---
n | 1 | Dimension of input and output vectors.

### Modelica definition

    block Product "Output product of the two inputs"
      extends Interfaces.MI2MO;
    equation
      for i in 1:n loop
        y[i] = u1[i]*u2[i];
      end for;
    end Product;

## Modelica.Blocks.Math.Division

Output first input divided by second input

### Information

This block computes the output y=outPort.signal element-wise by dividing the corresponding elements of the two inputs u1=inPort1.signal and u2=inPort2.signal:

        y[i] = u1[i] / u2[i];

Release Notes:

- August 7, 1999 by Martin Otter:
  Realized.

### Parameters

Name | Default | Description
--- | --- | ---
n | 1 | Dimension of input and output vectors.

### Modelica definition

    block Division "Output first input divided by second input"
      extends Interfaces.MI2MO;
    equation
      for i in 1:n loop
        y[i] = u1[i]/u2[i];
      end for;
    end Division;

## Modelica.Blocks.Math.Abs

Output the absolute value of the input

### Information

This block computes the output y=outPort.signal element-wise as absolute value of the input u=inPort.signal:

        y[i] = abs( u[i] );

Release Notes:

- August 7, 1999 by Martin Otter:
  Realized.

### Parameters

Name | Default | Description
--- | --- | ---
n | 1 | Number of inputs (= number of outputs)

### Modelica definition

    block Abs "Output the absolute value of the input"
      extends Interfaces.MIMOs;
    equation
      y = abs(u);
    end Abs;

## Modelica.Blocks.Math.Sign

Output the sign of the input

### Information

This block computes the output y=outPort.signal element-wise as sign of the input u=inPort.signal:

                1  if u[i] > 0
        y[i] =  0  if u[i] == 0
               -1  if u[i] < 0

Release Notes:

- August 7, 1999 by Martin Otter:
  Realized.

### Parameters

Name | Default | Description
--- | --- | ---
n | 1 | Number of inputs (= number of outputs)

### Modelica definition

    block Sign "Output the sign of the input"
      extends Interfaces.MIMOs;
    equation
      y = sign(u);
    end Sign;

## Modelica.Blocks.Math.Sqrt

Output the square root of the input (input >= 0 required)

### Information

This block computes the output y=outPort.signal element-wise as square root of the input u=inPort.signal:

        y[i] = sqrt( u[i] );

All elements of the input vector shall be zero or positive. Otherwise an error occurs.

Release Notes:

- August 7, 1999 by Martin Otter:
  Realized.

### Parameters

Name | Default | Description
--- | --- | ---
n | 1 | Number of inputs (= number of outputs)

### Modelica definition

    block Sqrt
      "Output the square root of the input (input >= 0 required)"
      extends Interfaces.MIMOs;
    equation
      y = sqrt(u);
    end Sqrt;

## Modelica.Blocks.Math.Sin

Output the sine of the input

### Information

This block computes the output y=outPort.signal element-wise as sine of the input u=inPort.signal:

        y[i] = sin( u[i] );

Release Notes:

- August 7, 1999 by Martin Otter:
  Realized.

### Parameters

Name | Default | Description
--- | --- | ---
n | 1 | Number of inputs (= number of outputs)

### Modelica definition

    block Sin "Output the sine of the input"
      extends Interfaces.MIMOs;
    equation
      y = Modelica.Math.sin(u);
    end Sin;

## Modelica.Blocks.Math.Cos

Output the cosine of the input

### Information

This block computes the output y=outPort.signal element-wise as cos of the input u=inPort.signal:

        y[i] = cos( u[i] );

Release Notes:

- August 7, 1999 by Martin Otter:
  Realized.

### Parameters

Name | Default | Description
--- | --- | ---
n | 1 | Number of inputs (= number of outputs)

### Modelica definition

    block Cos "Output the cosine of the input"
      extends Interfaces.MIMOs;
    equation
      y = Modelica.Math.cos(u);
    end Cos;

## Modelica.Blocks.Math.Tan

Output the tangent of the input

### Information

This block computes the output y=outPort.signal element-wise as tan of the input u=inPort.signal:

        y[i] = tan( u[i] );

Release Notes:

- August 7, 1999 by Martin Otter:
  Realized.

### Parameters

Name | Default | Description
--- | --- | ---
n | 1 | Number of inputs (= number of outputs)

### Modelica definition

    block Tan "Output the tangent of the input"
      extends Interfaces.MIMOs;
    equation
      y = Modelica.Math.tan(u);
    end Tan;

## Modelica.Blocks.Math.Asin

Output the arc sine of the input

### Information

This block computes the output y=outPort.signal element-wise as the sine-inverse of the input u=inPort.signal:

        y[i] = asin( u[i] );

The absolute values of the elements of the input u need to be less or equal to one (abs( u[i] ) <= 1). Otherwise an error occurs.

Release Notes:

- August 7, 1999 by Martin Otter:
  Realized.

### Parameters

Name | Default | Description
--- | --- | ---
n | 1 | Number of inputs (= number of outputs)

### Modelica definition

    block Asin "Output the arc sine of the input"
      extends Interfaces.MIMOs;
    equation
      y = Modelica.Math.asin(u);
    end Asin;

## Modelica.Blocks.Math.Acos

Output the arc cosine of the input

### Information

This block computes the output y=outPort.signal element-wise as the cosine-inverse of the input u=inPort.signal:

        y[i] = acos( u[i] );

The absolute values of the elements of the input u need to be less or equal to one (abs( u[i] ) <= 1). Otherwise an error occurs.

Release Notes:

- August 7, 1999 by Martin Otter:
  Realized.

### Parameters

Name | Default | Description
--- | --- | ---
n | 1 | Number of inputs (= number of outputs)

### Modelica definition

    block Acos "Output the arc cosine of the input"
      extends Interfaces.MIMOs;
    equation
      y = Modelica.Math.acos(u);
    end Acos;

## Modelica.Blocks.Math.Atan

Output the arc tangent of the input

### Information

This block computes the output y=outPort.signal element-wise as the tangent-inverse of the input u=inPort.signal:

        y[i] = atan( u[i] );

Release Notes:

- August 7, 1999 by Martin Otter:
  Realized.

### Parameters

Name | Default | Description
--- | --- | ---
n | 1 | Number of inputs (= number of outputs)

### Modelica definition

    block Atan "Output the arc tangent of the input"
      extends Interfaces.MIMOs;
    equation
      y = Modelica.Math.atan(u);
    end Atan;

## Modelica.Blocks.Math.Atan2

Output atan(u1/u2) of the inputs u1 and u2

### Information

This block computes the output y=outPort.signal element-wise as the tangent-inverse of the input u1=inPort1.signal divided by input u2=inPort2.signal:

        y[i] = atan2( u1[i], u2[i] );

u1[i] and u2[i] shall not be zero at the same time instant. Atan2 uses the sign of u1[i] and u2[i] in order to construct the solution in the range -180 deg <= y[i] <= 180 deg, whereas block Atan gives a solution in the range -90 deg <= y[i] <= 90 deg.

Release Notes:

- August 7, 1999 by Martin Otter:
  Realized.

### Parameters

Name | Default | Description
--- | --- | ---
n | 1 | Dimension of input and output vectors.

### Modelica definition

    block Atan2 "Output atan(u1/u2) of the inputs u1 and u2"
      extends Interfaces.MI2MO;
    equation
      y = Modelica.Math.atan2(u1, u2);
    end Atan2;

## Modelica.Blocks.Math.Sinh

Output the hyperbolic sine of the input

### Information

This block computes the output y=outPort.signal element-wise as the hyperbolic sine of the input u=inPort.signal:

        y[i] = sinh( u[i] );

Release Notes:

- August 7, 1999 by Martin Otter:
  Realized.

### Parameters

Name | Default | Description
--- | --- | ---
n | 1 | Number of inputs (= number of outputs)

### Modelica definition

    block Sinh "Output the hyperbolic sine of the input"
      extends Interfaces.MIMOs;
    equation
      y = Modelica.Math.sinh(u);
    end Sinh;

## Modelica.Blocks.Math.Cosh

Output the hyperbolic cosine of the input

### Information

This block computes the output y=outPort.signal element-wise as the hyperbolic cosine of the input u=inPort.signal:

        y[i] = cosh( u[i] );

Release Notes:

- August 7, 1999 by Martin Otter:
  Realized.

### Parameters

Name | Default | Description
--- | --- | ---
n | 1 | Number of inputs (= number of outputs)

### Modelica definition

    block Cosh "Output the hyperbolic cosine of the input"
      extends Interfaces.MIMOs;
    equation
      y = Modelica.Math.cosh(u);
    end Cosh;

## Modelica.Blocks.Math.Tanh

Output the hyperbolic tangent of the input

### Information

This block computes the output y=outPort.signal element-wise as the hyperbolic tangent of the input u=inPort.signal:

        y[i] = tanh( u[i] );

Release Notes:

- August 7, 1999 by Martin Otter:
  Realized.

### Parameters

Name | Default | Description
--- | --- | ---
n | 1 | Number of inputs (= number of outputs)

### Modelica definition

    block Tanh "Output the hyperbolic tangent of the input"
      extends Interfaces.MIMOs;
    equation
      y = Modelica.Math.tanh(u);
    end Tanh;

## Modelica.Blocks.Math.Exp

Output the exponential (base e) of the input

### Information

This block computes the output y=outPort.signal element-wise as the exponential (of base e) of the input u=inPort.signal:

        y[i] = exp( u[i] );

Release Notes:

- August 7, 1999 by Martin Otter:
  Realized.

### Parameters

Name | Default | Description
--- | --- | ---
n | 1 | Number of inputs (= number of outputs)

### Modelica definition

    block Exp "Output the exponential (base e) of the input"
      extends Interfaces.MIMOs;
    equation
      y = Modelica.Math.exp(u);
    end Exp;

## Modelica.Blocks.Math.Log

Output the natural (base e) logarithm of the input (input > 0 required)

### Information

This block computes the output y=outPort.signal element-wise as the natural (base e) logarithm of the input u=inPort.signal:

        y[i] = log( u[i] );

An error occurs if the elements of the input u are zero or negative.

Release Notes:

- August 7, 1999 by Martin Otter:
  Realized.

### Parameters

Name | Default | Description
--- | --- | ---
n | 1 | Number of inputs (= number of outputs)

### Modelica definition

    block Log
      "Output the natural (base e) logarithm of the input (input > 0 required)"

      extends Interfaces.MIMOs;
    equation
      y = Modelica.Math.log(u);
    end Log;

## Modelica.Blocks.Math.Log10

Output the base 10 logarithm of the input (input > 0 required)

### Information

This block computes the output y=outPort.signal element-wise as the base 10 logarithm of the input u=inPort.signal:

        y[i] = log10( u[i] );

An error occurs if the elements of the input u are zero or negative.

Release Notes:

- August 7, 1999 by Martin Otter:
  Realized.

### Parameters

Name | Default | Description
--- | --- | ---
n | 1 | Number of inputs (= number of outputs)

### Modelica definition

    block Log10
      "Output the base 10 logarithm of the input (input > 0 required)"

      extends Interfaces.MIMOs;
    equation
      y = Modelica.Math.log10(u);
    end Log10;

## Modelica.Blocks.Math.RealToInteger

Convert real to integer signals

### Information

This block computes the output y=outPort.signal element-wise as nearest integer value of the input u=inPort.signal:

        y[i] = integer( floor( u[i] + 0.5 ) )  for  u[i] > 0;
        y[i] = integer( ceil ( u[i] - 0.5 ) )  for  u[i] < 0;

### Parameters

Name | Default | Description
--- | --- | ---
n | 1 | Number of input and output signals

### Modelica definition

    block RealToInteger "Convert real to integer signals"
      extends Interfaces.IntegerBlockIcon;
      parameter Integer n=1 "Number of input and output signals";
    protected
      Real u[n];
    public
      Interfaces.InPort inPort(final n=n);
      Interfaces.IntegerOutPort outPort(final n=n);
    equation
      u = inPort.signal;
      for i in 1:n loop
        outPort.signal[i] = if (u[i] > 0) then integer(floor(u[i] + 0.5)) else
          integer(ceil(u[i] - 0.5));
      end for;
    end RealToInteger;

## Modelica.Blocks.Math.IntegerToReal

Convert integer to real signals

### Information

This block computes the output y=outPort.signal element-wise as Real equivalent of the Integer input u=inPort.signal:

        y[i] = u[i];

where u is of Integer and y of Real type.

### Parameters

Name | Default | Description
--- | --- | ---
n | 1 | Number of input signals (= number of output signals)

### Modelica definition

    block IntegerToReal "Convert integer to real signals"
      extends Interfaces.BlockIcon;
      parameter Integer n=1 "Number of input signals (= number of output signals)";
      Interfaces.OutPort outPort(final n=n);
      Interfaces.IntegerInPort inPort(final n=n);
    equation
      outPort.signal = inPort.signal;
    end IntegerToReal;

## Modelica.Blocks.Math.Max

Pass through the largest signal

### Information

This block computes the output y=outPort.signal element-wise as maximum of the two inputs u1=inPort1.signal and u2=inPort2.signal:

        y[i] = max ( u1[i] , u2[i] );

### Parameters

Name | Default | Description
--- | --- | ---
n | 1 | Dimension of input and output vectors.

### Modelica definition

    block Max "Pass through the largest signal"
      extends Interfaces.MI2MO;
    equation
      for i in 1:n loop
        y[i] = max(u1[i], u2[i]);
      end for;
    end Max;

## Modelica.Blocks.Math.Min

Pass through the smallest signal

### Information

This block computes the output y=outPort.signal element-wise as minimum of the two inputs u1=inPort1.signal and u2=inPort2.signal:

        y[i] = min ( u1[i] , u2[i] );

### Parameters

Name | Default | Description
--- | --- | ---
n | 1 | Dimension of input and output vectors.

### Modelica definition

    block Min "Pass through the smallest signal"
      extends Interfaces.MI2MO;
    equation
      for i in 1:n loop
        y[i] = min(u1[i], u2[i]);
      end for;
    end Min;

## Modelica.Blocks.Math.Edge

Indicates rising edge of boolean signal

### Information

This block sets the Boolean output y=outPort.signal element-wise to true, when the Boolean input u=inPort.signal shows a rising edge:

        y[i] = edge( u[i] );

### Parameters

Name | Default | Description
--- | --- | ---
n | 1 | Number of inputs (= number of outputs)

### Modelica definition

    block Edge "Indicates rising edge of boolean signal"
      extends Interfaces.BooleanMIMOs;
    equation
      for i in 1:n loop
        y[i] = edge(u[i]);
      end for;
    end Edge;

## Modelica.Blocks.Math.BooleanChange

Indicates boolean signal changing

### Information

This block sets the Boolean output y=outPort.signal element-wise to true, when the Boolean input u=inPort.signal shows a rising or falling edge, i.e., when the signal changes:

        y[i] = change( u[i] );

### Parameters

Name | Default | Description
--- | --- | ---
n | 1 | Number of inputs (= number of outputs)

### Modelica definition

    block BooleanChange "Indicates boolean signal changing"
      extends Interfaces.BooleanMIMOs;
    equation
      for i in 1:n loop
        y[i] = change(u[i]);
      end for;
    end BooleanChange;

## Modelica.Blocks.Math.IntegerChange

Indicates integer signal changing

### Information

This block sets the Boolean output y=outPort.signal element-wise to true, when the Integer input u=inPort.signal changes:

        y[i] = change( u[i] );

### Parameters

Name | Default | Description
--- | --- | ---
n | 1 | Number of inputs (= number of outputs)

### Modelica definition

    block IntegerChange "Indicates integer signal changing"
      extends Interfaces.IntegerMIBooleanMOs;
    equation
      for i in 1:n loop
        y[i] = change(u[i]);
      end for;
    end IntegerChange;