Model correction please help

Use this forum to post Vensim related questions.
Post Reply
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Model correction

Post by LAUJJL »

Hi

Here is joined a correction that works better.
It needs the delay material function that is not available in PLE or PLE plus.
If using the synthesim, you can see that f the time to serve a customer is greater than 1/the average arrival of customers the queue will grow up indefinitely. If average arrival equal 2, than if the service is more than 1/2 = 0.5, than the queue will grow.
Regards.
JJ
Attachments
teller[2].mdl
(4.05 KiB) Downloaded 224 times
emr
Junior Member
Posts: 6
Joined: Sun May 30, 2010 5:26 pm

Post by emr »

I don't quite understand your model. Could you explain me what you have done?



Thank you for your reply!



[Edited on 6-10-2010 by emr]
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Model correction

Post by LAUJJL »

Hi

Joined a second model, with Teller3 modeled in a continuous way usable with PLE. It gives the same result with a low time to serve customer, but when that time increases it becomes different. Try first to understand the continuous way to model by erasing the Teller 2 formulas, so as to make it work with Vensim PLE. If you have understood the coninuous way that is approximative, it will be possible to explain further on.
There was a slight bug in the version 3. I have changed it
Regards.
JJ

[Edited on 31-5-2010 by LAUJJL]
Attachments
teller[3].mdl
(5.33 KiB) Downloaded 218 times
emr
Junior Member
Posts: 6
Joined: Sun May 30, 2010 5:26 pm

Post by emr »

Could you send me the final form of the model because its confusing with the 3 forms together?
The poisson for arrivals is correct?

