Question - Delays with variable Delay Times

Use this forum to post Vensim related questions.
Post Reply
Mattes_01
Member
Posts: 42
Joined: Mon Jul 05, 2010 6:05 am

Question - Delays with variable Delay Times

Post by Mattes_01 »

Hi@all.

I got a question about the built in functions like "Delay Fixed" and "Delay N" etc.

When I am having a delay with variable delay time will the delay function make a snapshot at t_0, take the input value (e.g. input = 100 tons, dtime = 2 weeks) and then let the 100 tons go through the delay with this fixed delay time 2 weeks. That means it will take on every time step the actual input value (input(t*)) and the respective delay time (dtime(t*)) and then calculate the output of the delay to an impulse with this input(t*) and the dtime(t*)?

That means that the change of delay time doesn't effect events from the past or future, only the actual input value at t*?

And in the end all outputs are just summarized over time.

Is that correct?
I was thinking if it is possible to realize a delay which looks similar to a third order delay with a pipeline delay only. I thought by using a variable time delay, which is varying around the delay time d* combined with a pipeline delay should be able to give me similar results as a third order (or whatever order, edpends on the variance etc of the delay time) delay.
Or is that only possible if I am calculating a "discrete" terial flow, where e.g. 1.000.000 screws are being produced per hour and I can give any single screw a different delay time?

But that would mean that I need enough material throughput per time step to see this effect.

I hope I described it clearly so you guys can understand.
If not let me know and I will give an example.

Best regards from germany so far.
Matthias
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

DELAY FIXED has a fixed delay time so no question arises.

DELAY MATERIAL, DELAY INFORMATION and DELAY PROFILE use the delay time that is computed at the time the material or information enters the delay process.

DELAY CONVEYOR uses the delay time that is currently computed to determine how far back to draw material from.

DELAY N, DELAY3, SMOOTH, SMOOTH N and so on are all implemented as aging chains which means the material or information being delayed has a erlang distribution of residence time with the average given by the delay time. This is like DELAY CONVEYOR in the sense that changes to the current delay time influences the outflow of material/information from all previous times - but it is not the same as saying that the average residence time of everything exactly matches the current delay time (or perhaps it is, my intuition is a little fuzzy on this one). Unlike the previous categories material/information is permitted to pass in these functions (not FIFO).

If you want real tight control over the delay process consider the QUEUE FIFO function.
Mattes_01
Member
Posts: 42
Joined: Mon Jul 05, 2010 6:05 am

Post by Mattes_01 »

OK, actually I was searching for something like "Delay Conveyor".

I will try to get the edsired results using a "delay n" with a high order and varying delay times first.

Actually I was searching for a discrete function, which is able to calculate in discrete objects, such as screws (or another example cars).
If I use the normal Vensim functions, I will get things like 0.3 Cars and so on.

By the way, ís Vensim able to calculate in this discrete objects?
I mean like a queue with people?

Or is there no special function for that and I need to discretize the inputs and so on?

Thank you very much
Mattes_01
Member
Posts: 42
Joined: Mon Jul 05, 2010 6:05 am

Post by Mattes_01 »

Let me try to explain it further:

Lets say I start the production of 100 engine blocks which are each milled out of one solid metal block.

I have a varying delay time for this production which means a mean value with some variation.

So when I put this 100 blocks into "DELAY FIXED" or "DELAY CONVEYOR" after a certain time all 100 will be output as a batch of 100 items.
In real life some of them may be finished after 10 days, other may take a bit longer e.g. 12 days and some may even take up 20 days to produce.

Is it somehow possible to model something like this? But in discrete objects?
I mean I can model it with a "DELAY 3" distribution, but I will then loose my discrete objects (lets say at the 12th day the process will finish 1.8 engine blocks).

Best regards and thank you for your help.
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

If the production process is FIFO you can use the QUEUE FIFO functions and only take out integer amounts via the outflow.

As an alternative you can take the outflow of any delay process and split the integer and remainder part putting the remainder in a level for the next TIME STEP (this assumes Euler/Difference integration since it will be a discontinuous solution) eg

stuff output = INTEGER(stuff from a delay process + stuff at the ready/TIME STEP) ~ Widget/Month
stuff at the ready = INTEG(stuff from a delay process - stuff output,0) ~ Widget

In general, I find that keeping integer units of things make a model more complicated without significantly changing the dynamics. You might consider relaxing the integer constraint and focusing on the feedback dynamics then perhaps adjusting things for presentation purposes.
Mattes_01
Member
Posts: 42
Joined: Mon Jul 05, 2010 6:05 am

Post by Mattes_01 »

Dear Bob,

first thank you again for you effort!

The reason why I am asking is I am spending time with the book "Dynamic Modeling for Business Management" from McGarvey and Hannon.
They provide a different approach for modeling workflow processes modeling them with dicrete units (which corresponds to the first part of the process which I am modeling at the moment, where we only have discrete items).

