1function varargout=qsys_mginf(lambda,mu,varargin)
2% [L,Lq,W,Wq,p0]=QSYS_MGINF(LAMBDA,MU)
3% [L,Lq,W,Wq,p0,pk]=QSYS_MGINF(LAMBDA,MU,K)
5% Exact solution
for M/G/∞ queue (infinite servers).
6% Performance
is independent of the service time distribution shape (G).
7% The number of customers in the system follows a Poisson distribution.
10% lambda - arrival rate
11% mu - service rate (mean service time = 1/mu)
12% K (optional) - state
for probability computation
15% L - average number of customers in system
16% Lq - average number of customers in queue (always 0)
17% W - average time in system (= 1/mu)
18% Wq - average waiting time in queue (always 0)
19% p0 - probability of empty system
20% pk (optional) - probability of exactly k customers in system
24% Exact results
for M/G/∞
25L = rho; % Average number of customers = average busy servers
26Lq = 0; % No queue since infinite servers
27W = 1 / mu; % Average time = service time (independent of arrival process)
28Wq = 0; % No waiting time
29p0 = exp(-rho); % Empty system probability (Poisson distribution)
31% Always
return 5 outputs
38% If k
is provided, compute and
return P(k customers in system)
41 pk = exp(-rho) * rho^k / factorial(k);