LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
fj_xmax_exp.m
1%{ @file fj_xmax_exp.m
2 % @brief Expected maximum of K i.i.d. exponential random variables
3 %
4 % @author LINE Development Team
5%}
6
7%{
8 % @brief Expected maximum of K i.i.d. exponential random variables
9 %
10 % @details
11 % Computes the expected value of the maximum of K independent and
12 % identically distributed exponential random variables with rate mu
13 % (mean service time x = 1/mu).
14 %
15 % X_K^max = H_K / mu = H_K * x
16 %
17 % where H_K is the K-th Harmonic number.
18 %
19 % This is a fundamental quantity in Fork-Join analysis. For a split-merge
20 % (SM) queueing system, the maximum throughput is lambda_K^SM = 1 / X_K^max.
21 %
22 % For large K, X_K^max ≈ (ln(K) + gamma) / mu, where gamma ≈ 0.57721 is
23 % the Euler-Mascheroni constant.
24 %
25 % @par Syntax:
26 % @code
27 % Xmax = fj_xmax_exp(K, mu)
28 % @endcode
29 %
30 % @par Parameters:
31 % <table>
32 % <tr><th>Name<th>Description
33 % <tr><td>K<td>Number of parallel servers (positive integer)
34 % <tr><td>mu<td>Service rate (mean service time is 1/mu)
35 % </table>
36 %
37 % @par Returns:
38 % <table>
39 % <tr><th>Name<th>Description
40 % <tr><td>Xmax<td>Expected maximum service time X_K^max = H_K / mu
41 % </table>
42 %
43 % @par Reference:
44 % A. Thomasian, "Analysis of Fork/Join and Related Queueing Systems",
45 % ACM Computing Surveys, Vol. 47, No. 2, Article 17, July 2014.
46 % Page 17:2 and Eq. (10) on page 17:11.
47%}
48function Xmax = fj_xmax_exp(K, mu)
49
50if K < 1
51 line_error(mfilename, 'K must be a positive integer. Got K=%d.', K);
52end
53
54if mu <= 0
55 line_error(mfilename, 'Service rate mu must be positive. Got mu=%.4f.', mu);
56end
57
58% Compute harmonic number H_K
59H_K = fj_harmonic(K);
60
61% Expected maximum: X_K^max = H_K / mu
62Xmax = H_K / mu;
63
64end