December 23, 2015

Time Series: Modeling Changing Amounts Over Periods

Posted by Jason Lillywhite

A common modeling requirement in GoldSim is to represent movement of (or changes in) amounts of material over time intervals. Common examples we have seen from our users are flows through a pipe, site runoff, and rainfall amounts. Representing this type of data can be challenging if you are not used to GoldSim's way of explicitly defining data in the Time Series element. I think a reason for this is due to our familiarity with spreadsheets, which do not require explicitly defining how the data is represented.

One of the most important differences between a dynamic simulation tool (like GoldSim) and a spreadsheet is how the tool deals with the concept of time. Although spreadsheets do recognize dates, time is not explicitly defined inside the internal workings of the program. On the other hand, GoldSim has some very specific rules on how data is entered and represented so that there is no ambiguity at all as to what the values mean as time progresses during the simulation.

This article describes how using the "Change over previous time interval" representation in the Time Series element makes it very easy and straightforward to represent changes in amounts over time periods. I will use an example of a simple water management model to demonstrate the use of this type of time series data. For the past year, let's assume that we have been recording runoff flows from a mine site using a flow gage in a stormwater pipe. Each month, we read and record the total flow in units of ML (megaliters) in our log book then reset the totalizer on the flow gage so that it will continue recording the flow for the next month. We repeat this process 12 times during the year, coming back on the first day of each month to log the data in our log book. The data from our log book is finally presented at the end of the year in the table below.

Date Runoff [ML per month]
2/1/2015 21.87
3/1/2015 33.22
4/1/2015 40.90
5/1/2015 55.76
6/1/2015 90.11
7/1/2015 12.39
8/1/2015 4.09
9/1/2015 1.63
10/1/2015 9.88
11/1/2015 15.71
12/1/2015 11.63
1/1/2016 19.68

It should be noted that the column heading "Runoff [ML per month]" is very misleading. The reason for this is because it is unclear what we mean by "month". It could indicate a calendar month or an average month (30.4375 days). In reality, these values represent the flow during each calendar month interval. On March 1, we recorded 33.22 ML, which is equivalent to 33.22 ML/(28 days) and NOT 33.22 ML/mon, where "mon" is an average month that means 30.4375 days. To avoid confusion, we should change the label so that the table appears as follows.

Date Cumulative Runoff [ML]
2/1/2015 21.87
3/1/2015 33.22
4/1/2015 40.90
5/1/2015 55.76
6/1/2015 90.11
7/1/2015 12.39
8/1/2015 4.09
9/1/2015 1.63
10/1/2015 9.88
11/1/2015 15.71
12/1/2015 11.63
1/1/2016 19.68

This data is entered in a time series element. Since these amounts represent the accumulation of water over each calendar month, we choose the "Change over previous time interval" for the Represents field as shown.

We run the GoldSim model using a daily time step for a duration of 1 calendar year starting 1/1/2015 thru 1/1/2016. A time history plot of the time series output is shown below.

While it might be useful for reporting purposes to see the accumulation of runoff during the entire year, it does not show us the instantaneous flow rate, which is what we need in order to build our water management model. GoldSim provides a very easy way to output the rate of change from a time series. This is done by expanding the properties dialog of the time series. and enabling the rate of change output.

Adding this output to our plot yields a view of both the cumulative and instantaneous flow for each period.

When looking at the tabular view of the data, we find that the flows are shown in terms of ML/day.

Changing the display unit for the rate of change to "ML/mon" would not be comparable to the intput data because "mon" is an average month. What we can do is enable reporting periods so that values are reported to us on a calendar basis.

This type of chart setting will show us the incremental change over each period, which is comparable to the input data we recorded in our log book.

What is nice about this approach to time series is that we didn't have to derive a single expression in GoldSim to enable us to view the data in many different ways. The important thing is to make sure the time series is defined in a way that correctly represents the data you put into the model. Once this step is done, you will find the data very easy to work with.

To learn more about how to represent data in time series elements, we recommend that you click on the "Help" button from within the Time Series element to see the Help documentation for time series. Also, GoldSim ships with an example that you can open from within GoldSim. Go to File, Open Example... then navigate to the "General Examples\TimeSeries" folder and open the file called "TimeSeries_Basic.gsm".

No comments:

Post a Comment