LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
qbd_R.m
1%{ @file qbd_R.m
2 % @brief Computes the rate matrix R using successive substitutions
3 %
4 % @author LINE Development Team
5%}
6
7%{
8 % @brief Computes QBD rate matrix R via successive substitutions
9 %
10 % @details
11 % This function computes the rate matrix R for a Quasi-Birth-Death (QBD)
12 % process using the successive substitutions method.
13 %
14 % @par Syntax:
15 % @code
16 % R = qbd_R(B, L, F)
17 % R = qbd_R(B, L, F, iter_max)
18 % @endcode
19 %
20 % @par Parameters:
21 % <table>
22 % <tr><th>Name<th>Description
23 % <tr><td>B<td>Backward transition block A_(-1)
24 % <tr><td>L<td>Local transition block A_0
25 % <tr><td>F<td>Forward transition block A_1
26 % <tr><td>iter_max<td>(Optional) Maximum iterations (default: 100000)
27 % </table>
28 %
29 % @par Returns:
30 % <table>
31 % <tr><th>Name<th>Description
32 % <tr><td>R<td>Rate matrix R
33 % </table>
34%}
35function R=qbd_R(B,L,F,iter_max)
36% Successive substitutions method
37if nargin<4
38 iter_max = 100000;
39end
40Fil = F * inv(L);
41BiL = B * inv(L);
42R = -Fil;
43Rprime = -Fil - R^2*BiL;
44for iter=1:iter_max
45 R = Rprime;
46 Rprime = -Fil -R^2*BiL;
47 if norm(R-Rprime,1)<=1e-12
48 break
49 end
50end
51R = Rprime;
52end