blockSine
Generates a sine signal.
Extends from ModelicaDEVS.Templates.DSource (DEVS source block).
Information
The Sine BlockParameters:
| a | amplitude |
| f | frequency |
| phi | phase |
| k | number of outputs during the rise of the ramp (only for QSS1) |
| start | start time of the output series |
Description:
The well known first three parameters describe the customary properties of a sine signal. The last two parameters are used to generate the output: since the signal has to be understandable by DEVS blocks, the originally continuous sine signal has to be broken down into events.
Parameter k declares how many outputs per period are desired (duration of a period = 1/f). These outputs can be seen as samples of a normal sine signal.
Parameter start indicates when the output series starts. This enables a sampling of the sine signal not only at time instants t= 0+i*(1/(f*k)), i=non-negative integers, but also at time instants t=start+i*(1/(f*k)) where start is the sampling start time and acts as an offset to the multiples of 1/(f*k).
Assigning a negative value to the amplitude yields a mirroring of the signal at the x-axis.
Generated Events (QSS1/QSS2/QSS3 mode):
Note: the following table descibes only one period of the signal.
| yVal[1] | yVal[2] | yVal[3] | |
| t=start+i*(1/f*k) | a*sin(t*w+phi) | a*w*cos(t*w+phi) | -a*w*w*sin(t*w+phi)/2 |
| i={0,1,2,...,k} | |||
| w=2*f*Modelica.Constants.pi |
![]() |
Parameter setting: |
a=1 f=1 phi=0 k=20 start=0 |
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | method (from DSource) | world.qss | Use QSS1, QSS2 or QSS3 |
| Real | a | 1 | Amplitude |
| Real | f | 1 | Frequency |
| Real | phi | 0 | Phase in rad |
| Real | k | 20 | Sample events per period |
| Real | start | 0 | Sampling start time |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| ModelicaDEVS.Templates.DiscreteOutPort | outPort (from DSource) |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| ModelicaDEVS.Miscellaneous.worldModel | world (from DSource) |
