Delay question

Use this forum to post Vensim related questions.
Post Reply
peter26
Junior Member
Posts: 5
Joined: Wed May 10, 2006 11:55 am

Delay question

Post by peter26 »

Hi guys,

I'm new on this forum and also new in using Vensim so i hope you can help me out with this. I will try to explain my problem as best as possible.

If you got stock with a flow in and out. For example cookies. It takes 5 weeks to get all 100 cookies out. But they dont go out all at once but divide over the 5 weeks.

In the first week 20% goes out, 2nd week 30%, 3rd week nothing and last 2 weeks 25% a week. So that makes 100% over 5 weeks and all cookies are out of the factory.

How can i do this in Vensim? I'm a bit familliar with delays but in a fixed delay you type:5 and you get a chart with a high end and all 500 cookies go out after 5 weeks. Nothing goes out in the first 4 weeks but thats not true in realitity.

You use a different kind of delay? And if yes: which one?

If anyone could help it would make me very happy :)

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

Post by bob@vensim.com »

The simplest delays are SMOOTH and DELAY3 - however if you really want your percentage breakdown you will need to use DELAY PROFILE.

Generally a better solution is just to use

outflow = MIN(capacity,in process/min processing time)
in process = INTEG(inflow - outflow,0)

this is a strong simplification, but one that usually leads to real progress in understanding the problem.
peter26
Junior Member
Posts: 5
Joined: Wed May 10, 2006 11:55 am

Post by peter26 »

Originally posted by bob@vensim.com
The simplest delays are SMOOTH and DELAY3 - however if you really want your percentage breakdown you will need to use DELAY PROFILE.

Generally a better solution is just to use

outflow = MIN(capacity,in process/min processing time)
in process = INTEG(inflow - outflow,0)

this is a strong simplification, but one that usually leads to real progress in understanding the problem.
Thank you for your help Bob. Like i said, i'm a starter and it would be a great help if you could tell me in short how to use the PROFILE DELAY

By reading the description of that delay it looks like its the right one. So can you use my cookie example and describe how it would look like in the profile delay?

I hope its not to much to ask :)

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

Post by bob@vensim.com »

I am attaching cookies.mdl that does this. Note that the function uses the average delay time (2.55 weeks for your example) not the maximum delay time.
Attachments
cookies.mdl
(2.07 KiB) Downloaded 963 times
peter26
Junior Member
Posts: 5
Joined: Wed May 10, 2006 11:55 am

Post by peter26 »

I dont understand why my average delay is 2.55 weeks. Maybe its a stupid question but how did you calculate that number?

[Edited on 5-12-2006 by peter26]
peter26
Junior Member
Posts: 5
Joined: Wed May 10, 2006 11:55 am

Post by peter26 »

Maybe its usefull to say something more about my real problem. We are trying to modelate a proces for the dutch police which calculates work-stocks. For example 100.000 cases come in. In the first week (week 0) 98,9% cases are beeing processed, the 1,1% left are cases which need to be judged. The judging proces takes 23 weeks. So in a graph you need to see a high outflow in week 1 (98.900 cases), then a stock of 1100 stays in for 22 weeks and go out in week 23. So then you need to see another outflow in week 23.

Can we do this with the PROFILE DELAY? We are experimenting with it at this very moment.

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

Post by bob@vensim.com »

Average Delay

the average comes from integrating the x * lookup(x)/area under lookup since the lookup is stepwise we get away with the mean value in each range so

0-1 has a mean value of .5 with lookupup of .2 giving us .1
1-2 has a mean values of 1.5 with lookup of .3 giving us .45
2-3 0
3-5 has a mean value of 4 with lookujp of .25 giving us 2

add up gives 2.55 - areas is 1.
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

Now ignore all of this. For the problem you want to work on you absolutely do not want to use a delay profile.

You have described two stage flow process that has a quick outflow followed by a small percentage going into a longer process. You need to explicitly model both stocks of people - those in processing and those in judgement. I would recommend

in processing = INTEG(arrested - processed,init in processing)
in judgement = INTEG(processed*fraction of processed judged - judged,init in judgement)

for processed and judged I would recommend the outflow formulation I mentioned above.
peter26
Junior Member
Posts: 5
Joined: Wed May 10, 2006 11:55 am

Post by peter26 »

Originally posted by bob@vensim.com
Now ignore all of this. For the problem you want to work on you absolutely do not want to use a delay profile.

You have described two stage flow process that has a quick outflow followed by a small percentage going into a longer process. You need to explicitly model both stocks of people - those in processing and those in judgement. I would recommend

in processing = INTEG(arrested - processed,init in processing)
in judgement = INTEG(processed*fraction of processed judged - judged,init in judgement)

for processed and judged I would recommend the outflow formulation I mentioned above.

Maybe my description of the proces wasnt clear enough. The 1,1% cases which come back after 23 weeks is the same proces so there are not 2 flows. Well actually there are more flows but i didnt mention them because its a pretty big model.
The whole proces is about verifying people adresses and names, to send the fine to the right adress. For instance a speeding ticket. The first flow is the automated fine. The most people pay their fine when they receive the first bill. But there is also a percentage who dont pay the bill the first time. They go to the 2nd flow and receive a new bill with a raise of 10,- euro. If they dont pay that bill they will go to the 2nd raise and have to pay 15,- euro more. etc. There are 7 steps in this proces.
The first 3 steps have a non-variable timestep. When a case goes from the 1st to 2nd step, it will always take 11 weeks. But when we get to the last 4 steps the time for a case to flow out is variable. The period may be 8 weeks but some flow out in the first 2 weeks and others will go out after the full 8 weeks and some even in week 5. So thats why we need to devide the percentages over the 8 weeks.

