3 % @file pfqn_procomom2.m
4 % @brief Product-
form CoMoM
for 2-station repairman model (queue + delay).
10 % @brief Product-
form CoMoM
for 2-station repairman model (queue + delay).
11 % @fn pfqn_procomom2(L, N, Z, mu, m)
12 % @param L Service demand vector.
13 % @param N Population vector.
14 % @param Z Think time vector.
15 % @param mu Load-dependent rates (optional).
16 % @param m Replication
factor (
default: 1).
17 % @return pk Marginal state probabilities.
18 % @return lG Logarithm of normalizing constant.
19 % @return G Normalizing constant.
20 % @return T Transfer matrices.
21 % @return F Product transfer matrix.
22 % @return B Combined transfer matrix.
25function [pk,lG,G,T,F,B]=pfqn_procomom2(L,N,Z,mu,m)
26% Marginal state probabilities for the queue in a model consisting of a
27% queueing station and a delay station only.
29% m must be defaulted BEFORE the mu block, which reads it. With the two blocks
30% in the opposite order every call with fewer than five arguments died on an
31% undefined m (
"Not enough input arguments"), so the 3- and 4-argument forms
32% advertised in the header above were dead.
36if nargin<4 || isempty(mu)
37 mu = ones(m,sum(N)+1);
42% compute solution for [1,0,0,...,0]
43p0 = zeros(sum(N)+1,1); p0(end)=1;
47 T{r} = sparse(1+sum(N),1+sum(N));
51 T{r}(row,row+1) = (n+m-1)*L(r)/mu(1+n);
53 T{r}(sum(N)+1,sum(N)+1) = Z(r);
58 F = F*T{r}^N(r)/factorial(N(r));
63% The former middle branch (elseif ~isfinite(G)) was unreachable: the first
64% condition already contains ~isfinite(G).
65if any(~isfinite(pk(1,1))) || ~isfinite(G)
66 lG = logsumexp(log(pk(1,:)));