This package provides blocks with Boolean input and output signals to describe logical networks. A typical example for a logical network built with package Logical is shown in the next figure:
The actual value of Boolean input and/or output signals is displayed in the respective block icon as "circle", where "white" color means value false and "green" color means value true. These values are visualized in a diagram animation.
Extends from Modelica.Icons.Package
(Icon for standard packages).
Name | Description |
---|---|
And | Logical 'and': y = u1 and u2 |
Change | Output y is true, if the input u has a rising or falling edge (y = change(u)) |
Edge | Output y is true, if the input u has a rising edge (y = edge(u)) |
FallingEdge | Output y is true, if the input u has a falling edge (y = edge(not u)) |
Greater | Output y is true, if input u1 is greater than input u2 |
GreaterEqual | Output y is true, if input u1 is greater or equal than input u2 |
GreaterEqualThreshold | Output y is true, if input u is greater or equal than threshold |
GreaterThreshold | Output y is true, if input u is greater than threshold |
Hysteresis | Transform Real to Boolean signal with Hysteresis |
Less | Output y is true, if input u1 is less than input u2 |
LessEqual | Output y is true, if input u1 is less or equal than input u2 |
LessEqualThreshold | Output y is true, if input u is less or equal than threshold |
LessThreshold | Output y is true, if input u is less than threshold |
LogicalSwitch | Logical Switch |
Nand | Logical 'nand': y = not (u1 and u2) |
Nor | Logical 'nor': y = not (u1 or u2) |
Not | Logical 'not': y = not u |
OnOffController | On-off controller |
Or | Logical 'or': y = u1 or u2 |
Pre | Breaks algebraic loops by an infinitesimal small time delay (y = pre(u): event iteration continues until u = pre(u)) |
RSFlipFlop | A basic RS Flip Flop |
Switch | Switch between two Real signals |
TerminateSimulation | Terminate simulation if condition is fulfilled |
Timer | Timer measuring the time from the time instant where the Boolean input became true |
TriggeredTrapezoid | Triggered trapezoid generator |
Xor | Logical 'xor': y = u1 xor u2 |
ZeroCrossing | Trigger zero crossing of input u |
The output is true if all inputs are true, otherwise the output is false.
Extends from Modelica.Blocks.Interfaces.partialBooleanSI2SO
(Partial block with 2 input and 1 output Boolean signal).
Type | Name | Description |
---|---|---|
input BooleanInput | u1 | Connector of first Boolean input signal |
input BooleanInput | u2 | Connector of second Boolean input signal |
output BooleanOutput | y | Connector of Boolean output signal |
The output is true if at least one input is true, otherwise the output is false.
Extends from Modelica.Blocks.Interfaces.partialBooleanSI2SO
(Partial block with 2 input and 1 output Boolean signal).
Type | Name | Description |
---|---|---|
input BooleanInput | u1 | Connector of first Boolean input signal |
input BooleanInput | u2 | Connector of second Boolean input signal |
output BooleanOutput | y | Connector of Boolean output signal |
The output is true if exactly one input is true, otherwise the output is false.
Extends from Modelica.Blocks.Interfaces.partialBooleanSI2SO
(Partial block with 2 input and 1 output Boolean signal).
Type | Name | Description |
---|---|---|
input BooleanInput | u1 | Connector of first Boolean input signal |
input BooleanInput | u2 | Connector of second Boolean input signal |
output BooleanOutput | y | Connector of Boolean output signal |
The output is true if none of the inputs is true, otherwise the output is false.
Extends from Modelica.Blocks.Interfaces.partialBooleanSI2SO
(Partial block with 2 input and 1 output Boolean signal).
Type | Name | Description |
---|---|---|
input BooleanInput | u1 | Connector of first Boolean input signal |
input BooleanInput | u2 | Connector of second Boolean input signal |
output BooleanOutput | y | Connector of Boolean output signal |
The output is true if at least one input is false, otherwise the output is false.
Extends from Modelica.Blocks.Interfaces.partialBooleanSI2SO
(Partial block with 2 input and 1 output Boolean signal).
Type | Name | Description |
---|---|---|
input BooleanInput | u1 | Connector of first Boolean input signal |
input BooleanInput | u2 | Connector of second Boolean input signal |
output BooleanOutput | y | Connector of Boolean output signal |
The output is true if the input is false, otherwise the output is false.
Extends from Modelica.Blocks.Interfaces.partialBooleanSISO
(Partial block with 1 input and 1 output Boolean signal).
Type | Name | Description |
---|---|---|
input BooleanInput | u | Connector of Boolean input signal |
output BooleanOutput | y | Connector of Boolean output signal |
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 Modelica.Blocks.Interfaces.partialBooleanSISO
(Partial block with 1 input and 1 output Boolean signal).
Type | Name | Default | Description |
---|---|---|---|
Boolean | pre_u_start | false | Start value of pre(u) at initial time |
Type | Name | Description |
---|---|---|
input BooleanInput | u | Connector of Boolean input signal |
output BooleanOutput | y | Connector of Boolean output signal |
The output is true if the Boolean input has a rising edge from false to true, otherwise the output is false.
Extends from Modelica.Blocks.Interfaces.partialBooleanSISO
(Partial block with 1 input and 1 output Boolean signal).
Type | Name | Default | Description |
---|---|---|---|
Boolean | pre_u_start | false | Start value of pre(u) at initial time |
Type | Name | Description |
---|---|---|
input BooleanInput | u | Connector of Boolean input signal |
output BooleanOutput | y | Connector of Boolean output signal |
The output is true if the Boolean input has a falling edge from true to false, otherwise the output is false.
Extends from Modelica.Blocks.Interfaces.partialBooleanSISO
(Partial block with 1 input and 1 output Boolean signal).
Type | Name | Default | Description |
---|---|---|---|
Boolean | pre_u_start | false | Start value of pre(u) at initial time |
Type | Name | Description |
---|---|---|
input BooleanInput | u | Connector of Boolean input signal |
output BooleanOutput | y | Connector of Boolean output signal |
The output is true if the Boolean input has either a rising edge from false to true or a falling edge from true to false, otherwise the output is false.
Extends from Modelica.Blocks.Interfaces.partialBooleanSISO
(Partial block with 1 input and 1 output Boolean signal).
Type | Name | Default | Description |
---|---|---|---|
Boolean | pre_u_start | false | Start value of pre(u) at initial time |
Type | Name | Description |
---|---|---|
input BooleanInput | u | Connector of Boolean input signal |
output BooleanOutput | y | Connector of Boolean output signal |
The output is true if the Real input is greater than parameter threshold, otherwise the output is false.
Extends from Modelica.Blocks.Interfaces.partialBooleanThresholdComparison
(Partial block to compare the Real input u with a threshold and provide the result as 1 Boolean output signal).
Type | Name | Default | Description |
---|---|---|---|
Real | threshold | 0 | Comparison with respect to threshold |
Type | Name | Description |
---|---|---|
input RealInput | u | Connector of Real input signal |
output BooleanOutput | y | Connector of Boolean output signal |
The output is true if the Real input is greater than or equal to parameter threshold, otherwise the output is false.
Extends from Modelica.Blocks.Interfaces.partialBooleanThresholdComparison
(Partial block to compare the Real input u with a threshold and provide the result as 1 Boolean output signal).
Type | Name | Default | Description |
---|---|---|---|
Real | threshold | 0 | Comparison with respect to threshold |
Type | Name | Description |
---|---|---|
input RealInput | u | Connector of Real input signal |
output BooleanOutput | y | Connector of Boolean output signal |
The output is true if the Real input is less than parameter threshold, otherwise the output is false.
Extends from Modelica.Blocks.Interfaces.partialBooleanThresholdComparison
(Partial block to compare the Real input u with a threshold and provide the result as 1 Boolean output signal).
Type | Name | Default | Description |
---|---|---|---|
Real | threshold | 0 | Comparison with respect to threshold |
Type | Name | Description |
---|---|---|
input RealInput | u | Connector of Real input signal |
output BooleanOutput | y | Connector of Boolean output signal |
The output is true if the Real input is less than or equal to parameter threshold, otherwise the output is false.
Extends from Modelica.Blocks.Interfaces.partialBooleanThresholdComparison
(Partial block to compare the Real input u with a threshold and provide the result as 1 Boolean output signal).
Type | Name | Default | Description |
---|---|---|---|
Real | threshold | 0 | Comparison with respect to threshold |
Type | Name | Description |
---|---|---|
input RealInput | u | Connector of Real input signal |
output BooleanOutput | y | Connector of Boolean output signal |
The output is true if Real input u1 is greater than Real input u2, otherwise the output is false.
Extends from Modelica.Blocks.Interfaces.partialBooleanComparison
(Partial block with 2 Real input and 1 Boolean output signal (the result of a comparison of the two Real inputs)).
Type | Name | Description |
---|---|---|
input RealInput | u1 | Connector of first Real input signal |
input RealInput | u2 | Connector of second Real input signal |
output BooleanOutput | y | Connector of Boolean output signal |
The output is true if Real input u1 is greater than or equal to Real input u2, otherwise the output is false.
Extends from Modelica.Blocks.Interfaces.partialBooleanComparison
(Partial block with 2 Real input and 1 Boolean output signal (the result of a comparison of the two Real inputs)).
Type | Name | Description |
---|---|---|
input RealInput | u1 | Connector of first Real input signal |
input RealInput | u2 | Connector of second Real input signal |
output BooleanOutput | y | Connector of Boolean output signal |
The output is true if Real input u1 is less than Real input u2, otherwise the output is false.
Extends from Modelica.Blocks.Interfaces.partialBooleanComparison
(Partial block with 2 Real input and 1 Boolean output signal (the result of a comparison of the two Real inputs)).
Type | Name | Description |
---|---|---|
input RealInput | u1 | Connector of first Real input signal |
input RealInput | u2 | Connector of second Real input signal |
output BooleanOutput | y | Connector of Boolean output signal |
The output is true if Real input u1 is less than or equal to Real input u2, otherwise the output is false.
Extends from Modelica.Blocks.Interfaces.partialBooleanComparison
(Partial block with 2 Real input and 1 Boolean output signal (the result of a comparison of the two Real inputs)).
Type | Name | Description |
---|---|---|
input RealInput | u1 | Connector of first Real input signal |
input RealInput | u2 | Connector of second Real input signal |
output BooleanOutput | y | Connector of Boolean output signal |
The output "y" is true at the time instant when the input "u" becomes zero, provided the input "enable" is true. At all other time instants, the output "y" is false. If the input "u" is zero at a time instant when the "enable" input changes its value, then the output y is false.
Note, that in the plot window of a Modelica simulator, the output of this block is usually identically to false, because the output may only be true at an event instant, but not during continuous integration. In order to check that this component is actually working as expected, one should connect its output to, e.g., component Modelica.Blocks.Discrete.TriggeredSampler.
Extends from Modelica.Blocks.Interfaces.partialBooleanSO
(Partial block with 1 output Boolean signal).
Type | Name | Description |
---|---|---|
output BooleanOutput | y | Connector of Boolean output signal |
input RealInput | u |   |
input BooleanInput | enable | Zero input crossing is triggered if the enable input signal is true |
The LogicalSwitch switches, depending on the Boolean u2 connector (the middle connector), between the two possible input signals u1 (upper connector) and u3 (lower connector).
If u2 is true, connector y is set equal to u1, else it is set equal to u3.
Extends from Modelica.Blocks.Interfaces.partialBooleanSI3SO
(Partial block with 3 input and 1 output Boolean signal).
Type | Name | Description |
---|---|---|
input BooleanInput | u1 | Connector of first Boolean input signal |
input BooleanInput | u2 | Connector of second Boolean input signal |
input BooleanInput | u3 | Connector of third Boolean input signal |
output BooleanOutput | y | Connector of Boolean output signal |
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).
Type | Name | Description |
---|---|---|
input RealInput | u1 | Connector of first Real input signal |
input BooleanInput | u2 | Connector of Boolean input signal |
input RealInput | u3 | Connector of second Real input signal |
output RealOutput | y | Connector of Real output signal |
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).
Type | Name | Default | Description |
---|---|---|---|
Real | uLow | if y=true and u<=uLow, switch to y=false | |
Real | uHigh | if y=false and u>=uHigh, switch to y=true | |
Boolean | pre_y_start | false | Value of pre(y) at initial time |
Type | Name | Description |
---|---|---|
input RealInput | u |   |
output BooleanOutput | y |   |
The block OnOffController sets the output signal y to true when the input signal u falls below the reference signal minus half of the bandwidth and sets the output signal y to false when the input signal u exceeds the reference signal plus half of the bandwidth.
Extends from Modelica.Blocks.Icons.PartialBooleanBlock
(Basic graphical layout of logical block).
Type | Name | Default | Description |
---|---|---|---|
Real | bandwidth | Bandwidth around reference signal | |
Boolean | pre_y_start | false | Value of pre(y) at initial time |
Type | Name | Description |
---|---|---|
input RealInput | reference | Connector of Real input signal used as reference signal |
input RealInput | u | Connector of Real input signal used as measurement signal |
output BooleanOutput | y | Connector of Real output signal used as actuator signal |
The block TriggeredTrapezoid has a Boolean input and a real output signal and requires the parameters amplitude, rising, falling and offset. The output signal y represents a trapezoidal signal dependent on the input signal u.
The behaviour is as follows: Assume the initial input to be false. In this case, the output will be offset. After a rising edge (i.e., the input changes from false to true), the output is rising during rising to the sum of offset and amplitude. In contrast, after a falling edge (i.e., the input changes from true to false), the output is falling during falling to a value of offset.
Note, that the case of edges before expiration of rising or falling is handled properly.
Extends from Modelica.Blocks.Icons.PartialBooleanBlock
(Basic graphical layout of logical block).
Type | Name | Default | Description |
---|---|---|---|
Real | amplitude | 1 | Amplitude of trapezoid |
Time | rising | 0 | Rising duration of trapezoid |
Time | falling | rising | Falling duration of trapezoid |
Real | offset | 0 | Offset of output signal |
Type | Name | Description |
---|---|---|
input BooleanInput | u | Connector of Boolean input signal |
output RealOutput | y | Connector of Real output signal |
When the Boolean input "u" becomes true, the timer starts and the output "y" is the time that has elapsed since "u" became true. When the input becomes false, the timer stops and the output is reset to zero.
Extends from Modelica.Blocks.Icons.PartialBooleanBlock
(Basic graphical layout of logical block).
Type | Name | Description |
---|---|---|
input BooleanInput | u | Connector of Boolean input signal |
output RealOutput | y | Connector of Real output signal |
The output Q
is set by the input S
, is 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).
Type | Name | Default | Description |
---|---|---|---|
Boolean | Qini | false | Start value of Q at initial time |
Type | Name | Description |
---|---|---|
output BooleanOutput | Q |   |
output BooleanOutput | QI |   |
input BooleanInput | S |   |
input BooleanInput | R |   |
In the parameter menu, a time varying expression can be defined via variable condition, for example "condition = x < 0", where "x" is a variable that is declared in the model in which the "TerminateSimulation" block is present. If this expression becomes true, the simulation is (successfully) terminated. A termination message explaining the reason for the termination can be given via parameter "terminationText".
Type | Name | Default | Description |
---|---|---|---|
String | terminationText | "... End condition reached" | Text that will be displayed when simulation is terminated |
Type | Name | Description |
---|---|---|
output BooleanOutput | condition | Terminate simulation when condition becomes true |
Generated 2018-12-12 12:09:55 EST by MapleSim.