blockAdd

Sums up two values.

Extends from ModelicaDEVS.Templates.DoubleDDBlock (Discrete double input - discrete single output block).

Information

The Add Block

Parameters:
c0 coefficient of the first input value
c1 coefficient of the second input value


Description:

The Add block belongs to the binary operators and computes the weighted sum of two values:y=u0*c0+u1*c1.

The mechanism of a binary operator block is divided into two parts: a first part that becomes active at the occurrence of an internal event, and a second part that is activated by an internal as well as an external event:
  • The first when-statement can be simply thought of as the analogon to the lambda output function.
  • The second when-statement represents the external and the internal transition. It shows one of the typical properties of the binary operator blocks: usually, only one of the two input ports receives a new signal whereas the other one remains silent, i.e. still holds the value that it had adopted the last time it received a signal. The evaluation of the output of the Add block could now simply depend on the old value of the inactive port and the new value that has arrived through the active one. However, in order to make the computation as accurate as possible, the old value of the silent port is replaced with an estimation of a value that the signal coming in through the silent port is likely to have adopted in the meantime (since the last time when there was an explicit external event). The estimation is carried out on the basis of the signal's previous Taylor series values (the coefficients to the constant, linear and quadratic terms).
    The following figure shows an example of possible inputs and outputs at the ports of an Add block. For the input signals, the current value as well as the coefficient of the first derivative (which is equal to the linear term of the Taylor series expansion) of the input function are graphically indicated. The output graph labelled "output" gives the true output involving the estimated value for silent ports. The graph labelled "alternative output" shows what the output would look like if no estimation for the function coming in through the silent port took place (which is the case in QSS1 where no higher-order Taylor series expansion is used).

Parameters

TypeNameDefaultDescription
Integermethod (from DoubleDDBlock)world.qssUse QSS1, QSS2 or QSS3
Realc01|Coefficients||u0
Realc11|Coefficients||u1

Connectors

TypeNameDefaultDescription
ModelicaDEVS.Templates.DiscreteInPortinPort1 (from DoubleDDBlock)
ModelicaDEVS.Templates.DiscreteInPortinPort2 (from DoubleDDBlock)
ModelicaDEVS.Templates.DiscreteOutPortoutPort (from DoubleDDBlock)

Components

TypeNameDefaultDescription
ModelicaDEVS.Miscellaneous.worldModelworld (from DoubleDDBlock)