Modelica.Blocks.Math.Cos Modelica.Blocks.Math.Cos

Output the cosine of the input

Modelica.Blocks.Math.Cos

Information

This blocks computes the output y as cos of the input u:

    y = cos( u );

cos.png

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

Connectors

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

Modelica definition

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

Modelica.Blocks.Math.Add Modelica.Blocks.Math.Add

Output the sum of the two inputs

Modelica.Blocks.Math.Add

Information

This blocks computes output y as sum of the two input signals u1 and u2:

    y = k1*u1 + k2*u2;

Example:

     parameter:   k1= +2, k2= -3

  results in the following equations:

     y = 2 * u1 - 3 * u2

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

Parameters

TypeNameDefaultDescription
Realk1+1Gain of upper input
Realk2+1Gain of lower input

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 Add "Output the sum of the two inputs" extends Interfaces.SI2SO; 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.Mean Modelica.Blocks.Math.Mean

Calculate mean over period 1/f

Modelica.Blocks.Math.Mean

Information

This block calculates the mean of the input signal u over the given period 1/f:

1 T
- ∫ u(t) dt
T 0

Note: The output is updated after each period defined by 1/f.

If parameter yGreaterOrEqualZero in the Advanced tab is true (default = false), then the modeller provides the information that the mean of the input signal is guaranteed to be ≥ 0 for the exact solution. However, due to inaccuracies in the numerical integration scheme, the output might be slightly negative. If this parameter is set to true, then the output is explicitly set to 0.0, if the mean value results in a negative value.

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

Parameters

TypeNameDefaultDescription
Frequencyf Base frequency [Hz]
Realx00Start value of integrator state
Advanced
BooleanyGreaterOrEqualZerofalse=true, if output y is guaranteed to be >= 0 for the exact solution

Connectors

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

Modelica definition

block Mean "Calculate mean over period 1/f" extends Modelica.Blocks.Interfaces.SISO; parameter Modelica.SIunits.Frequency f(start=50) "Base frequency"; parameter Real x0=0 "Start value of integrator state"; parameter Boolean yGreaterOrEqualZero=false "=true, if output y is guaranteed to be >= 0 for the exact solution"; protected parameter Modelica.SIunits.Time t0(fixed=false) "Start time of simulation"; Real x "Integrator state"; initial equation t0 = time; x = x0; y = 0; equation der(x) = u; when sample(t0 + 1/f, 1/f) then y = if not yGreaterOrEqualZero then f*pre(x) else max(0.0, f*pre(x)); reinit(x, 0); end when; end Mean;

Modelica.Blocks.Math.Abs Modelica.Blocks.Math.Abs

Output the absolute value of the input

Modelica.Blocks.Math.Abs

Information

This blocks computes the output y as absolute value of the input u:

    y = abs( u );

The Boolean parameter generateEvent decides whether Events are generated at zero crossing (Modelica specification before 3) or not.

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

Parameters

TypeNameDefaultDescription
BooleangenerateEventfalseChoose whether events shall be generated

Connectors

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

Modelica definition

block Abs "Output the absolute value of the input" extends Interfaces.SISO; parameter Boolean generateEvent=false "Choose whether events shall be generated"; equation //y = abs(u); y = if generateEvent then (if u >= 0 then u else -u) else (if noEvent(u >= 0) then u else -u); end Abs;

Modelica.Blocks.Math.Sin Modelica.Blocks.Math.Sin

Output the sine of the input

Modelica.Blocks.Math.Sin

Information

This blocks computes the output y as sine of the input u:

    y = sin( u );

sin.png

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

Connectors

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

Modelica definition

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

Modelica.Blocks.Math.Division Modelica.Blocks.Math.Division

Output first input divided by second input

Modelica.Blocks.Math.Division

Information

This block computes the output y (element-wise) by dividing the corresponding elements of the two inputs u1 and u2:

    y = u1 / u2;

Extends from 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 Division "Output first input divided by second input" extends Interfaces.SI2SO; equation y = u1/u2; end Division;

Modelica.Blocks.Math.Gain Modelica.Blocks.Math.Gain

Output the product of a gain value with the input signal

Modelica.Blocks.Math.Gain

Information

This block computes output y as product of gain k with the input u:

    y = k * u;

Parameters

TypeNameDefaultDescription
Realk Gain value multiplied with input signal [1]

Connectors

TypeNameDescription
input RealInputuInput signal connector
output RealOutputyOutput signal connector

Modelica definition

block Gain "Output the product of a gain value with the input signal" parameter Real k(start=1, unit="1") "Gain value multiplied with input signal"; public Interfaces.RealInput u "Input signal connector"; Interfaces.RealOutput y "Output signal connector"; equation y = k*u; end Gain;

Automatically generated Mon Sep 11 16:11:51 2017.