This package contains blocks and functions for commonly used mathematical operations. The classes in this package augment the classes Modelica.Blocks.
Extends from Modelica.Icons.VariantsPackage (Icon for package containing variants).Name | Description |
---|---|
Functions | Package with mathematical functions |
Average | Average of a vector |
Bicubic | Bicubic function |
Biquadratic | Biquadratic function |
BooleanReplicator | Boolean signal replicator |
IntegerReplicator | Integer signal replicator |
Max | Maximum element of a vector |
Min | Minimum element of a vector |
SmoothHeaviside | Once continuously differentiable approximation to the Heaviside function |
SmoothLimit | Once continuously differentiable approximation to the limit function |
SmoothMax | Once continuously differentiable approximation to the maximum function |
SmoothMin | Once continuously differentiable approximation to the minimum function |
Splice | Block for splice function opertation |
Examples | Collection of models that illustrate model use and test models |
This function outputs the average of the vector.
Extends from Modelica.Blocks.Interfaces.MISO (Multiple Input Single Output continuous control block).
Type | Name | Default | Description |
---|---|---|---|
Integer | nin | 1 | Number of inputs |
Type | Name | Description |
---|---|---|
input RealInput | u[nin] | Connector of Real input signals |
output RealOutput | y | Connector of Real output signal |
block Average "Average of a vector" extends Modelica.Blocks.Interfaces.MISO; equation y = sum(u)/nin;end Average;
This block computes
y = a1 + a2 x1 + a3 x12 + a4 x2 + a5 x22 + a6 x1 x2 + a7 x1^3 + a8 x2^3 + a9 x12 x2 + a10 x1 x22
Extends from Modelica.Blocks.Interfaces.SI2SO (2 Single Input / 1 Single Output continuous control block).
Type | Name | Description |
---|---|---|
input RealInput | u1 | Connector of Real input signal 1 |
input RealInput | u2 | Connector of Real input signal 2 |
output RealOutput | y | Connector of Real output signal |
block Bicubic "Bicubic function" extends Modelica.Blocks.Interfaces.SI2SO; input Real a[10] "Coefficients"; equation y = Buildings.Utilities.Math.Functions.bicubic(a=a, x1=u1, x2=u2);end Bicubic;
This block computes
y = a1 + a2 x1 + a3 x12 + a4 x2 + a5 x22 + a6 x1 x2
Extends from Modelica.Blocks.Interfaces.SI2SO (2 Single Input / 1 Single Output continuous control block).
Type | Name | Default | Description |
---|---|---|---|
Real | a[6] | Coefficients |
Type | Name | Description |
---|---|---|
input RealInput | u1 | Connector of Real input signal 1 |
input RealInput | u2 | Connector of Real input signal 2 |
output RealOutput | y | Connector of Real output signal |
block Biquadratic "Biquadratic function" extends Modelica.Blocks.Interfaces.SI2SO; parameter Real a[6] "Coefficients"; equation y = Buildings.Utilities.Math.Functions.biquadratic(a=a, x1=u1, x2=u2);end Biquadratic;
This block replicates the boolean input signal to an array of nout
identical output signals.
Type | Name | Default | Description |
---|---|---|---|
Integer | nout | 1 | Number of outputs |
Type | Name | Description |
---|---|---|
input BooleanInput | u | Connector of boolean input signal |
output BooleanOutput | y[nout] | Connector of boolean output signals |
block BooleanReplicator "Boolean signal replicator" extends Modelica.Blocks.Interfaces.BooleanBlockIcon; parameter Integer nout=1 "Number of outputs";Modelica.Blocks.Interfaces.BooleanInput u "Connector of boolean input signal"; Modelica.Blocks.Interfaces.BooleanOutput y[nout] "Connector of boolean output signals"; equation y = fill(u, nout);end BooleanReplicator;
This block replicates the integer input signal to an array of nout
identical output signals.
Type | Name | Default | Description |
---|---|---|---|
Integer | nout | 1 | Number of outputs |
Type | Name | Description |
---|---|---|
input IntegerInput | u | Connector of integer input signal |
output IntegerOutput | y[nout] | Connector of integer output signals |
block IntegerReplicator "Integer signal replicator" extends Modelica.Blocks.Interfaces.IntegerBlockIcon; parameter Integer nout=1 "Number of outputs";Modelica.Blocks.Interfaces.IntegerInput u "Connector of integer input signal"; Modelica.Blocks.Interfaces.IntegerOutput y[nout] "Connector of integer output signals"; equation y = fill(u, nout);end IntegerReplicator;
Outputs the minimum of the vector.
Extends from Modelica.Blocks.Interfaces.MISO (Multiple Input Single Output continuous control block).
Type | Name | Default | Description |
---|---|---|---|
Integer | nin | 1 | Number of inputs |
Type | Name | Description |
---|---|---|
input RealInput | u[nin] | Connector of Real input signals |
output RealOutput | y | Connector of Real output signal |
block Max "Maximum element of a vector" extends Modelica.Blocks.Interfaces.MISO; equation y = max(u);end Max;
Outputs the minimum of the vector.
Extends from Modelica.Blocks.Interfaces.MISO (Multiple Input Single Output continuous control block).
Type | Name | Default | Description |
---|---|---|---|
Integer | nin | 1 | Number of inputs |
Type | Name | Description |
---|---|---|
input RealInput | u[nin] | Connector of Real input signals |
output RealOutput | y | Connector of Real output signal |
block Min "Minimum element of a vector" extends Modelica.Blocks.Interfaces.MISO; equation y = min(u);end Min;
Once Lipschitz continuously differentiable approximation to the Heaviside(.,.) function.
Extends from Modelica.Blocks.Interfaces.SISO (Single Input Single Output continuous control block).
Type | Name | Default | Description |
---|---|---|---|
Real | delta | Width of transition interval |
Type | Name | Description |
---|---|---|
input RealInput | u | Connector of Real input signal |
output RealOutput | y | Connector of Real output signal |
block SmoothHeaviside "Once continuously differentiable approximation to the Heaviside function" extends Modelica.Blocks.Interfaces.SISO; parameter Real delta "Width of transition interval"; equation y = Buildings.Utilities.Math.Functions.smoothHeaviside(x=u, delta=delta);end SmoothHeaviside;
Once continuously differentiable approximation to the limit(.,.) function. The output is bounded to be in [lower, upper].
Extends from Modelica.Blocks.Interfaces.SISO (Single Input Single Output continuous control block).
Type | Name | Default | Description |
---|---|---|---|
Real | deltaX | Width of transition interval | |
Real | upper | Upper limit | |
Real | lower | Lower limit |
Type | Name | Description |
---|---|---|
input RealInput | u | Connector of Real input signal |
output RealOutput | y | Connector of Real output signal |
block SmoothLimit "Once continuously differentiable approximation to the limit function" extends Modelica.Blocks.Interfaces.SISO; parameter Real deltaX "Width of transition interval"; parameter Real upper "Upper limit"; parameter Real lower "Lower limit"; equation y = Buildings.Utilities.Math.Functions.smoothLimit(u, lower, upper, deltaX);end SmoothLimit;
Once continuously differentiable approximation to the max(.,.) function.
Extends from Modelica.Blocks.Interfaces.SI2SO (2 Single Input / 1 Single Output continuous control block).
Type | Name | Default | Description |
---|---|---|---|
Real | deltaX | Width of transition interval |
Type | Name | Description |
---|---|---|
input RealInput | u1 | Connector of Real input signal 1 |
input RealInput | u2 | Connector of Real input signal 2 |
output RealOutput | y | Connector of Real output signal |
block SmoothMax "Once continuously differentiable approximation to the maximum function" extends Modelica.Blocks.Interfaces.SI2SO; parameter Real deltaX "Width of transition interval"; equation y = Buildings.Utilities.Math.Functions.smoothMax(x1=u1, x2=u2, deltaX=deltaX);end SmoothMax;
Once continuously differentiable approximation to the max(.,.) function.
Extends from Modelica.Blocks.Interfaces.SI2SO (2 Single Input / 1 Single Output continuous control block).
Type | Name | Default | Description |
---|---|---|---|
Real | deltaX | Width of transition interval |
Type | Name | Description |
---|---|---|
input RealInput | u1 | Connector of Real input signal 1 |
input RealInput | u2 | Connector of Real input signal 2 |
output RealOutput | y | Connector of Real output signal |
block SmoothMin "Once continuously differentiable approximation to the minimum function" extends Modelica.Blocks.Interfaces.SI2SO; parameter Real deltaX "Width of transition interval"; equation y = Buildings.Utilities.Math.Functions.smoothMin(x1=u1, x2=u2, deltaX=deltaX);end SmoothMin;
This block implements Buildings.Utilities.Math.Functions.spliceFunction, which provides a continuously differentiable transition between two arguments.
Extends from Modelica.Blocks.Interfaces.BlockIcon (Basic graphical layout of input/output block).
Type | Name | Default | Description |
---|---|---|---|
Real | deltax | Half width of transition interval |
Type | Name | Description |
---|---|---|
input RealInput | x | Independent value |
input RealInput | u1 | Argument of u > 0 (pos) |
input RealInput | u2 | Argument of u < 0 (neg) |
output RealOutput | y | Smoothed value |
block Splice "Block for splice function opertation" extends Modelica.Blocks.Interfaces.BlockIcon;Modelica.Blocks.Interfaces.RealInput x "Independent value"; Modelica.Blocks.Interfaces.RealInput u1 "Argument of u > 0 (pos)"; Modelica.Blocks.Interfaces.RealInput u2 "Argument of u < 0 (neg)"; Modelica.Blocks.Interfaces.RealOutput y "Smoothed value"; parameter Real deltax "Half width of transition interval"; equation y=Buildings.Utilities.Math.Functions.spliceFunction( pos=u1, neg= u2, x= x, deltax= deltax);end Splice;