LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
qbd_fundmat.m
1function varargout = qbd_fundmat(B, L, F, matrices, precision, maxNumIt)
2%QBD_FUNDMAT Cyclic-reduction fundamental matrices G (and optionally R) of a QBD.
3% Operates directly on the raw level blocks (B,L,F) of a homogeneous QBD and
4% supports complex-valued L (as required when L is shifted by -s*I in a
5% Laplace-domain transient analysis). This differs from QBD_RG, which builds
6% the blocks from MAP representations and is only exercised at real argument.
7%
8% VARARGOUT = QBD_FUNDMAT(B, L, F, MATRICES) returns the matrices named by
9% the character codes in MATRICES (default 'G'), in that order. Supported
10% codes: 'G', 'R', 'GR', 'RG'.
11%
12% The G matrix is obtained by cyclic reduction (Bini-Meini logarithmic
13% reduction); R is recovered from G as R = Fm*(I-(Lm+Fm*G))^-1.
14%
15% Copyright (c) 2012-2026, Imperial College London
16% All rights reserved.
17if nargin < 4 || isempty(matrices); matrices = 'G'; end
18if nargin < 5 || isempty(precision); precision = 1e-14; end
19if nargin < 6 || isempty(maxNumIt); maxNumIt = 50; end
20
21m = size(L, 1);
22II = eye(m);
23lamb = max(-real(diag(L)));
24Bm = B / lamb;
25Lm = L / lamb + II;
26Fm = F / lamb;
27
28BF = (II - Lm) \ II;
29BB = BF * Fm;
30BF = BF * Bm;
31G = BF;
32PI = BB;
33check = 1;
34numit = 0;
35while check > precision && numit < maxNumIt
36 Lstar = BF * BB + BB * BF;
37 Bstar = BB * BB;
38 Fstar = BF * BF;
39 BB = (II - Lstar) \ II;
40 BF = BB * Fstar;
41 BB = BB * Bstar;
42 G = G + PI * BF;
43 PI = PI * BB;
44 check = min(norm(BB, inf), norm(BF, inf));
45 numit = numit + 1;
46end
47
48R = [];
49outs = cell(1, length(matrices));
50for i = 1:length(matrices)
51 c = matrices(i);
52 if c == 'G'
53 outs{i} = G;
54 elseif c == 'R'
55 if isempty(R)
56 R = Fm * ((II - (Lm + Fm * G)) \ II);
57 end
58 outs{i} = R;
59 else
60 line_error(mfilename, sprintf('unknown matrix code ''%c'' in ''%s''', c, matrices));
61 end
62end
63varargout = outs;
64end
Definition Station.m:245