This is a special case of a $M/M/c$ queuing system with $c=2$. Here, there is a single customer queue that feeds into two servers, one of which has a higher rate of service than the other. Call them Able and Baker respectively. If a customer arrives and both Able and Baker are free, he preferentially chooses Able, otherwise he chooses Baker. The customer enqueues if both the servers are busy. My question is are there closed form expressions for various performance metrics for this system? For example, mean sojourn time in system, probability of customer being busy etc.
1 Answer
Below analysis use the server selection criteria:
If a customer arrives and both Able and Baker are free, he preferentially chooses Able;
If one and only one is free, he choose the avaiable one;
If none is free, he quit/wait.
The system capacity limit is just the number of the servers
The transition diagram looks like:
Clear["Global`*"];
(transferMatrix =
Normal@SparseArray[{{1, 2} -> \[Lambda], {2, 1} ->
Subscript[\[Mu], 1], {2, 3} -> \[Lambda], {3, 2} ->
Subscript[\[Mu], 2], {3, 4} ->
Subscript[\[Mu], 1], {4, 3} -> \[Lambda], {4, 1} ->
Subscript[\[Mu], 2]}, {4, 4}]) // MatrixForm;
modifiedTransferMatrix =
transferMatrix - DiagonalMatrix[Total[transferMatrix, {2}]];
modifiedTransferMatrix // MatrixForm
\[ScriptCapitalP] =
ContinuousMarkovProcess[{1, 0, 0, 0}, modifiedTransferMatrix];
MarkovProcessProperties[\[ScriptCapitalP]]
\[ScriptCapitalD] =
StationaryDistribution[\[ScriptCapitalP]] // FullSimplify
Table[Probability[x == n, x \[Distributed] \[ScriptCapitalD]], {n, 1,
4}] // Together
(* Verification *)
Solve[{lambda*p00 == mu2*p01 + mu1*p10, (lambda + mu2)*p01 ==
mu1*p11, (lambda + mu1)*p10 == lambda*p00 + mu2*p11,
p00 + p11 + p01 + p10 == 1}, {p00, p01, p10, p11}] //
FullSimplify // Together
% /. {lambda -> \[Lambda], mu1 -> Subscript[\[Mu], 1],
mu2 -> Subscript[\[Mu], 2]}
The stationary probability of [Able free, Baker free], [Able busy, Baker free], [Able busy, Baker busy], [Able free, Baker busy] respectively are:
$$ \left\{\frac{\mu _1 \mu _2 \left(2 \lambda +\mu _1+\mu _2\right)}{\left(\lambda +\mu _1\right) \left(\lambda ^2+2 \lambda \mu _2+\mu _2^2+\mu _1 \mu _2\right)},\frac{\lambda \mu _2 \left(\lambda +\mu _1+\mu _2\right)}{\left(\lambda +\mu _1\right) \left(\lambda ^2+2 \lambda \mu _2+\mu _2^2+\mu _1 \mu _2\right)},\frac{\lambda ^2 \left(\lambda +\mu _2\right)}{\left(\lambda +\mu _1\right) \left(\lambda ^2+2 \lambda \mu _2+\mu _2^2+\mu _1 \mu _2\right)},\frac{\lambda ^2 \mu _1}{\left(\lambda +\mu _1\right) \left(\lambda ^2+2 \lambda \mu _2+\mu _2^2+\mu _1 \mu _2\right)}\right\} $$
The system capacity limit is $\infty$
It's a little more difficult than the former case. The transition diagram looks like:
Solve[{lambda*p00 == mu2*p01 + mu1*p10, (lambda + mu2)*p01 ==
mu1*p11, (lambda + mu1)*p10 ==
lambda*p00 + mu2*p11, (mu1 + mu2 + lambda)*p11 ==
lambda*p01 + lambda*p10 + (mu1 + mu2)*p111, (mu1 + mu2 + lambda)*
p111 == lambda*p11 + (mu1 + mu2)*p112, (mu1 + mu2 + lambda)*
p112 == lambda*p111 + (mu1 + mu2)*p113}, {p01, p10, p11, p111,
p112, p113}];
sol = % /. {lambda -> \[Lambda], mu1 -> Subscript[\[Mu], 1],
mu2 -> Subscript[\[Mu], 2]}
lhs = p01 + p10 + p11 +
Sum[(p00 \[Lambda]^n (\[Lambda] + Subscript[\[Mu], 2]))/(
Subscript[\[Mu], 1] Subscript[\[Mu],
2] (Subscript[\[Mu], 1] + Subscript[\[Mu], 2])^(
n - 2) (2 \[Lambda] + Subscript[\[Mu], 1] + Subscript[\[Mu],
2])), {n, 3, Infinity}] /. sol
Solve[lhs == 1, p00]
$$ \left\{\left\{\text{p01}\to \frac{\lambda ^2 \text{p00}}{\mu _2 \left(2 \lambda +\mu _1+\mu _2\right)},\text{p10}\to \frac{\text{p00} \left(\lambda ^2+\lambda \mu _1+\lambda \mu _2\right)}{\mu _1 \left(2 \lambda +\mu _1+\mu _2\right)},\text{p11}\to \frac{\lambda ^2 \text{p00} \left(\lambda +\mu _2\right)}{\mu _1 \mu _2 \left(2 \lambda +\mu _1+\mu _2\right)},\text{p111}\to \frac{\lambda ^3 \text{p00} \left(\lambda +\mu _2\right)}{\mu _1 \mu _2 \left(\mu _1+\mu _2\right) \left(2 \lambda +\mu _1+\mu _2\right)},\text{p112}\to \frac{\lambda ^4 \text{p00} \left(\lambda +\mu _2\right)}{\mu _1 \mu _2 \left(\mu _1+\mu _2\right){}^2 \left(2 \lambda +\mu _1+\mu _2\right)},\text{p113}\to \frac{\lambda ^5 \text{p00} \left(\lambda +\mu _2\right)}{\mu _1 \mu _2 \left(\mu _1+\mu _2\right){}^3 \left(2 \lambda +\mu _1+\mu _2\right)}, \cdots \right\}\right\} $$
$$ \text{p00}\to \frac{1}{\frac{\lambda ^2}{\mu _2 \left(2 \lambda +\mu _1+\mu _2\right)}+\frac{\lambda ^2 \left(\lambda +\mu _2\right)}{\mu _1 \mu _2 \left(2 \lambda +\mu _1+\mu _2\right)}+\frac{\lambda ^2+\lambda \mu _1+\lambda \mu _2}{\mu _1 \left(2 \lambda +\mu _1+\mu _2\right)}+\frac{\lambda ^4+\lambda ^3 \mu _2}{\mu _1 \mu _2 \left(-\lambda +\mu _1+\mu _2\right) \left(2 \lambda +\mu _1+\mu _2\right)}} $$
Reference
ContinuousMarkovProcess
documentation