Thank you and sorry for the many questions.. :(

[Edited on 5-31-2010 by emr]
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Model correction

Post by LAUJJL »

Here is the model that can be used with Vensim PLE
JJ
Attachments
teller[4].mdl
(3.95 KiB) Downloaded 229 times
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Post by tomfid »

You might take a look at the handling of the discrete arrivals in the carRental.mdl model in this thread:
http://www.ventanasystems.co.uk/forum/v ... php?t=4076

Tom
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Post by tomfid »

Actually you want the .vpm version that I posted here, http://models.metasd.com/2010/04/rental ... -dynamics/

You can run it with the free Vensim Model Reader, which handles things that PLE won't (arrays, advanced functions, ...)

Tom
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Post by tomfid »

Here's another version of the model that handles the Poisson arrivals/departures as discrete events.

One thing to note is that in the original model, the TIME STEP (0.5) was too short given the service time (0.05) - if a queue or level is modeled explicitly, the time step needs to be shorter than the time constant of the behavior of the level.

Another thing to note is that the queue/service_time formulation of the exit rate isn't realistic. It implies that the exit rate can get infinitely large as the queue gets large. That can't be, because a single teller has finite processing capacity.

In this version arrivals are modeled as
RANDOM POISSON(0,1e+006,mean arrival rate*TIME STEP,0,1,0)/TIME STEP

The *TIME STEP is inside the random function call, because we want to know the discrete integer number of arrivals within the current time step. The /TIME STEP outside the function call then ensures that those arrivals effectively occur instantaneously. As a result, the queue always contains an integer # of customers.

The same thing happens in the exits formulation, but in addition there's a MIN to ensure that the teller never processes more customers than are in the queue.

The interesting experiment to perform with this model is to increase the arrival rate until it exceeds the service rate; then you get the standard theoretical result, that the queue and service time grow without bound.
Attachments
teller[6].mdl
(3.57 KiB) Downloaded 229 times
emr
Junior Member
Posts: 6
Joined: Sun May 30, 2010 5:26 pm

Post by emr »

Thank you very much Tom for your answer.
When I check the model get the message: average arrival rate is not used in the model. is that a problem?

Could you please explain me what is the role of mean arrival rate, Average arrival rate, smoothing time and mean service rate?

thank you!

[Edited on 5-31-2010 by emr]
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Post by tomfid »

"xxx is not used in the model" messages are just a warning; they might help you find a variable that is unused, but should be. For a reporting variable like the average arrival rate, that you don't intend to use, you can suppress the warning by checking the "supplemental" box in the equation editor.

The mean arrival rate is just the average rate at which customers arrive at the teller. The average arrival rate is the actual customer arrival rate, smoothed to make it easier to see. Over the long term, it should be the same as the mean arrival rate. The mean service rate is the average rate at which a teller can service customers.
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Model correction

Post by LAUJJL »

Hi Tom

There are things that I do not quite understand in the teller6 model that you joined.
First, how do you expect the exit rate to follow a Poisson distribution. A Poisson distribution is the limit of many independants Bernouilly events with a small probability of occurency. If they accumulate in a level when they come out, they are no more independant unless the service time is very short and there is no waiting in the queue. The Bernouilly events being no more independant there is a probability that the limit is no more a Poisson law.

Second: when one studies event by event the input and output of the Teller level, the service time does not correspond to 6 customers being served within an hour.
For instance the third event that enters the level is served in an hour, while being alone in the queue. The first two events are not served too within the 1/6 hour service time.

When I study my model with a time delay the average cycle time is quite different and the average level is different too.
I have made a model with a 1/1024 time step, with a Bernouilly distribution, with the delay for each event being precisely calculated being precisely identified and it gives results quite different from your representation and nearly simular to the mine with a Poisson input and a delay meterial output.
Regards.
JJ
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Post by tomfid »

JJ - I haven't had a chance to look at the model again, but here are a few quick comments:

- The effective distribution isn't quite Poisson, because the maximum exit rate is truncated by the size of the queue.

- I hardly thought about the distribution, just trying to get the model running with integer constraints, but the relevant property of the Poisson distribution seemed to me to be the exponential inter-arrival time, which seemed plausible for teller service.

- It does appear that the effective cycle time is not what's expected. This is odd, and I'll have to take another look at the model.

Tom
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Post by LAUJJL »

Hi Tom

I join two models.
The first comparte your formulation and mine with a delay material. I have slightly changed the formulation to take into account that if many events are belonging to the same period of time, the average service is not equal to the time to serve a customer multiplied by the number of customers but by the average number of customers.
The result shows very different results for the teller level and the average cycle time.
The second level delivers approximately the same results that the first one with the delay formulation but has a time step equal to 1/1024 and a Bernouilli distribution that allows to calculate precisely the exit events.
Regards.
JJ
Attachments
teller.zip
(3.5 KiB) Downloaded 213 times
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Post by tomfid »

I haven't had a chance to look at your models yet, but it occurs to me that you would expect the average cycle time to be different from the service time (1/mean service rate), because the total cycle time includes both the time it takes to be serviced AND any time waiting in the service queue. (However, that doesn't explain why it takes an hour for the third customer to be serviced, which appears to be an improbable event).
emr
Junior Member
Posts: 6
Joined: Sun May 30, 2010 5:26 pm

Post by emr »

Hello Tom and LAUJJL,

What is the conclusuion? Is the model teller[6] is wrong or is it ok?
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Post by tomfid »

I haven't had a chance to look into it further, but I think in part "right" depends on what you think the actual behavior of the teller service time is. Could it be exponentially distributed? Or is it more consistent (lower variance) than that?
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Post by tomfid »

JJ - Thinking some more, I guess one reason for the difference between models is that your DELAY MATERIAL effectively has a deterministic service time? I looked at the 1hr residence times with the Poisson distribution - they seem unlucky, but at the 1% probability level, and therefore not totally crazy. I did some tests and the Poisson random generator does seem to be working. I'll have to think about this some more. - Tom
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

model correction

Post by LAUJJL »

Hi Tom

I do not think that the difference between the two formulation commes from a stable service time.
I have changed my model to include a poisson distribution for the service time, and the average waiting plus service time is changing only marginally and is still very different from your formulation that delivers a total service time about 50% longher than mine formulation.
I have too succeded to represent the problem in a strictly continuous way, that does not require any delay, nor discreet functions and that can be run witn Vensim PLE and that is even more precise than the formulation with a delay material. Joined the model with the delay material that can be run with or without service variability. It has been changed slightly to take into account that when a new customer enters the queue, the customer being served can be at the end or the begining of the service. This shortens slightly the delay for the new comer.
The continuous model teller8, works still with a bernoilli distrbution and is probably more accurate than the one with the delay, while being formulated in a continuous way. The trick is that it separates the waiting process and the service process. It can too be run with or not service time variability.
Joined the two models, Teller7_5 for the modified Bernouill model and Teller8 for the Bernouilli model that is strictly formulated in a non discreet way.
Regards.

