Delay Conveyor shows weired results

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

Delay Conveyor shows weired results

Post by Mattes_01 »

Hi there,

I was trying to reproduce some results which I got in another tool using Vensim.

But I saw that the results shown doesn't correspond to what I expected. So I did some research on the "DELAY CONVEYOR" function and finally got a question:

I implemented the delay conveyor function with a fixed delay time and no leakage and no initial material in it.

Based on what I understand and based on the Modeling Guide, Ch. 9, pg. 93 the output of the conveyor should be the same than the "DELAY FIXED", but it is not.

Please have a look on it and tell me what went wrong.

PS:
The total output should be theoretically:
delay capacity 1, delay time 24.7, total time 2000 => 2000/24.7=81 widgets which corresponds with the delay fixed, but the conveyor puts through around 100 widgets.

EDIT: You can see that there is a feedback when putting material into the work process.
But even when taking the same input for the conveyor AND delay fixed (just delay the signal with the conveyor and the delay fixed) the result differs.

Maybe you can help me or got an idea what went wrong.
Best regards
Matthias

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

Post by bob@vensim.com »

That is interesting. The delay conveyor attempts to spread the input out over more than one time step to get a better approximation of the delay time (so the material is output a very little bit earlier and this then compounds). The delay fix just lumps and dumps. I will poke around a bit more to see if i can find anything else interesting out.
Mattes_01
Member
Posts: 42
Joined: Mon Jul 05, 2010 6:05 am

Post by Mattes_01 »

Yes this might be the reason for this effect.
But we are talking about a very big little bit earlier hehe, I mean in the end the total finished items is about 25% higher than it should be.

And as stated in the help for the "Delay Conveyor" it should behave as a "delay fixed" for constant delay times.

Thank you Bob, I will wait for you to come back to me.

[Edited on 9-23-2010 by Mattes_01]
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

At time 2000 I get 80 for Sink 1 and 79 for Sink 2. It looks like you are getting different results which is very strange indeed. Can you give the exact configuration/version information for your Vensim?
Mattes_01
Member
Posts: 42
Joined: Mon Jul 05, 2010 6:05 am

Post by Mattes_01 »

OK, I will try to give you this data, although I do not exactly know what you mean:
The version, we are using, is: Version 5.9e

Where do I get the exact configuration?

See below a link to a screenshot of the output of the same model I attached above.

If you have problems to open this file/website I can send you the screenshot via email.

http://i51.tinypic.com/35i175e.jpg

[Edited on 9-24-2010 by Mattes_01]
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

This is a simple numerical problem and the reason you are seeing it and I was not is that you are using 5.9e which was built using an older compiler and so has different numerics. The lump and dump nature of DELAY FIXED prevents some roundoff issues.

You should probably use equations like

To WIP 1 rate =
if then else(Queue 1>transfer quantum :AND:WIP 1<WIP capacity-transfer /2,transfer quantum/TIME STEP,0)

This will prevent this type of numeric sensitivity. Just think about it this way - a transfer of 1.0 would be a transfer of .99 or of 1.01 and your equations need to be robust to either of those two cases.
Mattes_01
Member
Posts: 42
Joined: Mon Jul 05, 2010 6:05 am

Post by Mattes_01 »

Hello bob,

when implementing this changes, I still have the same issue:
http://i54.tinypic.com/1zbusdc.jpg

You can see the code I used for the "To WIP 1" flow:
if then else(Queue 1>=transfer quantum:AND:WIP 1<=WIP capacity-transfer quantum,transfer quantum/TIME STEP,0)

I am not sure if I did a mistake because I didn't understand the "/2" in your formula, so I thought you just meant "transfer quantum".

Another question:
What do you mean by
a transfer of 1.0 would be a transfer of .99 or of 1.01 and your equations need to be robust to either of those two cases
I mean basically that is not true, or do you mean VENSIM is internally rounding this values to the mumber of digits behind the comma?

Is that possible, that it is not possible to implement something like this exactly with Vensim, or the Vensim version I am using?
This rounding values might be a big issue.

I mean as an example in real life, widgets are discrete items. It is only possible to finish one complete item. And Vensim is bluring this discrete items. I mean when having a look at the feedback dynamics, as you said earlier, this impect is not big, but when combining this feedback with queueing systems, the impact is way bigger.

