Modelica.ComplexBlocks.ComplexMath

Library of 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.

Extends from Modelica.Icons.Package (Icon for standard packages).

Package Content

Name Description
Modelica.ComplexBlocks.ComplexMath.Conj Conj Output is equal to the conjugate complex input signal
Modelica.ComplexBlocks.ComplexMath.Gain Gain Output the product of a gain value with the input signal
Modelica.ComplexBlocks.ComplexMath.Sum Sum Output the sum of the elements of the input vector
Modelica.ComplexBlocks.ComplexMath.Feedback Feedback Output difference between commanded input 1 and feedback input 2
Modelica.ComplexBlocks.ComplexMath.Add Add Output the sum of the two inputs
Modelica.ComplexBlocks.ComplexMath.Add3 Add3 Output the sum of the three inputs
Modelica.ComplexBlocks.ComplexMath.Product Product Output product of the two inputs
Modelica.ComplexBlocks.ComplexMath.Division Division Output first input divided by second input
Modelica.ComplexBlocks.ComplexMath.Sqrt Sqrt Output the square root of the input (= principal square root of complex number)
Modelica.ComplexBlocks.ComplexMath.Sin Sin Output the sine of the input
Modelica.ComplexBlocks.ComplexMath.Cos Cos Output the cosine of the input
Modelica.ComplexBlocks.ComplexMath.Tan Tan Output the tangent of the input
Modelica.ComplexBlocks.ComplexMath.Asin Asin Output the arc sine of the input
Modelica.ComplexBlocks.ComplexMath.Acos Acos Output the arc cosine of the input
Modelica.ComplexBlocks.ComplexMath.Atan Atan Output the arc tangent of the input
Modelica.ComplexBlocks.ComplexMath.Sinh Sinh Output the hyperbolic sine of the input
Modelica.ComplexBlocks.ComplexMath.Cosh Cosh Output the hyperbolic cosine of the input
Modelica.ComplexBlocks.ComplexMath.Tanh Tanh Output the hyperbolic tangent of the input
Modelica.ComplexBlocks.ComplexMath.Exp Exp Output the exponential (base e) of the input
Modelica.ComplexBlocks.ComplexMath.Log Log Output the natural (base e) logarithm of the input (input <> '0' required)
Modelica.ComplexBlocks.ComplexMath.RealToComplex RealToComplex Converts Cartesian representation to complex
Modelica.ComplexBlocks.ComplexMath.PolarToComplex PolarToComplex Converts polar representation to complex
Modelica.ComplexBlocks.ComplexMath.ComplexToReal ComplexToReal Converts complex to Cartesian representation
Modelica.ComplexBlocks.ComplexMath.ComplexToPolar ComplexToPolar Converts complex to polar representation
Modelica.ComplexBlocks.ComplexMath.Bode Bode Calculate quantities to plot Bode diagram
Modelica.ComplexBlocks.ComplexMath.TransferFunction TransferFunction Complex Transfer Function

Modelica.ComplexBlocks.ComplexMath.Conj Modelica.ComplexBlocks.ComplexMath.Conj

Output is equal to the conjugate complex input signal

Information

This block computes output y as conjugate complex input u.

    y = Modelica.ComplexMath.conj(u)

Extends from Modelica.ComplexBlocks.Interfaces.ComplexSISO (Single Input Single Output continuous control block).

Parameters

NameDescription
useConjugateInputIf true, input is processed conjugate complex

Connectors

NameDescription
uConnector of Complex input signal
yConnector of Complex output signal

Modelica.ComplexBlocks.ComplexMath.Gain Modelica.ComplexBlocks.ComplexMath.Gain

Output the product of a gain value with the input signal

Information

This block computes output y as product of gain k with the input u. Optionally, the input u can be processed conjugate complex, when parameter useConjugateInput is true. Depending on useConjugateInput either the original or the conjugate complex input signal are processed.

    y = k * (if useConjugateInput then Modelica.ComplexMath.conj(u) else u);

Example: If useConjugateInput = true and k = 2 the output signal y = 2 * Modelica.ComplexMath.conj(u).

Parameters

NameDescription
kGain value multiplied with input signal
useConjugateInputIf true, input is processed conjugate complex

Connectors

NameDescription
uInput signal connector
yOutput signal connector

Modelica.ComplexBlocks.ComplexMath.Sum Modelica.ComplexBlocks.ComplexMath.Sum

Output the sum of the elements of the input vector

Information

