blockTriangular
Generates a triangular signal.
Extends from ModelicaDEVS.Templates.DSource (DEVS source block).
Information
The Triangular BlockParameters:
| a | amplitude |
| f | frequency |
| k | number of outputs per slope (only for QSS1) |
Description:
This block generates a triangular 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).
Assigning a negative value to the amplitude yields a mirroring of the signal at the x-axis.
Generated Events (QSS1 mode):
Note: the following table describes only one period of the signal.
| yVal[1] | yVal[2] | yVal[3] | |
| t=i*1/(2*f*k) | -a+i*(2*a/k) | 0 | 0 |
| t=1/(2*f)+i*1/(2*f*k) | a-i*(2*a/k) | 0 | 0 |
| i={0,1,2,...,k} |
![]() |
Parameter setting: |
a=1 f=1 k=20 |
Generated Events (QSS2/QSS3 mode):
| yVal[1] | yVal[2] | yVal[3] | |
| t=i*1/f | -a | 4*a/f | 0 |
| t=1/(2*f)+i*1/f | a | -4*a/f | 0 |
| i=non-negative integers |
![]() ![]() |
Parameter setting: |
a=1 f=1 |
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | method (from DSource) | world.qss | Use QSS1, QSS2 or QSS3 |
| Real | a | 1.0 | Amplitude |
| Real | f | 1 | Frequency |
| Real | k | 10 | Number of outputs per slope (only for QSS1) |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| ModelicaDEVS.Templates.DiscreteOutPort | outPort (from DSource) |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| ModelicaDEVS.Miscellaneous.worldModel | world (from DSource) |


