Library of mathematical functions as input/output blocks
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).
| Name | Description |
|---|---|
| Output is equal to the conjugate complex input signal | |
| Output the product of a gain value with the input signal | |
| Output the sum of the elements of the input vector | |
| Output difference between commanded input 1 and feedback input 2 | |
| Output the sum of the two inputs | |
| Output the sum of the three inputs | |
| Output product of the two inputs | |
| Output first input divided by second input | |
| Output the square root of the input (= principal square root of complex number) | |
| Output the sine of the input | |
| Output the cosine of the input | |
| Output the tangent of the input | |
| Output the arc sine of the input | |
| Output the arc cosine of the input | |
| Output the arc tangent of the input | |
| Output the hyperbolic sine of the input | |
| Output the hyperbolic cosine of the input | |
| Output the hyperbolic tangent of the input | |
| Output the exponential (base e) of the input | |
| Output the natural (base e) logarithm of the input (input > 0 required) | |
| Converts Cartesian representation to complex | |
| Converts polar representation to complex | |
| Converts complex to Cartesian representation | |
| Converts complex to polar representation | |
Modelica.ComplexBlocks.ComplexMath.ConjOutput is equal to the conjugate complex input signal
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).
| Name | Description |
|---|---|
| useConjugateInput | If true, input is processed conjugate complex |
| Name | Description |
|---|---|
| u | Connector of Complex input signal |
| y | Connector of Complex output signal |
Modelica.ComplexBlocks.ComplexMath.GainOutput the product of a gain value with the input signal
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).
| Name | Description |
|---|---|
| k | Gain value multiplied with input signal |
| useConjugateInput | If true, input is processed conjugate complex |
| Name | Description |
|---|---|
| u | Input signal connector |
| y | Output signal connector |
Modelica.ComplexBlocks.ComplexMath.SumOutput the sum of the elements of the input vector
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).
| Name | Description |
|---|---|
| nin | Number of inputs |
| useConjugateInput[nin] | If true, inputs are processed conjugate complex |
| k[nin] | Optional: sum coefficients |
| Name | Description |
|---|---|
| u[nin] | Connector of Complex input signals |
| y | Connector of Complex output signal |
Modelica.ComplexBlocks.ComplexMath.FeedbackOutput difference between commanded input 1 and feedback input 2
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:
useConjugateInput1 = true,useConjugateInput2 = falseresult in the following equation:
y = Modelica.ComplexMath.conj(u1) - u2
| Name | Description |
|---|---|
| useConjugateInput1 | If true, input 1 is processed conjugate complex |
| useConjugateInput2 | If true, input 2 is processed conjugate complex |
| Name | Description |
|---|---|
| u1 | |
| u2 | |
| y |
Modelica.ComplexBlocks.ComplexMath.AddOutput the sum of the two inputs
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:
k1 = +2,k2 = -3,useConjugateInput1 = true,useConjugateInput2 = falseresult 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).
| Name | Description |
|---|---|
| useConjugateInput1 | If true, input 1 is processed conjugate complex |
| useConjugateInput2 | If true, input 2 is processed conjugate complex |
| k1 | Gain of input 1 |
| k2 | Gain of input 2 |
| Name | Description |
|---|---|
| u1 | Connector of Complex input signal 1 |
| u2 | Connector of Complex input signal 2 |
| y | Connector of Complex output signal |
Modelica.ComplexBlocks.ComplexMath.Add3Output the sum of the three inputs
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:
k1 = +2,k2 = -3,k3 = +1,useConjugateInput1 = true,useConjugateInput2 = falseuseConjugateInput3 = falseresult 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).
| Name | Description |
|---|---|
| k1 | Gain of upper input |
| useConjugateInput1 | If true, input 1 is processed conjugate complex |
| k2 | Gain of middle input |
| useConjugateInput2 | If true, input 2 is processed conjugate complex |
| k3 | Gain of lower input |
| useConjugateInput3 | If true, input 3 is processed conjugate complex |
| Name | Description |
|---|---|
| u1 | Connector 1 of Complex input signals |
| u2 | Connector 2 of Complex input signals |
| u3 | Connector 3 of Complex input signals |
| y | Connector of Complex output signals |
Modelica.ComplexBlocks.ComplexMath.ProductOutput product of the two inputs
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).
| Name | Description |
|---|---|
| useConjugateInput1 | If true, input 1 is processed conjugate complex |
| useConjugateInput2 | If true, input 2 is processed conjugate complex |
| Name | Description |
|---|---|
| u1 | Connector of Complex input signal 1 |
| u2 | Connector of Complex input signal 2 |
| y | Connector of Complex output signal |
Modelica.ComplexBlocks.ComplexMath.DivisionOutput first input divided by second input
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).
| Name | Description |
|---|---|
| useConjugateInput1 | If true, input 1 is processed conjugate complex |
| useConjugateInput2 | If true, input 2 is processed conjugate complex |
| Name | Description |
|---|---|
| u1 | Connector of Complex input signal 1 |
| u2 | Connector of Complex input signal 2 |
| y | Connector of Complex output signal |
Modelica.ComplexBlocks.ComplexMath.SqrtOutput the square root of the input (= principal square root of complex number)
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).
| Name | Description |
|---|---|
| useConjugateInput | If true, input is processed conjugate complex |
| Name | Description |
|---|---|
| u | Connector of Complex input signal |
| y | Connector of Complex output signal |
Modelica.ComplexBlocks.ComplexMath.SinOutput the sine of the input
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);
Extends from Interfaces.ComplexSISO (Single Input Single Output continuous control block).
| Name | Description |
|---|---|
| useConjugateInput | If true, input is processed conjugate complex |
| Name | Description |
|---|---|
| u | Connector of Complex input signal |
| y | Connector of Complex output signal |
Modelica.ComplexBlocks.ComplexMath.CosOutput the cosine of the input
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);
Extends from Interfaces.ComplexSISO (Single Input Single Output continuous control block).
| Name | Description |
|---|---|
| useConjugateInput | If true, input is processed conjugate complex |
| Name | Description |
|---|---|
| u | Connector of Complex input signal |
| y | Connector of Complex output signal |
Modelica.ComplexBlocks.ComplexMath.TanOutput the tangent of the input
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);
Extends from Interfaces.ComplexSISO (Single Input Single Output continuous control block).
| Name | Description |
|---|---|
| useConjugateInput | If true, input is processed conjugate complex |
| Name | Description |
|---|---|
| u | Connector of Complex input signal |
| y | Connector of Complex output signal |
Modelica.ComplexBlocks.ComplexMath.AsinOutput the arc sine of the input
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);
The absolute values of the elements of the input u need to
be less or equal to one (abs( u ) <= 1).
Otherwise an error occurs.
Extends from Interfaces.ComplexSISO (Single Input Single Output continuous control block).
| Name | Description |
|---|---|
| useConjugateInput | If true, input is processed conjugate complex |
| Name | Description |
|---|---|
| u | Connector of Complex input signal |
| y | Connector of Complex output signal |
Modelica.ComplexBlocks.ComplexMath.AcosOutput the arc cosine of the input
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);
The absolute values of the elements of the input u need to
be less or equal to one (abs( u ) <= 1).
Otherwise an error occurs.
Extends from Interfaces.ComplexSISO (Single Input Single Output continuous control block).
| Name | Description |
|---|---|
| useConjugateInput | If true, input is processed conjugate complex |
| Name | Description |
|---|---|
| u | Connector of Complex input signal |
| y | Connector of Complex output signal |
Modelica.ComplexBlocks.ComplexMath.AtanOutput the arc tangent of the input
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);
Extends from Interfaces.ComplexSISO (Single Input Single Output continuous control block).
| Name | Description |
|---|---|
| useConjugateInput | If true, input is processed conjugate complex |
| Name | Description |
|---|---|
| u | Connector of Complex input signal |
| y | Connector of Complex output signal |
Modelica.ComplexBlocks.ComplexMath.SinhOutput the hyperbolic sine of the input
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);
Extends from Interfaces.ComplexSISO (Single Input Single Output continuous control block).
| Name | Description |
|---|---|
| useConjugateInput | If true, input is processed conjugate complex |
| Name | Description |
|---|---|
| u | Connector of Complex input signal |
| y | Connector of Complex output signal |
Modelica.ComplexBlocks.ComplexMath.CoshOutput the hyperbolic cosine of the input
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);
Extends from Interfaces.ComplexSISO (Single Input Single Output continuous control block).
| Name | Description |
|---|---|
| useConjugateInput | If true, input is processed conjugate complex |
| Name | Description |
|---|---|
| u | Connector of Complex input signal |
| y | Connector of Complex output signal |
Modelica.ComplexBlocks.ComplexMath.TanhOutput the hyperbolic tangent of the input
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);
Extends from Interfaces.ComplexSISO (Single Input Single Output continuous control block).
| Name | Description |
|---|---|
| useConjugateInput | If true, input is processed conjugate complex |
| Name | Description |
|---|---|
| u | Connector of Complex input signal |
| y | Connector of Complex output signal |
Modelica.ComplexBlocks.ComplexMath.ExpOutput the exponential (base e) of the input
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);
Extends from Interfaces.ComplexSISO (Single Input Single Output continuous control block).
| Name | Description |
|---|---|
| useConjugateInput | If true, input is processed conjugate complex |
| Name | Description |
|---|---|
| u | Connector of Complex input signal |
| y | Connector of Complex output signal |
Modelica.ComplexBlocks.ComplexMath.LogOutput the natural (base e) logarithm of the input (input > 0 required)
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 are
zero or negative.
Extends from Interfaces.ComplexSISO (Single Input Single Output continuous control block).
| Name | Description |
|---|---|
| useConjugateInput | If true, input is processed conjugate complex |
| Name | Description |
|---|---|
| u | Connector of Complex input signal |
| y | Connector of Complex output signal |
Modelica.ComplexBlocks.ComplexMath.RealToComplexConverts Cartesian representation to complex
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).
| Name | Description |
|---|---|
| y | Connector of Complex output signal |
| re | |
| im |
Modelica.ComplexBlocks.ComplexMath.PolarToComplexConverts polar representation to complex
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).
| Name | Description |
|---|---|
| y | Connector of Complex output signal |
| len | |
| phi |
Modelica.ComplexBlocks.ComplexMath.ComplexToRealConverts complex to Cartesian representation
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).
| Name | Description |
|---|---|
| useConjugateInput | If true, input is processed conjugate complex |
| Name | Description |
|---|---|
| re | |
| im | |
| u |
Modelica.ComplexBlocks.ComplexMath.ComplexToPolarConverts complex to polar representation
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).
| Name | Description |
|---|---|
| useConjugateInput | If true, input is processed conjugate complex |
| Name | Description |
|---|---|
| len | |
| phi | |
| u |
Modelica.ComplexBlocks.ComplexMath.TransferFunctionThe 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).
| Name | Description |
|---|---|
| useConjugateInput | If 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}) |
| Name | Description |
|---|---|
| u | Connector of Complex input signal |
| y | Connector of Complex output signal |
| w | Frequency input |