They model the processes with arrival rates and service rates. Especially interesting is the part where they come to talk about the "traffic intensity", which is the ratio between the service rate and the arrival rate. Lety say we have a traffic intensity of "1", which means that in general we have a production capacity utilization of 100%. If there is only small variations (noise) in the arrival or service rates the backlog increases significantly (as far as it only can grow positively).
I don't think this effect will be clearly visible when modeling items contiuously.

And as far as my company is having a license for the Vensim Professional version it would be nice to model exactly this in Vensim.

By the way, in this book they use the software iThink from ISEE, which proveides this kind of modeling (in discrete numbers of items).

So if I get you correctly, there are no functions availiable by which I can do that except when modeling it in the way you provided above.

Let me think about it and try to implement it in the way you provided and I will come back to you.

Best regards from germany.
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

Actually the process you just described (growing backlog when mean capacity is lower than the mean arrival rate) will show up in continuous units the same way it shows up with discrete units.

What you describe is a FIFO process and the queue functions will work correctly for that.

However, the insight you describe is available with no random process at all

backlog=INTEG(orders-production,initial backlog)
orders = 5
production = 4
Mattes_01
Member
Posts: 42
Joined: Mon Jul 05, 2010 6:05 am

Post by Mattes_01 »

Yes you are correct, in this case you are right.

But in real life the order arrival rate will somewhat fluctuate around a mean value.

Let us assume that the mean value of the arrival rate is about 9 orders/week.
The production capacity is in the mean around 10 orders/week (so the traffic intensity is about 90%).

Let there be an fluctuation around +/- 3 orders per week in the arrival rate.

If the arrival rate is lower than 10 and the queue in front of the process is empty, there will be capacity without allocation -> the productions stands still.
If the arrival rate is about 11 and the que is empty, the queue will fill up, we are having more orders than we can process.

There are nice examples in the book, mentioned by me above, which describe this.

And as far as I understand the issue, the effect will show up more clearly when talking about discrete orders. We can only fill up 1 (or two, any integer) order per time and not 0.5 orders, which we can do in the other case.

But this sounds quite interesting, I will write a simulation in Vensim for that and have a closer look on the impact in this simple case.
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

Actually, my guess is that to look at the frequency and intensity of queuing with different arrival variance you would learn lots more using continuous units both for the arrivals and the processing (eg truncated normal rather than Poisson arrivals). For example in SyntheSim you would a continuous evolution of the queue profiles as the variance is changed. It seems like this would be a great way to build intuition around system behavior.
Mattes_01
Member
Posts: 42
Joined: Mon Jul 05, 2010 6:05 am

Post by Mattes_01 »

Dear Bob,
sorry to disturb you guys, but I am having a problem which I am somehow not ablte to explain.

See the attached model.

In this model I did exactly what I described above:
I am having a process with capacity 1 (actually 1.01 because of the rounding errors) and I only hand through discrete items (always 1).
The bottleneck is the queue which is the most important part in this model.
I tried to ebserve what happens to the queue when varying the arrival transit time a little bit when the process is stationary and the completing transittime equals the mean of the arriving transittime.

What I observed is that the model is quite sensitive to changes in the time step size.

For some values of time step the queue is loading up and grewing infinitely and for others it is limited. But I can't see any relation between the time step and the queue, maybe some of you guys know what I am doing wrong or maybe is able to explain this effect.

EDIT: By the way, all stocks have an initial value of zero, except the "supply of work", so the lookup functions for the delay conveyor and the queue fifo is arbitrary.

EDIT2: The models purpose is to do some research on the effect when the mean value of the arrival rate and the mean value of the service rate is the same but there is some variation. Because the queue cannot grow negative it only can load up, which it is doing over here.

Thanks a lot!
Mattes

[Edited on 9-15-2010 by Mattes_01]

[Edited on 9-15-2010 by Mattes_01]
Attachments
Test Model.mdl
(6.7 KiB) Downloaded 247 times
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

First, of course, you do not have units of measure on anything and that is key to both understanding and correcting model formulations.

Here is the model fixed up with units of measure and terminology changes so that it more seems understandable. The model seems to behave in a reasonable manner.
Attachments
FunnyQueue.mdl
(8.1 KiB) Downloaded 236 times
Mattes_01
Member
Posts: 42
Joined: Mon Jul 05, 2010 6:05 am

Post by Mattes_01 »

Dear Bob,
yes you are right to include all this small things but this was only a sketch to do some research on certain effects. Next time I will provide a model with all these small things which makes the models easier to understand.

You did some basic changes on the model:
First of all my intention is to hand through one item per time unit. I mean when I start a process on a certain item, for example, I will be able to start this process within one time step, so I have to move (when there is capacity to move) one whole item, thats why the flows "flow to work control" and "flow to work process" have to be divided by "time step".