Thats about the whole proces and i hope its all clear now.
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

What you have described is a variation of an aging chain with retirement. Explicitly representing the stocks and flows for the process will make it much easier to understand what is happening, and to experiment with difference policy initiatives - for example changing the secondary process for everyone with suburban mailing addresses.

If a stage has a fixed delay you can use

processed = DELAY FIXED(arrested,processing time)

you can have as many stages as you want - flows connect the stages.
Olger
Junior Member
Posts: 10
Joined: Fri May 12, 2006 10:30 am

Post by Olger »

Hello,

I'm a Colleague of Peter26.

We have tried to work with a fixed delay. In de first 3 processes of our model it works very well. But then the problems come.

Lets keep it simple and say that in that step we have a input of 500 cases. we need to divide the input over (sometimes) 174 weeks. For example; week 1; 25,4% out
week 2; 2,3% out
week 3; 0,6% out
week 4; 4,4% out
Etc. sometimes until 174 weeks.

We don't think that is this is possible with a fixed delay, correct us if we're wrong.
Anyone have any suggestion how to solve this problem?
LAUJJL
Senior Member
Posts: 1477
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

delay

Post by LAUJJL »

Hi

You should work on making a simple model that resumes your full problem and join the right explanations with it to make your problem understandable to anybody wanting to help you and of course make the model and the documentation available.
Regards.
JJ
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

I would recommend that you use delay_fixed with another delay such as a delay3 at later stages - or go to the so-called capcitated delay as discussed in another thread by that name.

If, however, your purpose is to match precisely the average processing distribution observed in the data these will not work. To match that distribution you will either need to use a DELAY PROFILE function, or actually create a 174 staqe process which is not likely to be too helpful.

It is important to remember that the distribution observed in the data is a consequnce of system structure and individual behavioral attibutes. Since your purpose is, presumably, to make adjustments to sysytem design you need to balance matching the past with getting at the causes of behavior.
Olger
Junior Member
Posts: 10
Joined: Fri May 12, 2006 10:30 am

Post by Olger »

Srry can't upload a model or documentation (restrictions from company).

==INPUT==>| Stock |==OUTPUT==>

For example:
I have a input of 500 cases in week 1
The output of the 500 cases which came in should be in week 1; 25,4%, week 2; 2,3%, week 3; 0,6% and week 4; 4,4%.

This is not 100%, i know but this will keep this example easier. In our model we should devide the output over 174 weeks.

Hope you understand my problem.

Tnx

[Edited on 5-15-2006 by Olger]
LAUJJL
Senior Member
Posts: 1477
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Delay

Post by LAUJJL »

Hi

I did not ask that you show your complete model but one that summarizes the problem.
I have the same problem. I will never show a complete model.
Regards.
JJ
LAUJJL
Senior Member
Posts: 1477
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Delay

Post by LAUJJL »

Hi

Joined a model that uses subscripts that is a bit heavy, but that works.
Regards.
Attachments
delay.mdl
(4.39 KiB) Downloaded 1079 times
LAUJJL
Senior Member
Posts: 1477
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Delay

Post by LAUJJL »

Hi

As Bob said, the delay profile should work too, you can choose between both.
One thing to consider too is at least at the beginning to work with months instead of weeks, even if it can evoluate to weeks later on. The benefit is to have a simpler model at the beginning that can always be made more complicate if it does not loose visibility in the process and adds sufficient value.
Regards.
JJ
Olger
Junior Member
Posts: 10
Joined: Fri May 12, 2006 10:30 am

Post by Olger »

Hi,

Here is an example of the problem. I can't download yours so can't check right now if that is what we need (company restrictions again).

Tnx!
Attachments
Example.mdl
(2.39 KiB) Downloaded 1110 times
LAUJJL
Senior Member
Posts: 1477
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

delay

Post by LAUJJL »

Hi

I checked the download and my model was already downoladed several times.
If you cannot donwload, send me your address e-mail, I will
send you the model.
Regards.
JJ
Attachments
delay.mdl
(4.43 KiB) Downloaded 1123 times
LAUJJL
Senior Member
Posts: 1477
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Post by LAUJJL »

I tried to download your model example.mdl and it does not work either.
May be a problem with the forum?
Regards.
JJ
Olger
Junior Member
Posts: 10
Joined: Fri May 12, 2006 10:30 am

Post by Olger »

I have send you a e-mail

[Edited on 5-16-2006 by Olger]
LAUJJL
Senior Member
Posts: 1477
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

delay

Post by LAUJJL »

HI

About the example that you give using the delay profile I think that the proble comes from the fact that you must give the average delay time plus the profile and Vensim mixes all this to give results that can be a bit surprising. the documentation warns about being careful withe the delay profile. When you vary dhe delay time in your model, the distirubution varies but is blocked at one moment.
I do not use the delay profile, so i cannot say what is exactly going on. Eventually the model works with a delay time that is a multiple of the time step, ro something like that.
I think that if you want an exact distribution my solution has not that problem.
Regards.
JJ
LAUJJL
Senior Member
Posts: 1477
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Post by LAUJJL »

Hi

You should too put units in your model.
for instance you model has month unit in the settings and you are suppoedl to work in weeks.
Respecting unit is a very easy and unexpensive way to check a model.
there is may be an error that comes from unit inconsistency.
Regards.
JJ
Olger
Junior Member
Posts: 10
Joined: Fri May 12, 2006 10:30 am

Post by Olger »

Tnx all for your help. It's working now.

Tnx
Post Reply