The question is, although Vensim has these built in function, whether Vensim is able to represent or picture this special case of queueing behaviour exactly and its effects correctly.


Although the "To WIP 1 rate" and the "To WIP 2 rate" are exactly the same, and from the description and my usage of "DELAY CONVEYOR" it should be exactly the same than "DELAY FIXED" it is not. I am a bit scared, that in my usage of Vensim there might be similar cases which cannot be seen that easily and might influence the model behaviour negatively, or that the output of the model doesn't correspond to the actual process anymore.

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

Post by bob@vensim.com »

Sorry I meant

To WIP 1 rate =
if then else(Queue 1>transfer quantum :AND:WIP 1<WIP capacity-transfer quantum/2,transfer quantum/TIME STEP,0)

The /2 is very important otherwise you have the opposite effect.

If you are focussing on FIFO queues - and your examples so far all have been, you might just stick with the QUEUE functions.

outflow from queue = INTEGER(QUEUE AGE IN RANGE(queue,delay time,1E9))/TIME STEP

And so on. You should probably set TIME STEP =1, though as long as it is a power of 1/2 this approach should work without worrying about numerics.
Mattes_01
Member
Posts: 42
Joined: Mon Jul 05, 2010 6:05 am

Post by Mattes_01 »

Hello Bob,

yes, basically you are right.
For the example above I will get nice results if I use the QUEUE functions (although I dont get the correct results when using your formula and the conveyor).

But at this step we will arrive at a different problem:

Lets say I am having a varying transit (or cycle) time in my work process which means that items are processed with a mean time of 1 month.
When modeling the work process as a queue with capacity 1 and using your formula the problem which occurs is:

