This example illustrates the use of a Time Series where the input data represent constant values over specified intervals. That is, the data "stair-steps" from interval to interval. In some instances, this may reflect the fact that the variable actually is held constant over each interval. In other cases, it may be an artifact of how the data was recorded (e.g., it may have only been recorded in terms of an average value over the interval).
The example can be viewed in the file named BasicTimeSeries.gsm, which can be found in the TimeSeries subfolder of the General Examples folder in your GoldSim directory (accessed by selecting File | Open Example... from the main menu).
In this example, the input data represent the average temperature over specified time periods:
The actual data set looks like this:
The Primary Output is computed by assuming that the specified values stay constant over the time intervals between data points. That is, GoldSim does not interpolate between the data points. Hence, in this example, between 59 and 90 days, the temperature is assumed to be constant at 10.2 C.
Note: There are two options for representing time series that represent constant values over specified intervals. You can specify that the data is constant over the next interval (as specified above), or you can specify that the data is constant over the previous interval. In the latter case, the data set shown above would imply that between 59 and 90 days, the temperature is assumed to be constant at 12.1 C. (In order for the two representations to provide the same results, you would need to shift the data column by one row.)
The Primary Output and the Rate_of_Change outputs for this particular example are shown below:
In this example, the Rate_of_Change output is also computed, although for this type of input data (constant values over intervals), this would typically not be done. The Rate_of_Change is computed by differentiating the Values. Because the value is assumed to remain constant between data points, and then jumps discontinuously, the Rate is zero between data points, and then “spikes” when the Value changes. Theoretically, the derivative at this point is infinite (the curve is a vertical line). GoldSim computes the derivative as the difference between values divided by the timestep length. As such, the Rate_of_Change is somewhat arbitrary. Note, however, that due to the way the Rate_of_Change is computed, if you were to integrate this, it would correctly reproduce the Primary Output.
Note: If the data is specified to represent a "Constant value over the next interval", the first data point must be at or before the beginning of the simulation. That is, if you have specified time entries as elapsed times, the first data point must be less than or equal to zero. If you have specified time entries as dates, the first date must be at or before the start time for the simulation. Similarly, if the data is specified to represent a "Constant value over the previous interval", the last data point must be at or beyond the end of the simulation. That is, if you have specified time entries as elapsed times, the last data point must be greater than the simulation duration. If you have specified time entries as dates, the last date must be at or after the end time for the simulation.