.ModelicaDEVS.FunctionBlocks.CommandedSampler

Information

The CommandedSampler Block

Parameters:
none


Description:

The CommandedSampler is fairly similar to the SamplerTrigger block. It takes two inputs where the first input is the signal from which the samples are taken, and the second input specifies the time instants when the sampling takes place. The second input is an arbitrary ModelicaDEVS block that generates a number of events, as it is in the nature of DEVS models. Usually, it is the values of the single events that we are interested in, given that they constitute the output trajectory. In this case however, for the CommandedSampler block to function correctly, it is only important to have any events at certain time instants: when the CommandedSampler receives an event from its second input port, it immediately takes a sample from the signal coming in through the first input port and holds this value until the next event is arriving at its second input port.
Note that both input signals are discrete-time variables in terms of Modelica, i.e. they are piecewise constant.

Normally, the sampling instants do not coincide with the event instants of the first port. This means that at a given sampling instant, the signal from the first port has been updated a certain amount of time ago and may have changed meanwhile (without producing an output event). Hence, analogously to the binary operator blocks (Add, Divider, Multiplier), an approximation of the first input port's true value is estimated (on the basis of the linear and quadratic terms of the Taylor series expansion stored in the second and third entry of the input/output vecors).

The picture illustrating the behaviour of the CommandedSampler shows a Sine block (blue) and a Ramp block (green) connected to the input ports of the CommandedSampler. The Sine gives the signal that has to be sampled, the Ramp block (used in QSS1-mode) determines the sampling instants: we know that every time the Ramp block changes its output value, there must have been an event. Hence, at each of these event instants, the output of the CommandedSampler block (plotted in red) takes the current value of the Sine signal, since it has been triggered by the event sent by the Ramp block to do so.


Generated at 2024-03-28T19:15:55Z by OpenModelicaOpenModelica 1.22.3 using GenerateDoc.mos