LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
FluFluSTD.m
1function [alpha, A] = FluFluSTD (Qin, Rin, Qout, Rout, srv0stop, transToPH)
2
3 if ~exist('transToPH','var')
4 transToPH = false;
5 end
6
7 % solve special fluid queue
8 Iin = eye(size(Qin));
9 Iout = eye(size(Qout));
10
11 Rh = kron(Rin,Iout) - kron(Iin,Rout);
12 Qh = kron(Qin, Rout) + kron(Rin, Qout);
13 [massh, inih, Kh, cloh] = GeneralFluidSolve (Qh, Rh);
14
15 % sojourn time density in case of
16 % srv0stop = false: inih*expm(Kh*x)*cloh*kron(Rin,Iout)/lambda
17 % srv0stop = true: inih*expm(Kh*x)*cloh*kron(Rin,Rout)/lambda/mu
18
19 lambda = sum(CTMCSolve(Qin)*Rin);
20 mu = sum(CTMCSolve(Qout)*Rout);
21
22 if transToPH
23 % convert result to PH representation
24 Delta = diag(linsolve(Kh',-inih')); % Delta = diag (inih*inv(-Kh));
25 A = inv(Delta)*Kh'*Delta;
26 if ~srv0stop
27 alpha = sum(Delta*cloh*kron(Rin,Iout)/lambda,2)';
28 else
29 alpha = sum(Delta*cloh*kron(Rin,Rout)/lambda/mu,2)';
30 end
31 else
32 % convert result to ME representation
33 if ~srv0stop
34 B = TransformToOnes(sum(cloh*kron(Rin,Iout)/lambda,2));
35 else
36 B = TransformToOnes(sum(cloh*kron(Rin,Rout)/lambda/mu,2));
37 end
38 iB = inv(B);
39 A = B*Kh*iB;
40 alpha = inih*inv(-Kh)*iB;
41 end
42end
43