Hi Emr

You can now use the teller[8] model with PLE and verify closely that it corresponds to your requirement. It can be a bit cumbersome to verify due to the very short time step.
Regards.

JJ
Attachments
teller7_8.zip
(3.97 KiB) Downloaded 196 times
emr
Junior Member
Posts: 6
Joined: Sun May 30, 2010 5:26 pm

Post by emr »

Thank you LAUJJL. I see you have done a great job, though teller[8] seems a bit hard for me to understand since I havent used vensim before. I would like to keep it simple.

Tom, if the teller service time was a constant about 3 minutes per customer? It was set like this in my first model I think. Then there wouldn't be a poisson at the customer exit? (for teller[6]).

For the arrival of the customers I had set a poisson distribution because I wanted the arrival time to be known and keep the model simple. If its complicated with the poisson it could also be set with a number of the pace of customer arrival (any number you want)

The working hours of the bank is 8-14. This has nothing to do with the final time right? (to set final time= 6) Because you and LAUJJL have set it at 100 at your models.

thank you !

[Edited on 6-4-2010 by emr]
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Post by LAUJJL »

EMR

If you run the model teller8, and click on the statistic button of the analysis tool at the left of the sketch, with the customer being served highlighted you will see that it has a mean of 0.35. This means that in this case, the bank teller is working 35% of his time. If you change the pamaters value you must change too the stochastic correction. You must first set the statistic correction to 1, and calculate the difference between the real mean of the service rate with the statistical tool and the mean service rate. There is a difference because the poisson distribution being bounded by a minimum and a maximum, has not the same mean as expected by the mean service rate. But if you can work too with a correction of 1 (no correction) the result will be slightly biased but still relevant.
Regards.
JJ
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Post by tomfid »

After some further reflection, I think my model is correct as a representation of a queue with Poisson arrivals and exponentially distributed service time.

I implemented some of the analytic results for an M/M/1 queue, and the results conform to that, though I only checked two cases, and not with large enough samples to be sure.
http://en.wikipedia.org/wiki/M/M/1_model

For high service rate and low arrival rate, there will be some bias (higher than expected waiting times) in the model result because TIME STEP is finite.

The reason that the service+waiting time is greater than the inverse of the service rate is that some customers have to wait while another is served; that accounts for the 50% difference in waiting times that JJ observed.

I think you could fairly easily make the service time deterministic in this model, to get an M/D/1 queue. However, you can't simply replace exits with a DELAY MATERIAL of arrivals, because that would imply infinite teller service capacity.

See attached model, which also has better accounting for timing.
Attachments
teller[7]tf.mdl
(7.67 KiB) Downloaded 162 times
emr
Junior Member
Posts: 6
Joined: Sun May 30, 2010 5:26 pm

Post by emr »

Thank you for your time.
I decided to use the model teller[6] because it is the most simple.

How could I change the service time and set It as minutes? Should I replace 'mean service rate' with a constant 0.05 and units=hour?







[Edited on 6-4-2010 by emr]

[Edited on 6-10-2010 by emr]
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Post by tomfid »

With a 3min service time, a teller could serve 20 customers/hour, so you could set the service rate to 20. That would correspond with an exponentially distributed service time with a 3min mean. However, the actual throughput will be somewhat different, due to occasional waiting.

You could set INITIAL TIME =8 and FINAL TIME = 14 if you want. It would make sense to shorten the smoothing time to something more like 1hr. You also want to set TIME STEP to something substantially less than 3min. Ideally it should be a power of 2, so 0.015625 as in Teller[7]tf might be good. Also, you should make the random number seed in the RANDOM POISSON calls a parameter, so that you can vary it for sensitivity analysis (also as in Teller[7]tf).

Tom
Post Reply