Modelica.Blocks.Logical.Switch Modelica.Blocks.Logical.Switch

Switch between two Real signals

Modelica.Blocks.Logical.Switch

Information

The Logical.Switch switches, depending on the logical connector u2 (the middle connector) between the two possible input signals u1 (upper connector) and u3 (lower connector).

If u2 is true, the output signal y is set equal to u1, else it is set equal to u3.

Extends from Modelica.Blocks.Icons.PartialBooleanBlock (Basic graphical layout of logical block).

Connectors

TypeNameDescription
input RealInputu1Connector of first Real input signal
input BooleanInputu2Connector of Boolean input signal
input RealInputu3Connector of second Real input signal
output RealOutputyConnector of Real output signal

Modelica definition

block Switch "Switch between two Real signals" extends Modelica.Blocks.Icons.PartialBooleanBlock; Blocks.Interfaces.RealInput u1 "Connector of first Real input signal"; Blocks.Interfaces.BooleanInput u2 "Connector of Boolean input signal"; Blocks.Interfaces.RealInput u3 "Connector of second Real input signal"; Blocks.Interfaces.RealOutput y "Connector of Real output signal"; equation y = if u2 then u1 else u3; end Switch;

Modelica.Blocks.Logical.Hysteresis Modelica.Blocks.Logical.Hysteresis

Transform Real to Boolean signal with Hysteresis

Modelica.Blocks.Logical.Hysteresis

Information

This block transforms a Real input signal into a Boolean output signal:

The start value of the output is defined via parameter pre_y_start (= value of pre(y) at initial time). The default value of this parameter is false.

Extends from Modelica.Blocks.Icons.PartialBooleanBlock (Basic graphical layout of logical block).

Parameters

TypeNameDefaultDescription
RealuLow if y=true and u<=uLow, switch to y=false
RealuHigh if y=false and u>=uHigh, switch to y=true
Booleanpre_y_startfalseValue of pre(y) at initial time

Connectors

TypeNameDescription
input RealInputu 
output BooleanOutputy 

Modelica definition

block Hysteresis "Transform Real to Boolean signal with Hysteresis" extends Modelica.Blocks.Icons.PartialBooleanBlock; parameter Real uLow(start=0) "if y=true and u<=uLow, switch to y=false"; parameter Real uHigh(start=1) "if y=false and u>=uHigh, switch to y=true"; parameter Boolean pre_y_start=false "Value of pre(y) at initial time"; Blocks.Interfaces.RealInput u; Blocks.Interfaces.BooleanOutput y; initial equation pre(y) = pre_y_start; equation assert(uHigh > uLow,"Hysteresis limits wrong (uHigh <= uLow)"); y = not pre(y) and u > uHigh or pre(y) and u >= uLow; end Hysteresis;

Modelica.Blocks.Logical.Not Modelica.Blocks.Logical.Not

Logical 'not': y = not u

Modelica.Blocks.Logical.Not

Information

The output is true if the input is false, otherwise the output is false.

Extends from Blocks.Interfaces.partialBooleanSISO (Partial block with 1 input and 1 output Boolean signal).

Connectors

TypeNameDescription
input BooleanInputuConnector of Boolean input signal
output BooleanOutputyConnector of Boolean output signal

Modelica definition

block Not "Logical 'not': y = not u" extends Blocks.Interfaces.partialBooleanSISO; equation y = not u; end Not;

Modelica.Blocks.Logical.Less Modelica.Blocks.Logical.Less

Output y is true, if input u1 is less than input u2

Modelica.Blocks.Logical.Less

Information

The output is true if Real input u1 is less than Real input u2, otherwise the output is false.

Extends from Blocks.Interfaces.partialBooleanComparison (Partial block with 2 Real input and 1 Boolean output signal (the result of a comparison of the two Real inputs)).

Connectors

TypeNameDescription
input RealInputu1Connector of first Boolean input signal
input RealInputu2Connector of second Boolean input signal
output BooleanOutputyConnector of Boolean output signal

Modelica definition

block Less "Output y is true, if input u1 is less than input u2" extends Blocks.Interfaces.partialBooleanComparison; equation y = u1 < u2; end Less;

Modelica.Blocks.Logical.GreaterEqual Modelica.Blocks.Logical.GreaterEqual

Output y is true, if input u1 is greater or equal than input u2

Modelica.Blocks.Logical.GreaterEqual

Information

The output is true if Real input u1 is greater than or equal to Real input u2, otherwise the output is false.

Extends from Blocks.Interfaces.partialBooleanComparison (Partial block with 2 Real input and 1 Boolean output signal (the result of a comparison of the two Real inputs)).

Connectors

