Problem 9 page 37

In this first problem we will find the queueing metrics \({ W }_{ q }\), W, \({ L }_{ q }\), L, and \(\rho\) for an M/D/1 queue, where;

\({ W }_{ q }\) denotes the steady-state average time in the queue,
W denotes the steady-state average time in the system,
\({ L }_{ q }\) denotes the steady-state average number of entities in the queue,
L denotes the steady-state average number of entities in the system, and
\(\rho\) denotes the steady-state utilization of the server

Finally, \(\lambda\) will denote the arrival rate and \(\mu\) the service rate.
\(\mu=\frac { 1 }{ E(S) }\), where S is the service time of the server (in this case a constant).

In case of M/G/1 queue, where \(\sigma\) is the standard deviation of the servie-time RV S, so \({ \sigma }^{ 2 }\) is its variance.

We have from Pollaczek-Khinchine formula, we have:

\({ W }_{ q }=\frac { \lambda ({ \sigma }^{ 2 }\quad +\quad { 1 }/{ { \mu }^{ 2 } }) }{ 2(1-{ \lambda }/{ \mu ) } }\)

In the case of a M/D/1 queue, since S is constant, the variance \({ \sigma }^{ 2 }\) = 0. Hence, we can rewrite the formula as:

\({ W }_{ q }=\frac { \lambda (0\quad +\quad { 1 }/{ { \mu }^{ 2 } }) }{ 2(1-{ \lambda }/{ \mu ) } } =\frac { { \lambda }/{ { \mu }^{ 2 } } }{ 2(1-{ \lambda }/{ \mu ) } }\),

since we have \(\rho =\frac { \lambda }{ \mu }\), this leads to:
\({ W }_{ q }=\frac { \mu \rho ({ 1 }/{ { \mu }^{ 2 }) } }{ 2(1-\rho ) } =\frac { { \rho }/{ \mu } }{ 2(1-\rho ) } =\frac { \rho }{ 2\mu (1-\rho ) }\)

Applying Little Law:
\(L=\lambda\cdot W\)
\({ L }_{ q }=\lambda\cdot { W }_{ q }\)
\(W={ W }_{ q }+E(S)\)

Hence, since \(W={ W }_{ q }+\frac { 1 }{ \mu }\), we have

\(W=\frac { \rho }{ 2\mu (1-\rho ) } +\frac { 1 }{ \mu } =\frac { \rho +2(1-\rho ) }{ 2\mu (1-\rho ) } =\frac { \rho +2-2\rho }{ 2\mu (1-\rho ) } =\frac { 2-\rho }{ 2\mu (1-\rho ) }\)

Similarly, since \({ L }_{ q }=\lambda\cdot { W }_{ q }\), we have

\({ L }_{ q }=\lambda \frac { \rho }{ 2\mu (1-\rho ) } =\frac { \lambda }{ \mu } \cdot \frac { \rho }{ 2(1-\rho ) } =\frac { { \rho }^{ 2 } }{ 2(1-\rho ) }\)

Finally, since \(L=\lambda\cdot W\), we have

\(L=\lambda \frac { (2-\rho ) }{ 2\mu (1-\rho ) } =\frac { \lambda }{ \mu } \cdot \frac { (2-\rho ) }{ 2(1-\rho ) } =\frac { \rho (2-\rho ) }{ 2(1-\rho ) }\)

For simplicity, we will compare these results with M/M/1 queue.

For a M/M/1 queue, we have the following formulas:

\({ W }_{ q }=\frac { \rho }{ \mu (1-\rho ) }\)
\(W=\frac { 1 }{ \mu (1-\rho ) }\)
\({ L }_{ q }=\frac { { \rho }^{ 2 } }{ 1-\rho }\)
\(L=\frac { \rho }{ 1-\rho }\)

The steady-state average wait time in the queue (\({ W }_{ q }\)) for M/D/1 queue is 1/2 of the one for M/M/1 queue. This seemed to imply that reducing the variabilities in server time would reduced the waiting time in the queue.


Problem 15 page 127

In this problem, we will build a Simio Model for a M/D/1 queue. We will consider the following values;

\(\lambda=1\) \(\mu=\frac { 1 }{ 0.9 } =1.1111\)

We will first compute the expected queuing metrics; \({ W }_{ q }\), W, \({ L }_{ q }\), L, and \(\rho\) based on formula derived in previous problem and then we will build a simio simulation to represent this queueing scenario.

All calculations will be done in R.

# Setting variable v_lambda and v_mu 
v_lambda <- 1
v_mu <- 1/0.9

# Calculating server utilization
v_rho <- v_lambda/v_mu

v_Wq <- v_rho/(2*v_mu*(1-v_rho))

v_W <- (2-v_rho)/(2*v_mu*(1-v_rho))

v_Lq <- (v_rho^2)/(2*(1-v_rho))

v_L <- (v_rho*(2-v_rho))/(2*(1-v_rho))

v_results <- data.frame(v_rho, v_Wq, v_W, v_Lq, v_L)

colnames(v_results)<- c("rho", "Wq", "W", "Lq", "L")

knitr::kable(v_results)
rho Wq W Lq L
0.9 4.05 4.95 4.05 4.95

Simio model was built with one source and one server. The run time for server is set with the constance = 0.9

m/d/1 model

m/d/1 model

The first experiment was set-up as follows:

Experiement ran for 96 hours, with warm-up period of 4 hours with 20 repetitions

The results are captured below:

m/d/1 First run, experiment 1

m/d/1 First run, experiment 1

We will run a second experiment with a longer warm-up time (8 hours)

m/d/1 Second run, experiment 2

m/d/1 Second run, experiment 2

We will now increase the run time from 96 to 144 and increase the number of repetition to 30 for a 3rd experiment.

m/d/1 third run, experiment 3

m/d/1 third run, experiment 3

The results of experiments are comparable to one another and are off with respect to theoritical numbers.
The next experiment is run with 144 runtime, 30 repetition and 12 hours warm-up.

m/d/1 fourth run, experiment 4

m/d/1 fourth run, experiment 4

We will recalculate the theoritical values by applying Little Law formulas directly and from the derived formula for \({ W }_{ q }\) whic has been vetted against litterature.

# Sanity Check, use Little law instead of derived formulas

w_W <- v_Wq + (1/v_mu)

w_Lq <- v_lambda*v_Wq

w_L <- v_lambda*w_W

w_results <- data.frame(v_rho, v_Wq, w_W, w_Lq, w_L)

colnames(w_results)<- c("rho", "Wq", "W", "Lq", "L")

knitr::kable(w_results)
rho Wq W Lq L
0.9 4.05 4.95 4.05 4.95

After reviewing the formula derivations and recalculating the results based on direct applications of Little laws, we will revise our experiments setting again.

We will run another experiment with run time of 144 hours, warm-up period of 24 hours, and with 200 repetitions.

m/d/1 fith run, experiment 5

m/d/1 fith run, experiment 5

We can see that we are approaching the theoritical numbers.