This blocks computes output y as sum of the elements of the input signal vector u:

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

Example:

     parameter:   nin = 3;

  results in the following equations:

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

Extends from Interfaces.ComplexMISO (Multiple Input Single Output continuous control block).

Parameters

NameDescription
ninNumber of inputs
useConjugateInput[nin]If true, inputs are processed conjugate complex
k[nin]Optional: sum coefficients

Connectors

NameDescription
u[nin]Connector of Complex input signals
yConnector of Complex output signal

Modelica.ComplexBlocks.ComplexMath.Feedback Modelica.ComplexBlocks.ComplexMath.Feedback

Output difference between commanded input 1 and feedback input 2

Information

This blocks computes output y as difference of the commanded input u1 and the feedback input u2. Optionally, either input u1 or u2 or both inputs can be processed conjugate complex, when parameters useConjugateInput1 and useConjugateInput2 are true, respectively.

  y = (if useConjugateInput1 then Modelica.ComplexMath.conj(u1) else u1)
    - (if useConjugateInput1 then Modelica.ComplexMath.conj(u2) else u2);

Example parameters:

result in the following equation:

     y = Modelica.ComplexMath.conj(u1) - u2

Parameters

NameDescription
useConjugateInput1If true, input 1 is processed conjugate complex
useConjugateInput2If true, input 2 is processed conjugate complex

Connectors

NameDescription
u1 
u2 
y 

Modelica.ComplexBlocks.ComplexMath.Add Modelica.ComplexBlocks.ComplexMath.Add

Output the sum of the two inputs

Information

This blocks computes output y as sum of the two input signals u1 and u2. Optionally, either input u1 or u2 or both inputs can be processed conjugate complex, when parameters useConjugateInput1 and useConjugateInput2 are true, respectively.

  y = k1*u1Internal + k2*u2Internal;

Example parameters:

result in the following equation:

     y = 2 * Modelica.ComplexMath.conj(u1) - 3 * u2

Extends from Interfaces.ComplexSI2SO (2 Single Input / 1 Single Output continuous control block).

Parameters

NameDescription
useConjugateInput1If true, input 1 is processed conjugate complex
useConjugateInput2If true, input 2 is processed conjugate complex
k1Gain of input 1
k2Gain of input 2

Connectors

NameDescription
u1Connector of Complex input signal 1
u2Connector of Complex input signal 2
yConnector of Complex output signal

Modelica.ComplexBlocks.ComplexMath.Add3 Modelica.ComplexBlocks.ComplexMath.Add3

Output the sum of the three inputs

Information

This blocks computes output y as sum of the three input signals u1, u2 and u3. Optionally, inputs u1 and u2 and u3 can be processed conjugate complex, when parameters useConjugateInput1 and useConjugateInput2 and useConjugateInput3 are true, respectively.

  y = k1*(if useConjugateInput1 then Modelica.ComplexMath.conj(u1) else u1)
    + k2*(if useConjugateInput2 then Modelica.ComplexMath.conj(u2) else u2)
    + k3*(if useConjugateInput3 then Modelica.ComplexMath.conj(u3) else u3);

Example parameters:

result in the following equation:

     y = 2 * Modelica.ComplexMath.conj(u1) - 3 * u2 + u3;

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Parameters

NameDescription
k1Gain of upper input
useConjugateInput1If true, input 1 is processed conjugate complex
k2Gain of middle input
useConjugateInput2If true, input 2 is processed conjugate complex
k3Gain of lower input
useConjugateInput3If true, input 3 is processed conjugate complex

Connectors

NameDescription
u1Connector 1 of Complex input signals
u2Connector 2 of Complex input signals
u3Connector 3 of Complex input signals
yConnector of Complex output signals

Modelica.ComplexBlocks.ComplexMath.Product Modelica.ComplexBlocks.ComplexMath.Product

Output product of the two inputs

Information

This blocks computes the output y (element-wise) as product of the corresponding elements of the two inputs u1 and u2. Optionally, either input u1 or u2 or both inputs can be processed conjugate complex, when parameters useConjugateInput1 and useConjugateInput2 are true, respectively. Depending on useConjugateInput1 and useConjugateInput2 the internal signals represent either the original or the conjugate complex input signal.

  y = u1Inernal * u2Internal;

Example: If useConjugateInput1 = true and useConjugateInput2 = false the output signal y = Modelica.ComplexMath.conj(u1) * u2.

Extends from Interfaces.ComplexSI2SO (2 Single Input / 1 Single Output continuous control block).

