1%{ @file qbd_depproc_etaqa.m
2 % @brief Constructs MAP departure process
for MAP/MAP/1-FCFS via ETAQA truncation
4 % @author LINE Development Team
8 % @brief Builds a MAP approximation of the departure process
for a MAP/MAP/1 FCFS queue
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
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.
24 % D = qbd_depproc_etaqa(MAPa, MAPs, n)
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)
37 % <tr><th>Name<th>Description
38 % <tr><td>D<td>Departure process in MAP format {D0, D1}
41function [D]=qbd_depproc_etaqa(MAPa,MAPs,n)
47F = kron(MAPa{2},eye(ns));
48L = krons(MAPa{1},MAPs{1});
49B = kron(eye(na),MAPs{2});
50L0 = kron(MAPa{1},eye(ns));
52[~,R,~] = QBD_CR(B,L,F);
59vn = zeros(1,n); vn(end)=1;
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;
67D1=kron(diag(vn,-1),Bbar)+kron(diag([0,vn]),Bhat);
68D1(1:n*lvlsz,1:n*lvlsz)=kron(diag(vn1,-1),B);