LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
qsys_gigk_approx_whitt.m
1function [W,rhohat]=qsys_gigk_approx_whitt(lambda,mu,ca,cs,k)
2% [W,RHOHAT]=QSYS_GIGK_APPROX_WHITT(LAMBDA,MU,CA,CS,K)
3%
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.
7%
8% Inputs:
9% LAMBDA - Arrival rate
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
14%
15% Returns:
16% W - Average time in system (response time)
17% RHOHAT - Modified utilization (so that M/M/1 formulas still hold)
18
19% Copyright (c) 2012-2026, Imperial College London
20% All rights reserved.
21
22ca2 = ca^2;
23cs2 = cs^2;
24rho = lambda / (k * mu);
25
26% Get M/M/k baseline
27W_mmk = qsys_mmk(lambda, mu, k);
28Wq_mmk = W_mmk - 1/mu;
29
30% Heavy traffic factor
31if rho > 0.7
32 htFactor = 1 + (4*(rho - 0.7))^2;
33else
34 htFactor = 1;
35end
36
37% Variability correction factor (Whitt's g function)
38if ca2 >= 1 && cs2 >= 1
39 g = 1;
40elseif ca2 <= 1 && cs2 <= 1
41 phi = (1 - ca2) * (1 - cs2) / (1 + cs2);
42 g = 1 - phi * sqrt(k);
43else
44 g = (ca2 + cs2) / 2;
45end
46
47% QNA formula
48Wq = Wq_mmk * ((ca2 + cs2) / 2) * g * htFactor;
49
50% Ensure non-negative
51Wq = max(Wq, 0);
52
53W = Wq + 1/mu;
54rhohat = W*lambda/(1+W*lambda); % so that M/M/1 formulas still hold
55
56end