Parameters

NameDescription
useConjugateInput1If true, input 1 is processed conjugate complex
useConjugateInput2If true, input 2 is processed conjugate complex

Connectors

NameDescription
u1Connector of Complex input signal 1
u2Connector of Complex input signal 2
yConnector of Complex output signal

Modelica.ComplexBlocks.ComplexMath.Division Modelica.ComplexBlocks.ComplexMath.Division

Output first input divided by second input

Information

This block computes the output y (element-wise) by dividing the corresponding elements of the two inputs u1 and u2. Optionally, either input u1 or u2 or both inputs can be processed conjugate complex, when parameters useConjugateInput1 and useConjugateInput2 are true, respectively. Depending on useConjugateInput1 and useConjugateInput2 the internal signals represent either the original or the conjugate complex input signal.

    y = u1Internal / u2Internal;

Example: If useConjugateInput1 = true and useConjugateInput2 = false the output signal y = Modelica.ComplexMath.conj(u1) / u2.

Extends from Interfaces.ComplexSI2SO (2 Single Input / 1 Single Output continuous control block).

Parameters

NameDescription
useConjugateInput1If true, input 1 is processed conjugate complex
useConjugateInput2If true, input 2 is processed conjugate complex

Connectors

NameDescription
u1Connector of Complex input signal 1
u2Connector of Complex input signal 2
yConnector of Complex output signal

Modelica.ComplexBlocks.ComplexMath.Sqrt Modelica.ComplexBlocks.ComplexMath.Sqrt

Output the square root of the input (= principal square root of complex number)

Information

This blocks computes the output y as square root of the input u (= principal square root of the complex input). Optionally, the input u can be processed conjugate complex, when parameter useConjugateInput is true. Depending on useConjugateInput the internal signal uInternal represents either the original or the conjugate complex input signal.

    y = sqrt(uInternal);

Extends from Interfaces.ComplexSISO (Single Input Single Output continuous control block).

Parameters

NameDescription
useConjugateInputIf true, input is processed conjugate complex

Connectors

NameDescription
uConnector of Complex input signal
yConnector of Complex output signal

Modelica.ComplexBlocks.ComplexMath.Sin Modelica.ComplexBlocks.ComplexMath.Sin

Output the sine of the input

Information

This blocks computes the output y as sine of the input u. Optionally, the input u can be processed conjugate complex, when parameter useConjugateInput is true. Depending on useConjugateInput the internal signal uInternal represents either the original or the conjugate complex input signal.

    y = sin(uInternal);

sin.png

Extends from Interfaces.ComplexSISO (Single Input Single Output continuous control block).

Parameters

NameDescription
useConjugateInputIf true, input is processed conjugate complex

Connectors

NameDescription
uConnector of Complex input signal
yConnector of Complex output signal

Modelica.ComplexBlocks.ComplexMath.Cos Modelica.ComplexBlocks.ComplexMath.Cos

Output the cosine of the input

Information

This blocks computes the output y as cos of the input u. Optionally, the input u can be processed conjugate complex, when parameter useConjugateInput is true. Depending on useConjugateInput the internal signal uInternal represents either the original or the conjugate complex input signal.

    y = cos(uInternal);

cos.png

Extends from Interfaces.ComplexSISO (Single Input Single Output continuous control block).

Parameters

NameDescription
useConjugateInputIf true, input is processed conjugate complex

Connectors

NameDescription
uConnector of Complex input signal
yConnector of Complex output signal

Modelica.ComplexBlocks.ComplexMath.Tan Modelica.ComplexBlocks.ComplexMath.Tan

Output the tangent of the input

Information

This blocks computes the output y as tan of the input u. Optionally, the input u can be processed conjugate complex, when parameter useConjugateInput is true. Depending on useConjugateInput the internal signal uInternal represents either the original or the conjugate complex input signal.

    y = tan(uInternal);

tan.png

Extends from Interfaces.ComplexSISO (Single Input Single Output continuous control block).

Parameters

NameDescription
useConjugateInputIf true, input is processed conjugate complex

Connectors

NameDescription
uConnector of Complex input signal
yConnector of Complex output signal

Modelica.ComplexBlocks.ComplexMath.Asin Modelica.ComplexBlocks.ComplexMath.Asin

Output the arc sine of the input

Information

This blocks computes the output y as the sine-inverse of the input u. Optionally, the input u can be processed conjugate complex, when parameter useConjugateInput is true. Depending on useConjugateInput the internal signal uInternal represents either the original or the conjugate complex input signal.

    y = asin(uInternal);

