# Cycle-time Functions

### CTFLOW
CTMAX
CTMEAN
CTMIN
CTSTDDEV
CYCLETIME
THROUGHPUT

Imagine that you and three of your colleagues are asked to run an obstacle course. You start at 1:00 PM, and complete the course at 1:35 PM. The first of your colleagues begins at 1:05 PM, and completes the course at 1:42 PM. The second colleague begins at 1:10 PM, and, being somewhat more athletic than you, completes the course at 1:35. The third starts at 1:15 PM, gets stuck somewhere, and exits the course at 2:15 PM. Because you know the start and completion time for each person (or batch) in the group, it's possible to calculate a variety of useful cycle-time metrics.

The cycle-time functions work in an analogous fashion. They rely on the time-stamping of flows at some point in a conserved-flow process, either on the Map/Model level or within a Sub-model space. Downstream, flows can subsequently provide this time-stamping information to the Builtins, which in turn will calculate metrics regarding the time that material has spent in process, since it was last time-stamped. Figure 7-9 provides an overview of how to introduce cycle-time metrics into your models. In the Cycle-time Chapter, you'll find several examples of cycle-time configurations.

Figure 7-9 An Overview of Cycle-time Capabilities

As suggested by the diagram, the procedure associated with making a cycle-time calculation is straightforward. First, time-stamp a flow (or a set of flows) at some point in a stock/flow chain (to time-stamp a flow, check the check box next to the small stopwatch in the flow's dialog). Then, determine from which flow, downstream in the same stock/flow chain, you wish to calculate the cycle-time metric(s). Use a connector and a converter to tap into the downstream flow. Then, define the converter using the appropriate cycle-time Builtin.

The cycle-time Builtins are accessible only within converter dialogs, when a connection runs from a downstream flow to the converter, and one or more upstream flows have been time-stamped. The resultant cycle-time calculations apply only to the material coming from those upstream flows which have been time-stamped. Whenever the material gets time-stamped at more than one flow within a chain of stocks and flows, the downstream cycle-time calculation will be based on the most recent time-stamping. When multiple inflows enter a conserved flow chain, cycle-time calculations will be based on all flows which have been time-stamped. Figure 7-10 shows these rules in graphical form. The text which follows details the capability of each cycle-time function.

Figure 7-10 Rules of Cycle-time -- Multiple Flows

#####
CTFLOW(<flow>[,<initial>])

The CTFLOW function returns the volume of flow associated with time-stamped batches of material moving through the flow. CTFLOW can be important to report when, in a conserved flow chain, flows which have been time-stamped are mixed with flows which have not been time-stamped. When this mixing occurs, the resulting downstream flow volume will be greater than the volume of flow used for cycle-time calculations. CTFLOW will tell you how much of the flow volume has been time-stamped, and thus is being used for cycle-time purposes.

The optional initial parameter will allow you to provide an initial volume for the associated flow. If initial is not specified, CTFLOW will return a zero for the initial value.

When you are operating in the Normal simulation mode (in the Time Specs dialog, under the Run menu), or when time stamping has been turned off for all upstream flows in a conserved flow chain, CTFLOW will return a zero. Any initial values of material in a conserved stock/flow chain will not be time-stamped, and hence will not be used for cycle-time purposes.

Example:

In Figure 7-11, the converter time stamped flow volume calculates the time-stamped flow volume associated with stuff that is moving through the flow exit process 2.

Figure 7-11 Illustrating the Use of the CTFLOW Builtin

#####
CTMAX(<flow>[,<initial>, <instantaneous>])

The CTMAX function returns the maximum cycle-time associated with time-stamped batches of material moving through a flow. CTMAX will operate in one of two distinct modes, depending upon whether the optional instantaneous argument is set to 1. When instantaneous is not specified (or set to zero), CTMAX will return the maximum cycle time associated with time-stamped batches of material which have moved through a flow, over the course of a simulation. When instantaneous is set to 1, CTMAX will return the maximum cycle-time associated with time-stamped material which is currently moving through the flow.

The optional initial parameter is applicable only when instantaneous is not specified (or set to zero). In this case, the initial value will be the value that is returned by the function until the time-stamped portion of the flow volume becomes positive. If initial is not specified, CTMAX will return a zero until the time-stamped portion of the flow volume is positive.

CTMAX becomes particularly relevant when more than one time-stamped flow enters a conserved flow chain, or when different batches get mixed together somewhere in a process (for example, in a Conveyor with variable transit time). In either case, material with different time-stamps can exit the process simultaneously. CTMAX will provide you with the maximum cycle-time associated with stuff which is moving through the flow.

When you are operating in the Normal simulation mode (in the Time Specs dialog, under the Run menu), or when time stamping has been turned off for all upstream flows in a conserved flow chain, CTMAX will return a zero. Any initial values of material in a conserved stock/flow chain will not be time-stamped, and hence will not be used for cycle-time purposes. When operating in its instantaneous mode, CTMAX will return a zero when the time-stamped portion of the flow volume is zero.

Example:

In Figure 7-12, the converter overall max cycle time calculates the maximum cycle-time of the stuff which is moving through the flow exit process, over the course of the simulation. The converter instantaneous max cycle time calculates the maximum cycle-time of the batches which are currently moving through exit process. Note that time-stamped batches enter the process at two entry points, and that the conveyors in the process each have variable transit times.

Figure 7-12 Illustrating the Use of the CTMAX Builtin

#####
CTMEAN(<flow>[,<initial>,<weighted>])

The CTMEAN function returns the cumulative average cycle-time, since the start of a run, associated with the time-stamped portion of the flow of material moving through a conserved flow chain. CTMEAN will perform its cumulative average cycle-time calculation in one of two distinct ways, depending upon whether the optional weighted argument is set to 1.

When weighted is not specified, CTMEAN calculates the algebraic (i.e., per batch) cycle-time, over the course of the simulation. When weighted is not specified, the CTMEAN calculation thus is independent of the volume of the time-stamped flow. Consider a simulation in which two batches pass through a process. The first has a volume of 10 and a cycle-time of 1, while the second has a volume of 2 and a cycle-time of 5. If weighted is not specified, the resultant CTMEAN calculation is:

(1 + 5) / 2 = 3 (time units per batch)

On the other hand, when the optional argument weighted is set to 1, the resultant cycle-time calculation will be weighted by the magnitude of the flow volumes. Thus, the weighted CTMEAN calculation provides a metric of the cycle time per unit of flow volume. Using the same two batches, a weighted CTMEAN calculation would give:

(10 * 1 + 2 *5) / (10 + 2) = 1.67 (time units per unit volume)

The optional initial value is the value that is returned by the Builtin function until the time that the time-stamped flow volume first becomes positive. When the initial value is not specified, the Builtin will initially return a 0. Specifying an initial value is useful when initializing a continuous system to steady-state.

When you are operating in the Normal simulation mode (in the Time Specs dialog, under the Run menu), or when time stamping has been turned off for all upstream flows in a conserved flow chain, CTMEAN will return a zero. Initial values of material in a conserved stock/flow chain will not be time-stamped, and hence will not be used for cycle-time purposes.

Example:

In Figure 7-13, the converter mean per batch cycle time calculates the cumulative average cycle-time (i.e., the average time per batch, since the start of the simulation run, spent in Process 1 and Process 2) for material which has entered the Process 1 stock through the flow enter process 1. mean per unit volume cycle time calculates the cumulative average cycle-time on a unit volume basis. Both calculations initially return a value of 10.

Figure 7-13 Illustrating the Use of the CTMEAN Builtin

#####
CTMIN(<flow>[,<initial>,<instantaneous>])

The CTMIN function returns the minimum cycle-time associated with time-stamped batches of material moving through a flow. CTMIN will operate in one of two distinct modes, depending upon whether the optional instantaneous argument is set to 1. When instantaneous is not specified, CTMIN will return the minimum cycle time associated with time-stamped batches of material which have moved through a flow, over the course of a simulation. When instantaneous is set to 1, CTMIN will return the minimum cycle time associated with time-stamped material which is currently moving through the flow.

The optional initial parameter is applicable only when instantaneous is not specified (or set to zero). In this case, the initial value will be the value that is returned by the function until the time-stamped flow volume becomes positive. If initial is not specified, CTMIN will return a zero until the time-stamped portion of the flow volume is positive.

CTMIN becomes particularly relevant when more than one time-stamped flow enters a conserved flow chain, or when different batches get mixed together somewhere in a process (for example, in a Conveyor with variable transit time). In either case, material with different time-stamps can exit the process simultaneously. CTMIN will provide you with the minimum cycle-time associated with stuff which is moving through the flow.

When you are operating in the Normal simulation mode (in the Time Specs dialog, under the Run menu), or when time stamping has been turned off for all upstream flows in a conserved flow chain, CTMIN will return a zero. Any initial values of material in a conserved stock/flow chain will not be time-stamped, and hence will not be used for cycle-time purposes. When operating in its instantaneous mode, CTMIN will return a zero when the time-stamped portion of the flow volume is zero.

Example:

In Figure 7-14, the converter overall min cycle time calculates the minimum cycle-time of the stuff which is moving through the flow exit process, over the course of the simulation. The converter instantaneous min cycle time calculates the minimum cycle-time of the batches which are currently moving through exit process. Note that time-stamped batches enter the process at two entry points, and that the conveyors in the process each have variable transit times.

Figure 7-14 Illustrating the Use of the CTMIN Builtin

#####
CTSTDDEV(<flow>[,<weighted>,<initial>])

The CTSTDDEV function returns the standard deviation in cycle-times, since the start of the simulation run, associated with time-stamped material moving through the flow. Only non-zero cycle-times are used for the CTSTDDEV calculation. The calculation assumes that cycle-times are normally distributed. When two or more time-stamped batches move simultanously through a flow, the software uses the average cycle-time in its standard deviation calculation.

The CTSTDDEV function is particularly useful when you want to obtain a measure in the variability of cycle-times, over the course of a simulation. CTSTDDEV performs its calculations in one of two distinct ways, depending upon whether the optional weighted argument is set to 1.

When weighted is not specified, CTSTDDEV calculates an algebraic, non-weighted metric of standard deviation. This metric is independent of the magnitude of time-stamped flow volume. It looks only at the cycle-time associated with the material moving through the flow. In this sense, the non-weighted CTSTDDEV provides you with a measure of the per-batch variability in cycle-times.

On the other hand, when the weighted argument is set to a value of 1, CTSTDDEV weights its calculations by the magnitude of time-stamped flow volumes. Thus, the weighted CTSTDDEV calculation provides a metric of the variability in cycle time per unit volume.

The optional initial parameter will allow you to provide an initial value for the standard deviation of the cycle-time. This initial value will be returned until the first time-stamped units pass through the flow. If no initial value is specified, CTSTDDEV will return a zero until the time-stamped portion of the flow volume is positive.

When you are operating in the Normal simulation mode (in the Time Specs dialog, under the Run menu), or when time stamping has been turned off for all upstream flows in a conserved flow chain, CTSTDDEV will return a zero. Any initial values of material in a conserved stock/flow chain will not be time-stamped, and hence will not be used for cycle-time purposes.

Note: Because the average cycle-time of material moving through a flow is used in the standard deviation calculation, the standard deviation reported by the CTSTDDEV builtin may vary slightly from a distribution set upstream.

#####
CYCLETIME(<flow>[,<weighted>,<initial>])

The CYCLETIME function returns the cycle-time associated with time-stamped batches of material moving through the flow. CYCLETIME thus tells you how much time material has spent "in process," since it was last time-stamped. Whenever more than a single time-stamped flow enters a conserved flow chain, or when different batches get mixed together somewhere in a process (for example, in a Conveyor with variable transit time), material with different time-stamps can exit the process simultaneously. In these cases, what's returned by CYCLETIME will depend upon whether you have specified the optional weighted argument to a value of 1.

When weighted is not specified, the CYCLETIME Builtin returns a simple algebraic measure of cycle-time. This measure can be thought of as a per batch metric for cycle-time, since it is independent of the volume of time-stamped flow, whenever material with different time-stamps simultaneously moves through the flow. Consider a simulation in which two batches exit a process simultaneously. The first has a volume of 10 and a cycle-time of 6. The second has a volume of 100 and a cycle-time of 50. If weighted is not specified, the CYCLETIME calculation would result in a value of:

(6 + 50) / 2 = 28 (time units per batch)

On the other hand, when the optional argument weighted is set to 1, the CYCLETIME Builtin will weight its calculation by the magnitude of the respective flow volumes in the combined batch. Thus, the weighted CYCLETIME calculation provides a metric of the cycle-time per unit of flow volume. Using the same two batches, a weighted CYCLETIME calculation would give:

(10 *6 + 100 * 50) / (10 + 100) = 46 (time units per unit volume)

The optional initial parameter will allow you to provide an initial value for the cycle-time. This initial value will be returned until the first time-stamped units pass through the flow. If no initial value is specified, CYCLETIME will return a zero until the time-stamped portion of the flow volume is positive.

When you are operating in the Normal simulation mode (in the Time Specs dialog, under the Run menu), or when time stamping has been turned off for all upstream flows in a conserved flow chain, CYCLETIME will return a zero. Any initial values of material in a conserved stock/flow chain will not be time-stamped, and hence will not be used for cycle-time purposes.

Example:

In Figure 7-15, the converter per batch cycle time calculates the cycle-time (i.e., the average time per batch, spent in Process 1 and Process 2) for material which is currently exiting the process through the flow exit process 2. per unit volume cycle time calculates the cycle-time on a unit volume basis.

Figure 7-15 Illustrating the Use of the CYCLETIME Builtin

#####
THROUGHPUT(<flow>[,<initial>])

The THROUGHPUT function returns the cumulative average throughput (measured in units/time) of the time-stamped flow volume, over the course of the simulation run. THROUGHPUT provides a measure of the average rate of time-stamped flow through the system. THROUGHPUT performs its calculation by summing the time-stamped flow volumes over the course of the simulation, and then dividing this quantity by the current simulation time minus the time that the first time-stamped flow moved through the flow.

When you are operating in the Normal simulation mode (in the Time Specs dialog, under the Run menu), or when time stamping has been turned off for all upstream flows in a conserved flow chain, THROUGHPUT will return a zero. Any initial values of material in a conserved stock/flow chain will not be time-stamped, and hence will not be used for cycle-time purposes. Finally, if you have not specified an optional initial value, THROUGHPUT will return a zero until the time-stamped portion of the flow volume is positive.

Example:

In Figure 7-16, the converter system throughput calculates the average throughput (since the start of the run) of the time-stamped stuff moving through the completion flow. In this case, the throughput calculation provides a metric for the average rate of movement of material (in units/time) through a discrete process. The initial value returned by the converter is 6.

Figure 7-16 Illustrating the Use of the THROUGHPUT Builtin