.ModelicaDEVS.SourceBlocks.Saw

Information

The Saw Block

Parameters:
a amplitude
f frequency
k number of outputs during the rise of the ramp (only for QSS1)


Description:

This block generates a saw tooth like signal.

Again, QSS1 needs the signal to be described in terms of a piecewise constant stair function (see the description of the Ramp block for more details).

Note that it is possible to assign a negative value to the amplitude, such that the saw signal is mirrored at the x-axis.


Generated Events (QSS1 mode):

Note: the following table descibes only one period of the signal.


yVal[1] yVal[2] yVal[3]
t=i*1/(f*k) -a+i*(2*a/(k-1)) 0 0
i={0,1,2,...,k}

As can be seen in the picture below, the saw signal starts with the lower value (-amplitude) at the beginning of a period, but takes the upper value (+amplitude) before the end of the period. The reason for this is that it is not possible to make it take the upper value exactly when the period is over, since at that time instant it also would have to take the lower value in order to start the next period. Thus, only the start or the end of a slope can take the theoretically correct value, but not both.


Parameter setting: a=2
f=1
k=11



Generated Events (QSS2/QSS3 mode):


yVal[1] yVal[2] yVal[3]
t=i*1/f -a 2af 0
i=natural numbers

Since both the starting value and the slope are the same at every saw "tooth", the values of the first two entries in the output vector are constant. The signal can be reconstructed by means of the auxiliary variable Saw.showEvents that changes its value each time a new period starts.



Parameter setting: a=2
f=1


Generated at 2020-01-24T02:40:14Z by OpenModelicaOpenModelica 1.16.0~dev-120-g0c802bd using GenerateDoc.mos