asin.png

Extends from Interfaces.ComplexSISO (Single Input Single Output continuous control block).

Parameters

NameDescription
useConjugateInputIf true, input is processed conjugate complex

Connectors

NameDescription
uConnector of Complex input signal
yConnector of Complex output signal

Modelica.ComplexBlocks.ComplexMath.Acos Modelica.ComplexBlocks.ComplexMath.Acos

Output the arc cosine of the input

Information

This blocks computes the output y as the cosine-inverse of the input u. Optionally, the input u can be processed conjugate complex, when parameter useConjugateInput is true. Depending on useConjugateInput the internal signal uInternal represents either the original or the conjugate complex input signal.

    y = acos(uInternal);

acos.png

Extends from Interfaces.ComplexSISO (Single Input Single Output continuous control block).

Parameters

NameDescription
useConjugateInputIf true, input is processed conjugate complex

Connectors

NameDescription
uConnector of Complex input signal
yConnector of Complex output signal

Modelica.ComplexBlocks.ComplexMath.Atan Modelica.ComplexBlocks.ComplexMath.Atan

Output the arc tangent of the input

Information

This blocks computes the output y as the tangent-inverse of the input u. Optionally, the input u can be processed conjugate complex, when parameter useConjugateInput is true. Depending on useConjugateInput the internal signal uInternal represents either the original or the conjugate complex input signal.

    y= atan(uInternal);

atan.png

Extends from Interfaces.ComplexSISO (Single Input Single Output continuous control block).

Parameters

NameDescription
useConjugateInputIf true, input is processed conjugate complex

Connectors

NameDescription
uConnector of Complex input signal
yConnector of Complex output signal

Modelica.ComplexBlocks.ComplexMath.Sinh Modelica.ComplexBlocks.ComplexMath.Sinh

Output the hyperbolic sine of the input

Information

This blocks computes the output y as the hyperbolic sine of the input u. Optionally, the input u can be processed conjugate complex, when parameter useConjugateInput is true. Depending on useConjugateInput the internal signal uInternal represents either the original or the conjugate complex input signal.

    y = sinh(uInternal);

sinh.png

Extends from Interfaces.ComplexSISO (Single Input Single Output continuous control block).

Parameters

NameDescription
useConjugateInputIf true, input is processed conjugate complex

Connectors

NameDescription
uConnector of Complex input signal
yConnector of Complex output signal

Modelica.ComplexBlocks.ComplexMath.Cosh Modelica.ComplexBlocks.ComplexMath.Cosh

Output the hyperbolic cosine of the input

Information

This blocks computes the output y as the hyperbolic cosine of the input u. Optionally, the input u can be processed conjugate complex, when parameter useConjugateInput is true. Depending on useConjugateInput the internal signal uInternal represents either the original or the conjugate complex input signal.

    y = cosh(uInternal);

cosh.png

Extends from Interfaces.ComplexSISO (Single Input Single Output continuous control block).

Parameters

NameDescription
useConjugateInputIf true, input is processed conjugate complex

Connectors

NameDescription
uConnector of Complex input signal
yConnector of Complex output signal

Modelica.ComplexBlocks.ComplexMath.Tanh Modelica.ComplexBlocks.ComplexMath.Tanh

Output the hyperbolic tangent of the input

Information

This blocks computes the output y as the hyperbolic tangent of the input u. Optionally, the input u can be processed conjugate complex, when parameter useConjugateInput is true. Depending on useConjugateInput the internal signal uInternal represents either the original or the conjugate complex input signal.

    y = tanh(uInternal);

tanh.png

Extends from Interfaces.ComplexSISO (Single Input Single Output continuous control block).

Parameters

NameDescription
useConjugateInputIf true, input is processed conjugate complex

Connectors

NameDescription
uConnector of Complex input signal
yConnector of Complex output signal

Modelica.ComplexBlocks.ComplexMath.Exp Modelica.ComplexBlocks.ComplexMath.Exp

Output the exponential (base e) of the input

Information

This blocks computes the output y as the exponential (of base e) of the input u. Optionally, the input u can be processed conjugate complex, when parameter useConjugateInput is true. Depending on useConjugateInput the internal signal uInternal represents either the original or the conjugate complex input signal.

    y = exp(uInternal);

exp.png

Extends from Interfaces.ComplexSISO (Single Input Single Output continuous control block).

