1function [W,rhohat]=qsys_gigk_approx_whitt(lambda,mu,ca,cs,k)
2% [W,RHOHAT]=QSYS_GIGK_APPROX_WHITT(LAMBDA,MU,CA,CS,K)
4% G/G/k queue approximation
using Whitt
's QNA method.
5% Uses the Queue Network Analyzer (QNA) methodology to provide accurate
6% estimates for multi-server queues with general distributions.
10% MU - Service rate per server
11% CA - Coefficient of variation of inter-arrival time
12% CS - Coefficient of variation of service time
13% K - Number of servers
16% W - Average time in system (response time)
17% RHOHAT - Modified utilization (so that M/M/1 formulas still hold)
19% Copyright (c) 2012-2026, Imperial College London
24rho = lambda / (k * mu);
27W_mmk = qsys_mmk(lambda, mu, k);
32 htFactor = 1 + (4*(rho - 0.7))^2;
37% Variability correction factor (Whitt's g function)
38if ca2 >= 1 && cs2 >= 1
40elseif ca2 <= 1 && cs2 <= 1
41 phi = (1 - ca2) * (1 - cs2) / (1 + cs2);
42 g = 1 - phi * sqrt(k);
48Wq = Wq_mmk * ((ca2 + cs2) / 2) * g * htFactor;
54rhohat = W*lambda/(1+W*lambda); % so that M/M/1 formulas still hold