You are here

Working with external data : Specifying time series

The File Parameters dialogue will contain entry fields for both fixed and variable parameters. Fixed parameters must be given a value; their captions in the dialogue will be shown in red until a correctly formatted value has been supplied. Variable parameters do not need a value, and can be left empty, so the value can be set by a slider while running the model. However, it is possible to enter a time series in the File Parameters dialogue, which will cause the variable parameter's value to be set at a series of specified time points while the model is running. You would normally set up the time series using the table data dialogue, but the direct method is described here to clarify the analogy with setting values for an array.

Entry format

The format for entering a time series is the same as for a one-dimensional array, except time points are given instead of indices. The time points can be REAL values, and do not have to be at regular intervals. Data for time point zero is loaded whenever the model is reset. So, to set a value five times between time 0 and time 100, the entry might look like this: 0 12 20 11 40 8 60 7 80 9

If the value to be set is an array, the data must specify a multi-dimensional array, with the time points as the outermost indices.

Special indices and values

The data for a time series can include various combinations of special index and value, which affect how the numerical data is interpreted:

  • Data at time point NOW is loaded into the model as soon as the File Parameters dialogue is closed, and then not used again. Wiggling a slider effectively sets data at time point NOW.
  • For time point OTHERS, you do not enter a value; instead, you enter one of the special values use_last, use_closest or interpolate. These select the different methods for getting a value when the time is not exactly equal to one of the indices in the series. use_last specifies the default behaviour; each value stays in the model until the next time point is reached. use_closest causes the value to change midway between the two specified time points, while interpolate means the value changes continuously and linearly between one specified time point and the next.
  • The INTERVAL time point allows you to supply a time unit which applies to the other indices. This can be useful if you have files containing time series data with the times specified in different units. For instance, if the supply the following data for a time series: 1 3.2 2 4.5 3 6.3 INTERVAL week ...then unless the time unit for model execution is set to something other than day, the variable will change value at times 7, 14 and 21. The time unit can be anything that Simile understands, e.g., ms.
  • There is also another special value, restart, which has a normal numerical time point as its index; this specifies a time at which the model starts reusing values at the beginning of the time series, starting with time 0. The value will then follow a regular pattern, whose period is the time index of the restart value. The time for restart must be the last in the sequence.

Example: rough approximation of sinusoidal variation with period 100 time units:

0 0 12.5 0.7 25 1 37.5 0.7 62.5 -0.7 75 -1 87.5 -0.7 OTHERS interpolate 100 restart

When entering time series values in the table data dialogue, there are special buttons to get these behaviours by setting the special indices and values.

In: Contents >> Working with external data >> The file parameter dialogue