Parameters

NameDescription
useConjugateInputIf true, input is processed conjugate complex

Connectors

NameDescription
uConnector of Complex input signal
yConnector of Complex output signal

Modelica.ComplexBlocks.ComplexMath.Log Modelica.ComplexBlocks.ComplexMath.Log

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

Information

This blocks computes the output y as the natural (base e) logarithm of the input u. Optionally, the input u can be processed conjugate complex, when parameter useConjugateInput is true. Depending on useConjugateInput the internal signal uInternal represents either the original or the conjugate complex input signal.

    y = log(uInternal);

An error occurs if the elements of the input u is zero.

log.png

Extends from Interfaces.ComplexSISO (Single Input Single Output continuous control block).

Parameters

NameDescription
useConjugateInputIf true, input is processed conjugate complex

Connectors

NameDescription
uConnector of Complex input signal
yConnector of Complex output signal

Modelica.ComplexBlocks.ComplexMath.RealToComplex Modelica.ComplexBlocks.ComplexMath.RealToComplex

Converts Cartesian representation to complex

Information

Converts the Real inputs re (real part) and im (imaginary part) to the Complex output y.

Extends from Modelica.ComplexBlocks.Interfaces.ComplexSO (Single Output continuous control block).

Connectors

NameDescription
yConnector of Complex output signal
re 
im 

Modelica.ComplexBlocks.ComplexMath.PolarToComplex Modelica.ComplexBlocks.ComplexMath.PolarToComplex

Converts polar representation to complex

Information

Converts the Real inputs len (length, absolute) and phi (angle, argument) to the Complex output y.

Extends from Modelica.ComplexBlocks.Interfaces.ComplexSO (Single Output continuous control block).

Connectors

NameDescription
yConnector of Complex output signal
len 
phi[rad]

Modelica.ComplexBlocks.ComplexMath.ComplexToReal Modelica.ComplexBlocks.ComplexMath.ComplexToReal

Converts complex to Cartesian representation

Information

Converts the Complex input u to the Real outputs re (real part) and im (imaginary part).

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Parameters

NameDescription
useConjugateInputIf true, input is processed conjugate complex

Connectors

NameDescription
re 
im 
u 

Modelica.ComplexBlocks.ComplexMath.ComplexToPolar Modelica.ComplexBlocks.ComplexMath.ComplexToPolar

Converts complex to polar representation

Information

Converts the Complex input u to the Real outputs len (length, absolute) and phi (angle, argument).

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Parameters

NameDescription
useConjugateInputIf true, input is processed conjugate complex

Connectors

NameDescription
len 
phi[rad]
u 

Modelica.ComplexBlocks.ComplexMath.Bode Modelica.ComplexBlocks.ComplexMath.Bode

Calculate quantities to plot Bode diagram

Information

This complex block is used to determine variables of a Bode diagram for the output y. The output y is calculated by u / divisor if useDivisor == true. Otherwise the output y = u.

Parameters

NameDescription
useDivisorUse divisor input, if true

Connectors

NameDescription
uDividend if useDivisor == true
divisorDivisor
abs_yAbsolute value of ratio u / divisor
arg_yAngle of ratio u / divisor [rad]
yQuotient y = u / divisor
dB_yLog10 of absolute value of ratio u / divisor in dB [dB]

Modelica.ComplexBlocks.ComplexMath.TransferFunction Modelica.ComplexBlocks.ComplexMath.TransferFunction

Complex Transfer Function

Information

The complex input u is multiplied by the complex transfer function (depending on frequency input w) to obtain the complex output y (nb = dimension of b, na = dimension of a):

           b[1]*(jw)^[nb-1] + b[2]*(jw)^[nb-2] + ... + b[nb]
   y(jw) = ------------------------------------------------- * u(jw)
           a[1]*(jw)^[na-1] + a[2]*(jw)^[na-2] + ... + a[na]

Extends from Modelica.ComplexBlocks.Interfaces.ComplexSISO (Single Input Single Output continuous control block).

Parameters

NameDescription
useConjugateInputIf true, input is processed conjugate complex
b[:]Numerator coefficients of transfer function (e.g., 2*s+3 is specified as {2,3})
a[:]Denominator coefficients of transfer function (e.g., 5*s+6 is specified as {5,6})

Connectors

NameDescription
uConnector of Complex input signal
yConnector of Complex output signal
wFrequency input
Automatically generated Thu Dec 19 17:19:53 2019.