1function [ T, S, A_jump, S_Arr, sum_Ajump ] = computeT(arrival, services, service_h, C, T_Mode)
3% The function calculates T matrix of Equation (2) using both methods in
4% Section 5.1: the Sylvester-equation approach (Sylv) and
5% 5.2: A Riccati-equation approach (NARE): (default: 'NARE')
6% 'Sylves' : solves a Sylvester matrix equation at each step
7% using a Hessenberg algorithm
8% 'NARE ' : solves the Sylvester matrix equation by defining
9% a non-symmetric algebraic Riccati equation (NARE)
13% arrival
is a structure
14% that must contain arrival.lambda0 and arrival.lambda1
15% where lambda0
is the intensity-matrix for state changes
16% in the arrival process not accompanied by arrivals and
17% lambda1
is the intensity-matrix for state changes
18% accompanied by arrivals.
20% service
is a structure array where the number of structures equals
21% the number of servers and a structure contains beta and S
22% where service(i).beta and service(i).S corresponds to the representation
23% (beta,S) for the servicetime of the i'th server.
25% S: without a new Fj job starting service;
26% A_jump: with a new FJ job starting service;
28[ S, A_jump ] = build_SA( services, service_h, C );
30d0 = size(arrival.lambda0,1);
31S_Arr = kron(S,eye(d0));
32A_jump_Arr = kron(A_jump,speye(d0));
34if (strfind(T_Mode,'Sylvest')>0)
35 % The Sylvester-equation approach (Sylv)
39 Tnew = S_Arr; % withour service completion
41 ID0 = kron(eye(ms),arrival.lambda0);
42 DS = kron(eye(ms),arrival.lambda1)*A_jump_Arr;
43 [U,Tr] = schur(ID0,'complex');
45 while(max(max(abs(Told-Tnew)))>10^(-10))
47 L = Q_Sylvest(U,Tr,Tnew);
51 res_norm=norm(T*L+L*kron(eye(ms),arrival.lambda0)+eye(m),inf);
52 fprintf('Final Residual Error for T matrix: %d\n',res_norm);
57 T = computeT_NARE(arrival.lambda0, arrival.lambda1, S_Arr, A_jump);
61sum_Ajump = sum(A_jump_Arr,2);