Buildings.Utilities.Math

Library with functions such as for smoothing

Information

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).

Package Content

NameDescription
Functions Package with mathematical functions
Average Average of a vector
Bicubic Bicubic function
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
Examples Collection of models that illustrate model use and test models

Buildings.Utilities.Math.Average

Average of a vector

Information

This function outputs the average of the vector.

Extends from Modelica.Blocks.Interfaces.MISO (Multiple Input Single Output continuous control block).

Parameters

TypeNameDefaultDescription
Integernin1Number of inputs

Connectors

TypeNameDescription
input RealInputu[nin]Connector of Real input signals
output RealOutputyConnector of Real output signal

Modelica definition

```block Average "Average of a vector"
extends Modelica.Blocks.Interfaces.MISO;
equation
y = sum(u)/nin;
end Average;
```

Buildings.Utilities.Math.Bicubic

Bicubic function

Information

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).

Connectors

TypeNameDescription
input RealInputu1Connector of Real input signal 1
input RealInputu2Connector of Real input signal 2
output RealOutputyConnector of Real output signal

Modelica definition

```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;
```

Information

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).

Parameters

TypeNameDefaultDescription
Reala[6] Coefficients

Connectors

TypeNameDescription
input RealInputu1Connector of Real input signal 1
input RealInputu2Connector of Real input signal 2
output RealOutputyConnector of Real output signal

Modelica definition

```block Biquadratic "Biquadratic function"
extends Modelica.Blocks.Interfaces.SI2SO;
parameter Real a[6] "Coefficients";
equation
```

Buildings.Utilities.Math.Max

Maximum element of a vector

Information

Outputs the minimum of the vector.

Extends from Modelica.Blocks.Interfaces.MISO (Multiple Input Single Output continuous control block).

Parameters

TypeNameDefaultDescription
Integernin1Number of inputs

Connectors

TypeNameDescription
input RealInputu[nin]Connector of Real input signals
output RealOutputyConnector of Real output signal

Modelica definition

```block Max "Maximum element of a vector"
extends Modelica.Blocks.Interfaces.MISO;
equation
y = max(u);
end Max;
```

Buildings.Utilities.Math.Min

Minimum element of a vector

Information

Outputs the minimum of the vector.

Extends from Modelica.Blocks.Interfaces.MISO (Multiple Input Single Output continuous control block).

Parameters

TypeNameDefaultDescription
Integernin1Number of inputs

Connectors

TypeNameDescription
input RealInputu[nin]Connector of Real input signals
output RealOutputyConnector of Real output signal

Modelica definition

```block Min "Minimum element of a vector"
extends Modelica.Blocks.Interfaces.MISO;
equation
y = min(u);
end Min;
```

Buildings.Utilities.Math.SmoothHeaviside

Once continuously differentiable approximation to the Heaviside function

Information

Once Lipschitz continuously differentiable approximation to the Heaviside(.,.) function.

Extends from Modelica.Blocks.Interfaces.SISO (Single Input Single Output continuous control block).

Parameters

TypeNameDefaultDescription
Realdelta Width of transition interval

Connectors

TypeNameDescription
input RealInputuConnector of Real input signal
output RealOutputyConnector of Real output signal

Modelica definition

```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;
```

Buildings.Utilities.Math.SmoothLimit

Once continuously differentiable approximation to the limit function

Information

Once continuously differentiable approximation to the limit(.,.) function. The output is bounded to be in [0, 1].

Extends from Modelica.Blocks.Interfaces.SISO (Single Input Single Output continuous control block).

Parameters

TypeNameDefaultDescription
RealdeltaX Width of transition interval
Realupper Upper limit
Reallower Lower limit

Connectors

TypeNameDescription
input RealInputuConnector of Real input signal
output RealOutputyConnector of Real output signal

Modelica definition

```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;
```

Buildings.Utilities.Math.SmoothMax

Once continuously differentiable approximation to the maximum function

Information

Once continuously differentiable approximation to the max(.,.) function.

Extends from Modelica.Blocks.Interfaces.SI2SO (2 Single Input / 1 Single Output continuous control block).

Parameters

TypeNameDefaultDescription
RealdeltaX Width of transition interval

Connectors

TypeNameDescription
input RealInputu1Connector of Real input signal 1
input RealInputu2Connector of Real input signal 2
output RealOutputyConnector of Real output signal

Modelica definition

```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;
```

Buildings.Utilities.Math.SmoothMin

Once continuously differentiable approximation to the minimum function

Information

Once continuously differentiable approximation to the max(.,.) function.

Extends from Modelica.Blocks.Interfaces.SI2SO (2 Single Input / 1 Single Output continuous control block).

Parameters

TypeNameDefaultDescription
RealdeltaX Width of transition interval

Connectors

TypeNameDescription
input RealInputu1Connector of Real input signal 1
input RealInputu2Connector of Real input signal 2
output RealOutputyConnector of Real output signal

Modelica definition

```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;
```

Automatically generated Thu Dec 8 16:36:32 2011.