Category: Experiment # syClock

Defines simulation time, timestep length, and number of realizations.

## Syntax

`syClock([NoOfRealizations], [TimeEnd], [TimeStart], [TimeInterval])`

The syClock function syntax has the following arguments:

• NoOfRealizations: optional. The number of realizations to run, 1 if ommited.
• TimeEnd: optional. The end of simulation time, 0 if ommited.
• TimeStart: optional. Start of simulation time, 0 if ommited.
• TimeInterval: optional. Time interval in units of time that represents time difference between two timesteps, 1 if ommited.

Return value is current simulation time.

## Remarks

Time and realization settings are crucial for every model. syClock defines how frequently in simulated time will Spry collect the data, and how many times will Spry repeat the model execution. Besides this, rates of change and other elements of the model depend from these time definitions.

In Monte Carlo simulation models (models that have at least one random element or variable), it is prudent to execute as much simulation runs as possible to get reliable outcomes. This can be set with NoOfRealizations which defines the number of realizations. While building and testing the model's structure, we conveniently set NoOfRealizations to 1 to avoid unnecessary computations. When model is done and we are doing the experiments, this parameter should be set to appropriate higher value.

If you have a dynamic model, the simulation time (for instance 12 hours, 365 days, 12 years) can be set with TimeEnd argument. Without setting the TimeStart, the simulation starts to run at 0 (zero time) to TimeEnd. TimeStart and TimeEnd can be negative. TimeEnd should of course be greater (that means later) than TimeStart. If they are equal, the simulation is static, the time is "frozen" in one moment and Spry collects data only once per each realization.

Excel doesn't support units of measure, so the syClock respects the assumed unit of measure. For instance, TimeStart = 1 and TimeEnd = 5 means that the simulation will run from time = 1 until time = 5, regardless of the time units that can be interpreted as seconds, hours, weeks, years ...

NOTE: Many Spry elements depend from time dimension (e.g. rates of change, number of arrivals), so the assumed time unit is very important for the interpretation of the results. Let's say that the assumed time unit is an hour. Rates of change, arrival frequencies and other simulation parameters in your model are then understood according to this same unit - for instance 5 items per hour, 10 arrivals per hour, and not 5 items per minute, 10 arrivals per day.

When simulation is running and TimeInterval equals 1 (default value), Spry stops at the end of each time unit (for instance at the end of each simulated hour), collects data and continues with the model execution. Data collection is also done at the very beginning of the simulation time. However, if you would like to collect the data more frequently, this can be done by shorter TimeInterval. For instance, if the assumed time unit is an hour and you'd like to collect data at the end of each minute, set the TimeInterval to 1/60 (one hour divided by 60). If TimeInterval is greater than 1, Spry will perform data colleciton less frequently, for instance with TimeInterval = 3 every third hour. Default TimeInterval is 1.

NOTE: Simulation model can have only one syClock element. If there are more, Spry declares only one of them as valid, others evaluate to #N/A during simulation.

## Examples

• `syClock(1,365)` - Spry will run the model once. Simulation time will start at 0 and continue until the end of the 365th time unit (if the assumed time unit is a day, the simulated time is thus 1 year). At the end of experiment, Spry will provide the data for 365 - 0 + 1 = 366 moments in time.
A B C
1 =syClock(1,365)
2
• `syClock(10,12,,1/60)` - Spry will execute ten realizations of the model. Simulation time starts at 0 and continues until the end of the 12th time unit. if we assume that the time unit is an hour, the simulated time is half of a day. At the end of experiment, Spry will provide the data for (12 - 0) / (1 / 60) + 1 = 721 moments in time, for each realization.