blockTrapezoid
Generates a trapezoid signal.
Extends from ModelicaDEVS.Templates.DSource (DEVS source block).
Information
The Trapezoid BlockParameters:
| offset | signal ground value |
| a | amplitude |
| tr | rise time (how long does it take to reach the upper value) |
| tf | fall time (how long does it take to reach the lower value) |
| tu | time up (how long does the signal stay on the upper value) |
| td | time down (how long does the signal stay on the lower value) |
| k | number of outputs during the rise of the slopes (only for QSS1) |
Description:
This block generates a trapezoidal 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 trapezoidal signal is mirrored at the straight line y=offset.
Generated Events (QSS1 mode):
Note: the following table descibes only one period of the signal.
| yVal[1] | yVal[2] | yVal[3] | |
| t=i*tr/k | i*a/k | 0 | 0 |
| t=(tr+tu)+i*tf/k | i*a/k | 0 | 0 |
| i={0,1,2,...,k} |
![]() |
Parameter setting: |
offset=0 a=1 tr=2 tf=0.5 tu=0.5 td=1 k=10 |
Generated Events (QSS2/QSS3 mode):
| yVal[1] | yVal[2] | yVal[3] | |
| t=i*(tr+tu+tf+td) | offset | a/tr | 0 |
| t=tr+i*(tr+tu+tf+td) | a | 0 | 0 |
| t=tr+tu+i*(tr+tu+tf+td) | a | -a/tf | 0 |
| t=tr+tu+tf+i*(tr+tu+tf+td) | offset | 0 | 0 |
| i=natural numbers |
|
Parameter setting: |
offset=0 a=1 tr=2 tf=0.5 tu=0.5 td=1 |
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | method (from DSource) | world.qss | Use QSS1, QSS2 or QSS3 |
| Real | offset | 0 | Ground value |
| Real | a | 1.0 | Amplitude |
| Real | tr | 1.0 | Time the signal needs to rise |
| Real | tf | 1.0 | Time the signal needs to fall |
| Real | tu | 1.0 | Time the signal stays up |
| Real | td | 1.0 | Time the signal stays down |
| 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) |