TypeNameDescription
input RealInputu1Connector of first Boolean input signal
input RealInputu2Connector of second Boolean input signal
output BooleanOutputyConnector of Boolean output signal

Modelica definition

block GreaterEqual "Output y is true, if input u1 is greater or equal than input u2" extends Blocks.Interfaces.partialBooleanComparison; equation y = u1 >= u2; end GreaterEqual;

Modelica.Blocks.Logical.RSFlipFlop Modelica.Blocks.Logical.RSFlipFlop

A basic RS Flip Flop

Modelica.Blocks.Logical.RSFlipFlop

Information

The output Q is set by the input S and reset by the input R, and keeps its value in between. QI is the inverse of Q.

Extends from Modelica.Blocks.Icons.PartialBooleanBlock (Basic graphical layout of logical block).

Parameters

TypeNameDefaultDescription
BooleanQinifalseStart value of Q at initial time

Connectors

TypeNameDescription
output BooleanOutputQ 
output BooleanOutputQI 
input BooleanInputS 
input BooleanInputR 

Modelica definition

block RSFlipFlop "A basic RS Flip Flop" extends Modelica.Blocks.Icons.PartialBooleanBlock; parameter Boolean Qini=false "Start value of Q at initial time"; Modelica.Blocks.Interfaces.BooleanOutput Q; Modelica.Blocks.Interfaces.BooleanOutput QI; Modelica.Blocks.Logical.Nor nor; Modelica.Blocks.Logical.Nor nor1; Modelica.Blocks.Logical.Pre pre(pre_u_start=not (Qini)); Modelica.Blocks.Interfaces.BooleanInput S; Modelica.Blocks.Interfaces.BooleanInput R; equation connect(nor1.y, nor.u2); connect(nor1.y, Q); connect(nor.y, pre.u); connect(pre.y, nor1.u1); connect(pre.y, QI); connect(S, nor.u1); connect(R, nor1.u2); end RSFlipFlop;

Modelica.Blocks.Logical.Or Modelica.Blocks.Logical.Or

Logical 'or': y = u1 or u2

Modelica.Blocks.Logical.Or

Information

The output is true if at least one input is true, otherwise the output is false.

Extends from Blocks.Interfaces.partialBooleanSI2SO (Partial block with 2 input and 1 output Boolean signal).

Connectors

TypeNameDescription
input BooleanInputu1Connector of first Boolean input signal
input BooleanInputu2Connector of second Boolean input signal
output BooleanOutputyConnector of Boolean output signal

Modelica definition

block Or "Logical 'or': y = u1 or u2" extends Blocks.Interfaces.partialBooleanSI2SO; equation y = u1 or u2; end Or;

Modelica.Blocks.Logical.Nor Modelica.Blocks.Logical.Nor

Logical 'nor': y = not (u1 or u2)

Modelica.Blocks.Logical.Nor

Information

The output is true if none of the inputs is true, otherwise the output is false.

Extends from Blocks.Interfaces.partialBooleanSI2SO (Partial block with 2 input and 1 output Boolean signal).

Connectors

TypeNameDescription
input BooleanInputu1Connector of first Boolean input signal
input BooleanInputu2Connector of second Boolean input signal
output BooleanOutputyConnector of Boolean output signal

Modelica definition

block Nor "Logical 'nor': y = not (u1 or u2)" extends Blocks.Interfaces.partialBooleanSI2SO; equation y = not (u1 or u2); end Nor;

Modelica.Blocks.Logical.Pre Modelica.Blocks.Logical.Pre

Breaks algebraic loops by an infinitesimal small time delay (y = pre(u): event iteration continues until u = pre(u))

Modelica.Blocks.Logical.Pre

Information

This block delays the Boolean input by an infinitesimal small time delay and therefore breaks algebraic loops. In a network of logical blocks, in every "closed connection loop" at least one logical block must have a delay, since algebraic systems of Boolean equations are not solvable.

The "Pre" block returns the value of the "input" signal from the last "event iteration". The "event iteration" stops, once both values are identical (u = pre(u)).

Extends from Blocks.Interfaces.partialBooleanSISO (Partial block with 1 input and 1 output Boolean signal).

Parameters

TypeNameDefaultDescription
Booleanpre_u_startfalseStart value of pre(u) at initial time

Connectors

TypeNameDescription
input BooleanInputuConnector of Boolean input signal
output BooleanOutputyConnector of Boolean output signal

Modelica definition

block Pre "Breaks algebraic loops by an infinitesimal small time delay (y = pre(u): event iteration continues until u = pre(u))" parameter Boolean pre_u_start=false "Start value of pre(u) at initial time"; extends Blocks.Interfaces.partialBooleanSISO; initial equation pre(u) = pre_u_start; equation y = pre(u); end Pre;

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