1function [meanAoI, varAoI, peakAoI] = aoi_fcfs_dm1(tau, mu)
2%AOI_FCFS_DM1 Mean, variance, and peak AoI
for D/M/1 FCFS queue
4% [meanAoI, varAoI, peakAoI] = aoi_fcfs_dm1(tau, mu)
6% Computes
the Age of Information metrics
for a D/M/1 queue with
7% First-Come First-Served (FCFS) discipline.
9% D/M/1: Deterministic arrivals with interarrival time tau (rate 1/tau),
10% exponential service with rate mu.
13% tau (
double): Deterministic interarrival time
14% mu (double): Service rate (exponential service)
17% meanAoI (double): Mean (average) Age of Information
18% varAoI (double): Variance of Age of Information
19% peakAoI (double): Mean Peak Age of Information
21% Formulas (from Inoue et al., IEEE Trans. IT, 2019):
22% Uses GI/M/1 FCFS results with deterministic arrivals.
23% For D/M/1,
the key parameter
is sigma,
the root of:
24% sigma = exp(-mu*tau*(1-sigma))
25% which gives
the probability an arriving customer finds system non-empty.
28% Y. Inoue, H. Masuyama, T. Takine, T. Tanaka,
"A General Formula for
29% the Stationary Distribution of the Age of Information and Its
30% Application to Single-Server Queues," IEEE Trans. Information Theory,
31% vol. 65, no. 12, pp. 8305-8324, 2019.
33% See also: aoi_fcfs_mm1, aoi_fcfs_gim1, aoi_lcfspr_dm1
35% Copyright (c) 2012-2026, Imperial College London
40 line_error(mfilename,
'Interarrival time tau must be positive');
43 line_error(mfilename,
'Service rate mu must be positive');
47% For D/M/1: lambda = 1/tau, so rho = 1/(tau*mu)
53 line_error(mfilename,
'System unstable: rho = 1/(tau*mu) = %.4f >= 1', rho);
56% Compute sigma: unique root in (0,1) of sigma = exp(-mu*tau*(1-sigma))
57% This
is the probability an arriving customer finds
the server busy
58% Use fixed-point iteration or fzero
59sigma_func = @(s) exp(-mu * tau * (1 - s)) - s;
60sigma = fzero(sigma_func, [0.001, 0.999]);
62% For GI/M/1,
the system delay (waiting + service) has LST:
63% D*(s) = (1-sigma)*mu / (mu - s) for s < mu
64% E[D] = 1/mu + sigma/(mu*(1-sigma)) = 1/(mu*(1-sigma))
66E_D = 1 / (mu * (1 - sigma));
68% Mean interarrival time (deterministic)
71% Mean AoI for D/M/1 FCFS (exact)
72% With deterministic interarrivals Y = tau
the interarrival/system-time
73% correlation term vanishes, so E[A] = E[Y^2]/(2*E[Y]) + E[D]
74% = tau/2 + 1/(mu*(1-sigma)) (validated against simulation)
75meanAoI = tau / 2 + E_D;
78% E[Apeak] = E[Y] + E[D] = tau + 1/(mu*(1-sigma))
82% For D/M/1,
the variance depends on
the system delay variance and
83%
the deterministic interarrival (which contributes 0 variance).
84% E[D^2] = 2/(mu*(1-sigma))^2 for exponential service with GI/M/1 structure
85E_D2 = 2 / (mu * (1 - sigma))^2;
88% Var[Y] = 0 (deterministic)
89% Approximate variance of AoI (needs exact formula from paper)
90varAoI = Var_D + (sigma / (mu * (1-sigma)))^2;
92% Ensure non-negative variance (numerical safety)