Lets say in Time step one (t=0.25 month) there is one item in the process. The transit time is Tt=1.3 month. Do using your formula, the outflow will be zero (and based on our intuition, the item should stay in the work process (in the queue for another 4 time steps and will only be taken out in the fifth time stel, when t=1.5 month).

The problem which we are having is that at the second time step the transit time may be fallen (e.g. Tt=0.45). At this time step the item is taken out of the process or the process is finished. That means when having a varying transit time with a mean of 1 month, the mean value of the actual measured transit time will never be 1 month, it will be less.

I hope you understood what I mean, if not I will provide a small model.

What I was thinking about is to use the "sample if true" function and only allow changes to the transit time when an item is finished, that means when an item is entering the work process freeze the transit time.
But this seems so "cobbled".

[Edited on 9-27-2010 by Mattes_01]
Mattes_01
Member
Posts: 42
Joined: Mon Jul 05, 2010 6:05 am

Post by Mattes_01 »

Hello Bob,

I understood and my model is working properly.
The only thing I had to fix was the "sample if true" function.

What I am doing is I am keeping the value of the variation of "Mu" unless one material is "completing". Only when a material is completing I am allowing a change in "Mu".

By this I am assuring, that the effect, described by me above, is not effecting my model.

So some materials are taken out of the queue with a age less than the average of Mu and some with a age older than the average of Mu.

I used the "SAMPLE IF TRUE" function to only allow a change in Mu when a material is "completing".

I had a problem, because there was a loop in the model:
"completing -> Sample if true-function -> completing". I wasn't able to resolve this problem using the "ACTIVE INITIAL" function, but I am just saving one of the materials in the loop in a stock with the smalles possible delay time [DELAY FIXED(input,TIME STEP,0)] and now it is working, although again a bit half-assed, but it is working.

If you want to see an example, I can provide it. Just let me know.

Best regards
Lee Jones

Post by Lee Jones »

I've used that approach when modelling processes with random process times and single items being processed at any one time. When the process starts, I select a process time using one of the random number generators in Vensim and sample_if_true (process is starting). It works well for situations like process flows where a single item or batch is processed at a time through the process step or machine.
Mattes_01
Member
Posts: 42
Joined: Mon Jul 05, 2010 6:05 am

Post by Mattes_01 »

Yes, correct, I did the same.

As said the only difficulty I had was using the "sample if true" function without getting an error like "Simultaneous equations involving", even when using the "active initial" function.

Is it possible for you to post an extract from your model that I can see how you resolved this problem?
As said, I am using a stock in which I put in the value of the "process start" (and leaving it out after one time step) and whenever this stock is not empty, a new time is kept in the "sample if true" function, but actually I don't want to have another, unneccessary stock in my model.

And another question is how this approach can be applied to processes with more than one item capacity?
I think it is not possible to apply for cases with capacity > 1, because all items will have the same duration-time, except you introduce a lot of "sample if true" functions, which will be a bit messy.

Does anybody have an idea?
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

If the process is FIFO than you can use QUEUE FIFO ATTRIB and store the exit time from the queue as the attribute. Then you can use

outflow = QUEUE ATTRIB IN RANGE(queue,Time,1E9)

If you want things to be able to pass one another you can get it with the delay material function as attached (actually this is simpler anyway).
Attachments
passingqueue.mdl
(2.75 KiB) Downloaded 1142 times
Mattes_01
Member
Posts: 42
Joined: Mon Jul 05, 2010 6:05 am

Post by Mattes_01 »

After some testing I think I will combine a queue with a normal delay with varying delay times, this makes in my case most sense and gives the best results.

I tested the material delay, but I am not happy with it because it is a bit complicated to model the following problem:
lets say in my process there are 10 items at the same time with different delay times.
When modeling this with a material delay with capacity 10 and all enter the delay at the same time, they all will exit the delay at the same time (this doesn't correspond to the process I am spending time with).

I will try to model my process the old fashioned way and using a queue in front of the delay will make the model able to capture certain effects, described earlier by me.

Thanks a lot!
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

If you want multiple processing times entered at a single time then you would need place each individual item into a subscripted var something like

inflow[item] = IF THEN ELSE(Total Inflow >= item,unit inflow,0)/TIME STEP
queue = INTEG(SUM(inflow[item!]-outflow[item!]),0)
outflow[item] = DELAY MATERIAL(inflow[item]...

of course you need to be sure that item has enough elements or do something with the leftover.
Mattes_01
Member
Posts: 42
Joined: Mon Jul 05, 2010 6:05 am

Post by Mattes_01 »

I understand. Thanbk you for this hint. I am not very familiar with subscripts yet and I don't know whether this might be too detailed, but just to sum up:

Lets say TIME STEP = 1

Inflow (Time = 1) = 10 Items
Inflow (Time = 2) = 6 Items

Then it is not possible, using "Delay Conveyor" or "Delay Material" to get an output like:

Outflow (Time = 3) = 11 Items(like input @ T=1 and a bit from input @ T=2)
Outflow (Time = 4) = 5 Items (remaining stuff from T=2)

It is either possible to get (using the "Delay Material"):

Outflow (Time = 3) = 10 Items (like input@ T=1)
Outflow (Time = 4) = 6 Items like input @ T=2

OR

Outflow (Time = 3) = 16 Items (like input @ T=1 + input @ T=2)
Outflow (Time = 4) = 0 Items (stuff flowed out completely already)


This split up between signle items is only possible using either subscripts or the continuous Delay Functions, like "Delay3", "Delay1" or "DealyN".

I mean in real life, when talking about a complex process, when starting the process for 100 items today, these 100 itmes will nox be finished in a batch, the finishing may split up over a couple of days (as said, even when they have been started as a batch initially).

Is my conclusion above correct?


And one more question:
There is no lost of information (or lets say it isn't a non-conform modeling) when using the (for my understanding) discrete "QUEUE FIFO" function in combination with a (for my understanding) continuous "DelayN" function?

Greetings from germany.


[Edited on 10-5-2010 by Mattes_01]
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

Initialization is a different question from your first. The DELAY FIXED, MATERIAL and INFORMATION all spread the initial output over initial delay time (eg with a delay time of 10 and initial output of 1 you would get 1 units per period for 10 periods). Only DELAY CONVEYOR and the QUEUE functions allow you to specify a profile of initial values.

As far as splitting a pulse input - indeed this is a continuous operation (see also DELAY PROFILE). If you want to stay discrete than subscripts will let you do that.

An alternative approach, however, would be to select a small time step (perhaps a variable time step based on waiting stuff) and put only 1 item at a time into the queue.
Post Reply