When doing that please have a look at the queue and simulate the model with Lamda = 1, Variation in Lamda = 0.15, Mu = 1, Variation in Mu = 0 and the following set of time steps:
[0.0875, 0.2, 0.225, 0.2875, 0.3, 0.4]

What you will be able to see is that, although there is the same variation in the arrival rate of the materials, the queue will load up and grew infinitely for certain time steps (a grewing queue can be observed for Time Step = [0.0875, 0.225, 0.3]). But for time steps in between the queue will not.

My question is now whether this a numeric failure or what might be the reason for this effect.
Maybe you have an idea about this.

Thank you very much for your support!
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

The model I posted has all of the same settings you have and when run at the time steps you suggest (not powers of 1/2 by the way) the queue varies between 0 and 2. The queue is not all an integer - this is because the conveyors with changing times will not always output integer units. However, any deviation from an integer value is generally corrected pretty quickly (less so for big time steps). Note that in the model I posted the transfer quantum is set to 1 which is what you want.

If the model you sent has different behavior there must be a formulation flaw (eg divide by TIME STEP where there should have been a multiplication). It can be hard to find these when there are not units of measure.
Mattes_01
Member
Posts: 42
Joined: Mon Jul 05, 2010 6:05 am

Post by Mattes_01 »

Dear Bob,

I updated your model, find it attached.

What I did:
- I updated the "transit time through work control". Now the transittime is only updating "once per month" and is hold by the sample-if-true function. Now it is more clearly which value of the transit time is taken when items are put into the wueue. (the average value stays the same).

- I updated the queue-to-work-process-logic:
The problem was, that the work process was capeable of more that one item (capacity = 2). But the trick is that the process should only have a capacity of one. By that we assure that we have a traffic intensity of 1. (We put as much into the process (in mean) as the process is able to handle. But when driving the process near to an mean arrival rate of one the queue will load up. (Try to compare: Lamda = 0.9; 0.99; 0.999, 1).

And you are right. It is definitively better to use units in the models.

Back to my question, maybe you can have a look at the model again:

When setting Lamda to 0.999 (which means in mean we will ahve less items arriving than can be processed) the queue will load up for a TIME STEP of 0.03125 (1/32). But when setting it to 0.0625 (1/16) the queue is not loading up anymore.

Does anybody know why?
Is that only because of the numerical failure which is done in the calculation?

Lets say I am modeling a real process, how can I make sure, that this effect will be displayed or considered in the model when the influence of the TIME STEP is that big?
Or is there simply a failure in the model?

EDIT: Please have a look at the "Work process" for the two time steps.
For the smaller one (which leads to a growing queue) the work process looks more used-to-capacity/utilized than for the bigger time step (for which the queue doesn't load up).
But this does only give the impression of a more-utilized process, the final value of completed work remains the same (1960 Widgets).

Thank you very much and best regards!
Matthias



[Edited on 9-20-2010 by Mattes_01]
Attachments
FunnyQueue.mdl
(8.74 KiB) Downloaded 224 times
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

I looked at this and I can tell you what I think is going on. With the larger time step things get dropped into the flow control process somewhat earlier on average than with the larger time step (not a lot earlier). the result accumulates over time.

I am attaching a model set up so that the random values match exactly for the two time steps (need to use the IF THEN ELSE function where the random call occurs to make that happen). I have also changes the capacities to 1.00001 (I think this is the real problem, but if capacity is 1 thing blow up).

Hope that is helpful - whenever you are dealing with tails of distributions which is what we have here, the results tend to be a little bit flaky. double precision helps a little bit, though not that much.
Attachments
FunnyQueue2.mdl
(10.13 KiB) Downloaded 222 times
Mattes_01
Member
Posts: 42
Joined: Mon Jul 05, 2010 6:05 am

Post by Mattes_01 »

Dear Bob,

yes this would coincide with my intuition.
That means that the "flow to work control" pushes new items into the process more frequently when reducing the time step.
Yes that makes sense, especially when the hand through time of the work process stays constant and the material is only taken from the work process when it has totally finsihed.

Thanks a lot for this support, so this effect can sucessfully be modeled in Vensim.

Best regards to the United Kingdom.
Matthias

[Edited on 9-20-2010 by Mattes_01]
Lee Jones

Post by Lee Jones »

Originally posted by Mattes_01

Best regards to the United Kingdom.
Matthias

[Edited on 9-20-2010 by Mattes_01]
Many thanks Matthias but us Brits can't take the credit for this one, Bob is in America... ;-)
Mattes_01
Member
Posts: 42
Joined: Mon Jul 05, 2010 6:05 am

Post by Mattes_01 »

OK, let me update my greetings:
Best regards to the US!
Matthias
Post Reply