Function and Cyclicality
In PowerTSM there are several properties which describe the data and the interpretation of dates, values and flags. In addition to the description of the content (e.g. units) there is also a structural description. The following properties describe the structural design of the data and time series:
- Function Type (Describes the mathematical function of the data)
- Cyclicality (Describes the interpretation of the data repetition in relation to the interval)
Function Types
Section titled “Function Types”The function type controls which mathematical function the data is subjected to. Currently there are two supported function types:
StepRight stands for a piecewise-constant function, where the value of a data point applies to the interval beginning at the data point’s time. Example: Power values (watts). StepRight time series can also be used to represent momentary values (such as temperature, wind speed, length, etc.) that are valid at the time of measurement.
StepLeft stands for a piecewise-constant function, where the value of a data point applies to the interval ending at the data point’s time. Example: Energy values (watt hour).
StepRight |
StepLeft |
Value |
|---|---|---|
| 00:00 | 01:00 | 10 |
| 01:00 | 02:00 | 20 |
| 02:00 | 03:00 | 30 |
| 03:00 | 04:00 | 40 |
Depending on the function type, the respective value is referenced in the database with the start time stamp (from value concept) or with the end time stamp (to value concept).
Cyclicality
Section titled “Cyclicality”The key practical difference becomes clear when data is missing for some interval steps. Given the same gap where no values are stored between 04:00 and 06:00 results in different behavior for the two modes on read-back:
| Timestamp | Stored (Both) | Read Back — Cyclic | Read Back — Acyclic |
|---|---|---|---|
| 02:00 | 10 | 10 | 10 |
| 03:00 | 20 | 20 | 20 |
| 04:00 | — | 0 | 20 |
| 05:00 | — | 0 | 20 |
| 06:00 | — | 0 | 20 |
| 07:00 | 60 | 60 | 60 |
- Cyclic — gaps in storage are gaps in data. No value stored means no value returned (typically zero or null).
- Acyclic — the last stored value is implicitly valid until the next stored value. The gap is filled automatically on read-back.
Cyclic vs. Acyclic Time Series
Section titled “Cyclic vs. Acyclic Time Series”The following comparison shows the differences between cyclic and acyclic time series.
Time Axis
Section titled “Time Axis”The time axis follows a fixed interval length, the time span between two values always has the same length.
The time axis follows a fixed interval length, the time span between two values has at least one interval length, but can vary to a variable multiple of the interval length.
Value Validity Range
Section titled “Value Validity Range”There is a fixed equidistant grid of time stamps on the time axis. Each value is valid until the end of the interval assigned to the time series.
Cyclic power time series
Section titled “ Cyclic power time series”| Timestamp | Valid Until | Value |
|---|---|---|
| 2020-01-01 00:00 | 2020-01-01 01:00 | 10 |
| 2020-01-01 01:00 | 2020-01-01 02:00 | 10 |
| 2020-01-01 02:00 | 2020-01-01 03:00 | 30 |
| 2020-01-01 03:00 | 2020-01-01 04:00 | 35 |
| 2020-01-01 04:00 | 2020-01-01 05:00 | 35 |
| 2020-01-01 05:00 | 2020-01-01 06:00 | 100 |
A value is always valid up to the next value on the time axis. The last value on the time axis is valid until infinity (Maximum DateTimeOffset in .NET).
Acyclic power time series
Section titled “ Acyclic power time series”| # | Timestamp | Valid Until # | Value |
|---|---|---|---|
| 1 | 2020-01-01 00:00 | #2 | 10 |
| 2 | 2020-01-01 02:00 | #3 | 30 |
| 3 | 2020-01-01 03:00 | #4 | 35 |
| 4 | 2020-01-01 05:00 | infinity | 100 |
Interval
Section titled “Interval”Like all PowerTSM time series, cyclic time series can be read and output to any interval.
Like all PowerTSM time series, acyclic time series can be read and output to any interval.
Storage Space and Compressibility
Section titled “Storage Space and Compressibility”Cyclic time series require more storage space compared to acyclic time series but in order to reduce size they can be compressed.
Acyclic time series require less storage space than cyclic time series for the same time period (as long as the value does not change on each interval step), but due to their asynchronous nature, they currently cannot be compressed into time blocks of equal length.
When to Use Acyclic Time Series
Section titled “When to Use Acyclic Time Series”Depending on the business context, data volume, performance requirements and the interval between two value changes, the following bullet points help decide what time series type to use:
- Constant or rarely changing values (e.g. to model fixed volume deals)
- Values must keep their acyclic intervals upon saving and reading
- Any given value must be valid until the next value on the time line
- Number of occurring values / value changes is small enough that a compressed cyclic time series will not provide a major performance improvement
- Values on the time line are frequently changing
- Amount of values per compression block is higher than 75% of a given block, so that using compressed cyclic time series would result in higher performance
Transformation Between Cyclic and Acyclic
Section titled “Transformation Between Cyclic and Acyclic”Time series data can always be represented as cyclic or acyclic, regardless of the cyclicality of a time series. The boolean property Cyclic of ITimeSeriesDataCollection specifies whether cyclic or acyclic data is provided.
An important flag for the representation of acyclic data is the Ignore flag.
When writing data the Ignore flag signals to keep the data already saved in the database for this time span. This can be done for both cyclic and acyclic values, but is only useful for acyclic data, since when writing cyclic data the Ignore flag is assumed for any timestamp on the grid for which no data is provided.
For reading of data the Ignore flag symbolizes the end of data according to the given reading period and therefore only occurs for reading acyclic data.
Examples of Data Representation
Section titled “Examples of Data Representation”Value repetition over multiple interval steps
Section titled “ Value repetition over multiple interval steps”| Timestamp | Value | Flag |
|---|---|---|
| 02:00 | 10 | Valid |
| 03:00 | 20 | Valid |
| 04:00 | 20 | Valid |
| 05:00 | 20 | Valid |
| 06:00 | 20 | Valid |
| 07:00 | 60 | Valid |
The repeated values (03:00–06:00) are stored only once. The Ignore flag at 08:00 marks the end of data.
| Timestamp | Value | Flag |
|---|---|---|
| 02:00 | 10 | Valid |
| 03:00 | 20 | Valid |
| 07:00 | 60 | Valid |
| 08:00 | 0 | Ignore |
Gaps in the data
Section titled “ Gaps in the data”Cyclic data only contains timestamps where values exist — gaps are implicit.
| Timestamp | Value | Flag |
|---|---|---|
| 02:00 | 10 | Valid |
| 04:00 | 20 | Valid |
| 06:00 | 60 | Valid |
Gaps must be explicitly marked with the Ignore flag.
| Timestamp | Value | Flag |
|---|---|---|
| 02:00 | 10 | Valid |
| 03:00 | 0 | Ignore |
| 04:00 | 20 | Valid |
| 05:00 | 0 | Ignore |
| 06:00 | 60 | Valid |
| 07:00 | 0 | Ignore |