Initializing Discrete Stocks

Conveyors, Queues (including non-negative stocks when in cycle time mode), and Ovens contain information not only on the quantity of material in them, but also the sequencing, attributes and cycle time of that material. For these type of stocks you can initialize total quantity of material and optionally the distribution of that material within the stock and the attributes and time stamps associated with that material.

Initial Quantities

There are three ways to set initial quantities: as a total, as a sequence of numbers, and as a one dimensional array slice.

Total Quantities

The simplest way to initialize any stock is to specify the total amount of material in the stock. For regular stocks and non-negative stocks that is the only way to do it, because they have no internal structure. For conveyors the material needs to be spread across the internal slats (there is one slat for every DT material is in the conveyor). This is done uniformly or, for conveyors with leakage, in a steady state distribution given the total quantity of material and leakages (so that a constant inflow would generate a constant outflow and leakage).

Note The equilibrium values for a conveyor with 1 leakage are:
Linear leakage: inflow*transit_time*(1-leak_fraction*(transit_time-DT)/transit_time/2)
Exponential leakage: inflow*(1 - (1-leak_fraction*DT)^(transit_time/DT))/leak_fraction

For queues and ovens the assumption is that there is a single batch of material.

Numeric Batch Quantities

Conveyors and Queues can be initialized by specifying a comma (or semicolon if you are using , as the decimal delimited) separated list of numbers such as "1,2,3,4".

For conveyors these value represent the quantity at each time unit. For the first time unit 1 will come out, then 2, then 3, then 4. If, for example, DT is 1/4 then there will be 4 repetitions of each value, with 1/4 of that value coming out every DT.

If you specify more or fewer values than needed for a conveyor the software will truncate or fill in values as required.

For Queues these represent the distinct batches in the queue, They will come out in the order entered (1, then 2, then 3, then 4). If the queue is attached to something that can take multiple batches, they may come out at the same time.

Note You can't use this technique to initialize non-negative stocks when using cycle time.

Arrayed Quantity Specification

Instead of specifying a sequence of numbers, you can specify a 1 dimensional array slice to initialize a discrete stock. This technique will also work for non-negative stocks in cycle time mode. Conceptually it is similar to the numeric batch quantities, but provides more flexibility (for example importing and controlling of values) and more precision. For example, if you have a conveyor of material arrayed by Place you might specify the initial value as

Initial_Quantity[Place,*]

where Initial Quantity is arrayed by Place and Slat and Slat has 4 values (again assuming the conveyor has a transit time of 4). If the values of Initial_Quantity[Place1,*] are 1,2,3,4 then the conveyor will release 1 in the first time unit, 2 in the second and so on.

If you need more granularity, you can make Slate have 16 values - one for every DT of material in the conveyor. In this case the conveyer may release a different amount of material every DT. Using the above example, the value 0.25,0.25,0.25,0.25, 0.5,0.5,0.5,0.5, 0.75,0.75,0.75,0.75, 1,1,1,1 would generate the same results as 1,2,3,4.

For conveyors, the software compares the number of values in the array expression to the number of slats in the conveyor to determine how to use the values. If the conveyor has a non-integer transit time you much specify all of the slats (it is only the initial transit time that matters here). In both causes the total quantity of material in the conveyor is the sum across the array elements specified.

If there is a mismatch between the number of values in the array specified and the number of slats in the conveyor you will get an error message.

Queues can use the same expression form, but there is not expected number of entries, so any number of values can be entered. Each value will represent a batch of material, and again the sum across all values will represent the total amount of material in the stock.

You can also use this approach to specify the initial quantity of material in a nonnegative stock when using the cycle time integration method. This is helpful if you want to give the distinct batches different attribute values or initial cycle time values. If you are not in cycle time mode the sum of the values is used in the initialization.

Partial Ranges and Transit Times

In addition to using a * in the initialization array, it is possible to use the a:b range form. The most common case of this would be:

Initial_Quantity[Place,1:transit_time[Place]]

