LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
qbd_depproc_etaqa.m
1%{ @file qbd_depproc_etaqa.m
2 % @brief Constructs MAP departure process for MAP/MAP/1-FCFS via ETAQA truncation
3 %
4 % @author LINE Development Team
5%}
6
7%{
8 % @brief Builds a MAP approximation of the departure process for a MAP/MAP/1 FCFS queue
9 %
10 % @details
11 % This function constructs a finite-state MAP {D0, D1} representation of the
12 % departure process from a MAP/MAP/1 queue with FCFS discipline, using ETAQA
13 % truncation at QBD level n. The resulting MAP captures both the SCV (squared
14 % coefficient of variation) and autocorrelation structure of inter-departure
15 % times.
16 %
17 % The QBD process is formed with forward matrix F = kron(MAPa{2}, I_ns),
18 % local matrix L = krons(MAPa{1}, MAPs{1}), and backward matrix
19 % B = kron(I_na, MAPs{2}). Levels 0..n-1 are represented explicitly, and
20 % level n uses a tail approximation via the G matrix.
21 %
22 % @par Syntax:
23 % @code
24 % D = qbd_depproc_etaqa(MAPa, MAPs, n)
25 % @endcode
26 %
27 % @par Parameters:
28 % <table>
29 % <tr><th>Name<th>Description
30 % <tr><td>MAPa<td>Arrival process in MAP format {D0, D1}
31 % <tr><td>MAPs<td>Service process in MAP format {D0, D1}
32 % <tr><td>n<td>Truncation level (number of QBD levels to represent explicitly)
33 % </table>
34 %
35 % @par Returns:
36 % <table>
37 % <tr><th>Name<th>Description
38 % <tr><td>D<td>Departure process in MAP format {D0, D1}
39 % </table>
40%}
41function [D]=qbd_depproc_etaqa(MAPa,MAPs,n)
42
43na = length(MAPa{1});
44ns = length(MAPs{1});
45lvlsz = ns*na;
46
47F = kron(MAPa{2},eye(ns));
48L = krons(MAPa{1},MAPs{1});
49B = kron(eye(na),MAPs{2});
50L0 = kron(MAPa{1},eye(ns));
51
52[~,R,~] = QBD_CR(B,L,F);
53G = inv(-L-R*B)*B;
54Lhat = F+L;
55Bbar = B+F*G;
56Bhat = F*G;
57
58vn1 = ones(1,n-1);
59vn = zeros(1,n); vn(end)=1;
60
61D0=kron(diag([1,vn1]),L)+kron(diag(vn1,1),F);
62D0=[zeros(size(L0,1),size(D0,2)); D0];
63D0 = [zeros(size(D0,1),size(B,2)),D0];
64D0(1:size(L0,1),1:(size(L0,2)+size(F,2)))=[L0,F];
65D0(((n-1)*lvlsz+1):n*lvlsz,((n-1)*lvlsz+1):n*lvlsz)=Lhat;
66
67D1=kron(diag(vn,-1),Bbar)+kron(diag([0,vn]),Bhat);
68D1(1:n*lvlsz,1:n*lvlsz)=kron(diag(vn1,-1),B);
69D={D0,D1};
70end