blockTimeTable_Periodic
Generate a (possibly discontinuous) signal by linear interpolation in a table and repeats the signal each periode
Extends from Modelica.Blocks.Interfaces.SO (Single Output continuous control block).
Information
This block generates an output signal by linear interpolation in a table. The time points and function values are stored in a matrix table[i,j], where the first column table[:,1] contains the time points and the second column contains the data to be interpolated. The table interpolation has the following proporties:
- The time points need to be monotonically increasing.
- Discontinuities are allowed, by providing the same time point twice in the table.
- Values outside of the table range, are computed by extrapolation through the last or first two points of the table.
- If the table has only one row, no interpolation is performed and the function value is just returned independently of the actual time instant.
- Via parameters startTime and offset the curve defined by the table can be shifted both in time and in the ordinate value.
- The table is implemented in a numerically sound way by generating time events at interval boundaries, in order to not integrate over a discontinuous or not differentiable points.
Example:
table = [0 0
1 0
1 1
2 4
3 9
4 16]
If, e.g., time = 1.0, the output y = 0.0 (before event), 1.0 (after event)
e.g., time = 1.5, the output y = 2.5,
e.g., time = 2.0, the output y = 4.0,
e.g., time = 5.0, the output y = 23.0 (i.e., extrapolation).
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Real[:,2] | table | Table matrix (time = first column; e.g., table=[0, 0; 1, 1; 2, 4]) | |
| Real | offset | 0 | Offset of output signal |
| SI.Time | startTime | 0 | Output = offset for time < startTime |
| Modelica.SIunits.Time | period | Time for one period |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| RealOutput | y (from SO) | Connector of Real output signal |
Contents
| Name | Description |
|---|---|
| getInterpolationCoefficientsprotected | Determine interpolation coefficients and next time event |
Revisions
Release Notes:
- Oct. 21, 2002
by Christian Schweiger:
Corrected interface fromparameter Real table[:, :]=[0, 0; 1, 1; 2, 4];toparameter Real table[:, 2]=[0, 0; 1, 1; 2, 4]; - Nov. 7, 1999
by Martin Otter:
Realized.