.ModelicaDEVS.FunctionBlocks.Delay

Information

The Delay Block

Parameters:
d delay


Description:

The Delay block takes an input signal and outputs the exact same trajectory a given amount of time later (specified by the parameter d).

The following picture shows such an input signal (blue) and the corresponding output signal (red) with a delay of 0.1.


Contrary to the other blocks, which have been programmed in Modelica exclusively, the Delay block exploits the possibility to use externally defined functions programmed in C. The reason for this is that in order to be able to output the values of the input signal d units of time later than they have actually arrived, the Delay block has to first store the incoming event values into an array and read them out again after d units of time. Given that at implementation time, it cannot be known how many values must be stored before the first value is read out again and therefore could be overwritten by a new value, the size of the array has to be sufficiently big such that also big delays are possible. Unfortunately, it is not recommendable to declare too big an array in Modelica, since arrays are treated as a set of scalars, and too many variables in a block make its compilation and simulation become very slow. For this reason, a number of external C functions have been declared, the scope of which is to take care of the implementation parts that involve arrays. Nevertheless, the governing of the block - when to call which transition - lies still within the Modelica model itself. By means of one of the functions defined in the Delay block, it shall be illustrated what it takes to use a C function within Modelica (cf. also [Dymola]): The function getSigmaDint() can now be used as if its whole body had been written in Modelica.
Generated at 2024-03-27T19:15:56Z by OpenModelicaOpenModelica 1.22.3 using GenerateDoc.mos