The Time Series Element has a time shifting feature that allows you to use a random starting point in the time series, or to specify a starting year such that the simulation begins with data from the specified year. If, in the course of the simulation, the end of the time series is reached, GoldSim will wrap and use data from earlier in the time series. The exact wrapping behavior depends on which time shifting option is selected. This is described in the help documentation: Time Shifting Time Series Data.

If there is annual periodicity in your time series data (as the case would be with weather data) and you have selected either (1) to use a random starting point with annual periodicity, or (2) to shift data years to align with simulation dates, it is recommended that the ending day and month (e.g. January 1) in your time series data match the starting day and month in the data. If, instead, the time series data starts on, say, 1 January 2020 and ends on 31 December 2025, the first year of data in the time series may be skipped when wrapping occurs. This is illustrated in the example model TimeSeriesWrapping.gsm.

This behavior is not considered a bug, but rather a consequence of the way in which GoldSim locates an appropriate date at the beginning of the time series to "wrap" back to. If, for example, the data ends on the 31st day of December, GoldSim does not simply look for the first January 1 in the Time Series. While this seems logical, GoldSim cannot do it this way, programmatically, because datetimes are not represented under the hood as calendar dates. Rather, they are represented as Julian dates (i.e. the number of days from a reference date, such as 30 December 1899, in the case of GoldSim) in units of seconds.

To find the start of the time series data, GoldSim steps backward in time in intervals of 365.25 days (the average length of a year) in units of seconds until it first encounters a date that is earlier than the first date in the Time Series. Then, it steps back forward by a full 365.25 day interval and uses data starting at that time point. Depending on where leap years fall in the data, the first date encountered (in this process of stepping backward) that is earlier than the first entry in the Time Series might be just barely before the first date. In this case, when GoldSim steps back forward, the date at which it resumes using data could be almost an entire year into the data set.

In the attached example model (results shown in the screenshot above), the first Time Series goes from 1 Jan 2020 through 31 Dec 2025. The second has an extra day at the beginning (i.e. 31 Dec 2019) and the third has an extra day at the end (i.e. 1 Jan 2026). Note that the second and third examples give the desired results, while the first does not. Technically, the first series is 1 day short of a full 6 years. To make this more explicit, the date entry in each row of the Time Series could be thought of as the midnight at the start of that day. With this interpretation, the last entry (31 Dec 2025) is midnight at the start of the 31st day of December. In order to capture the entire last day of December, it requires one more entry, on 1 Jan 2026, which corresponds to the end of the 31st day of December and the beginning of 1 January 2026.

Download the Model File:

## Comments

0 comments

Please sign in to leave a comment.