blockSquare
Generates a square signal.
Extends from ModelicaDEVS.Templates.DSource (DEVS source block).
Information
The Square BlockParameters:
| offset | amplitude offset |
| a | amplitude |
| f | frequency |
| d | duty cycle (percentage) |
Description:
This block generates a simple step signal.
The duty cycle indicates the percentage of the period in which the signal is positive, i.e. when the output event takes a value of y=offset+a.
Assigning a negative value to the amplitude results in a mirroring of the signal at the straight line y=offset.
Generated Events (QSS1/QSS2/QSS3 mode):
| yVal[1] | yVal[2] | yVal[3] | |
| t=i*1/f | offset-a | 0 | 0 |
| t=i*1/f+1/(f*(100-d)) | offset+a | 0 | 0 |
| i=natural numbers |
In words: events are generated at the beginning of a every period and at the beginning of the duty cycle.
![]() |
Parameter setting: |
offset=0 a=1 f=1 d=75 |
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | method (from DSource) | world.qss | Use QSS1, QSS2 or QSS3 |
| Real | offset | 0.0 | Aplitude offset |
| Real | a | 1.0 | Amplitude |
| Real | f | 1.0 | Frequency |
| Real | d | 50 | The percentage of the cycle during which the system adopts the value of the positive amplitude |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| ModelicaDEVS.Templates.DiscreteOutPort | outPort (from DSource) |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| ModelicaDEVS.Miscellaneous.worldModel | world (from DSource) |