Initial_Quantity[Place,1:transit_time[Place]/DT]

This can be very helpful when the transit_time values are different for the different array elements. The initial_quantity array has to be big enough to hold all of the elements for the longest value of transit_time, but only a subset of those values will be used for the shorter values of transit_time.

Initial Cycle Time

Cycle time is measured from a time stamped flow, to another flow later in a chain. Since there may be a number of intermediate stocks in the chain, this means that the time stamp of material coming out of a chain will not be defined until a batch that has been stamped completes processing.

When it is useful to report cycle time values earlier, either to measure performance of part of a chain, or simply to have a cleaner presentation of values, you can specify the initial value of cycle time within stocks. Just as with the initialization of the content of the stock, this can be done in aggregate or by batch. In both cases the place this is done is in the optional parameters portion of the Equation Tab on the properties panel.

Single Value

If you specify a single value for the initial cycle time, that value represents the cycle time that will exit the stock at the beginning of the run. As a simple example, suppose that you have two conveyors in a chain with transit times of 3 and 4.

By specifying 3 for the Init Cycle Time for the first conveyor and 4 for the second ct will always report 7.

Conveyors

The initial transit time is the value that will be used when the model starts. Each slat before the first to exit has the associated cycle time decremented by DT so that when the values from the slat do exist they will have the initial cycle time (assuming the transit time has not changed).

Queues (Stocks in cycle time mode)

Every batch in the stock will be given the same time stamp, so material coming out later will report a longer cycle time value. If you have initialized with separately identified batches you may want to also specify separate cycle time values.

Ovens

Ovens can only be initialized with one batch of material, and that batch will be given the cycle time value specified. Since nothing will come out of the oven until the cook time has passed, you may want to subtract the cook time from the initial value. Even through there is only 1 batch, it can be thought of as a composite of batches and the initial cycle time the average for that composite.

Arrayed Initial Cycle Time Values

This can be used for Conveyors, Queues and non-negative stocks when the integration technique is set to cycle time. Just as for initial quantities, you specify a single arrayed variable with a * corresponding to the different batches of material. For example:

will set the cycle time based on the values in the second array position.

The number of elements the * represents needs to exactly match the number if batches or slats in the stock. If you have initialized the material in the stock using an arrayed variable, the * position for the initial Cycle time should be the same. For Queues and non-negative stocks this is the only way to initialize them. For conveyors the number of slats needs to match, whether the conveyor is initialized using an array variable, set of numbers, or a value.

Note that is you are using arrayed cycle time values there will not be any manipulation of them. The values will be used as they are entered for conveyors and queues.

Initial Attributes

The initialization of attribute values works the same as the initialization of cycle time, with the exception that when a single attribute values is specified for conveyors it is applied to all slats in the conveyor.

Error Messages

Total values (e.g. 100)

If you specify an initial value that is smaller than the capacity for a conveyor or oven, and both are numbers, you will get an error message and the variable will be marked invalid. If they are not numbers but variables, the initial value will be decreased to match the capacity, with individual slats scaled accordingly for conveyors.

Numeric values (e.g. 1,2,3,4)

If you specify too many entries for numeric batch quantities when initializing a conveyor with a number for transit time you will get an error message and the variable will be marked invalid. If the transit time is not a number and there are too many entries the later entries will be ignored. If there are too few entries the last entry will be repeated. In each of these cases of mismatch the total quantity (value of the variable) will not be the sum of the numbers.

Arrayed specification (e.g. initq[location,*])

If there is a mismatch in the number of elements, and the expected number you will see a message such as:

or

depending on whether the mismatch is detected during model validation or at run time. In both cases the issue is that the number of slats or batches does not match what is specified.

For conveyors: If the transit time is an integer you can specify a number of values equal to the transit time, or the transit time divided by DT when initialing quantity. For initializing the attribute value or cycle time, or if transit time is not an integer, the number of values must equal the transit time divided by DT.

For queues and non-negative stocks the number of elements for all the initial values (quantity, attribute, cycle time) must match.