LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
QBD_RAP_ParsePara.m
1function QBD_RAP_ParsePara(A0,A1,A2)
2%QBD_RAP_ParsePara checks the validity of the input matrices A0, A1 and A2
3%for a QBD with RAP components. The evaluated conditions are necessary but not
4%sufficient.
5
6% check numeric
7if (~isnumeric(A0))
8 error('MATLAB:QBD_RAP_ParsePara:InvalidInput',...
9 'A0 has to be numeric');
10end
11if (~isnumeric(A1))
12 error('MATLAB:QBD_RAP_ParsePara:InvalidInput',...
13 'A1 has to be numeric');
14end
15if (~isnumeric(A2))
16 error('MATLAB:QBD_RAP_ParsePara:InvalidInput',...
17 'A2 has to be numeric');
18end
19
20% check real
21if (~isreal(A0))
22 error('MATLAB:QBD_RAP_ParsePara:InvalidInput',...
23 'A0 has to be a real matrix');
24end
25if (~isreal(A1))
26 error('MATLAB:QBD_RAP_ParsePara:InvalidInput',...
27 'A1 has to be a real matrix');
28end
29if (~isreal(A2))
30 error('MATLAB:QBD_RAP_ParsePara:InvalidInput',...
31 'A2 has to be a real matrix');
32end
33
34% check dimension
35if (size(A0,1) ~= size(A0,2))
36 error('MATLAB:QBD_RAP_ParsePara:InvalidInput',...
37 'A0 is not a square matrix');
38end
39if (size(A1,1) ~= size(A1,2))
40 error('MATLAB:QBD_RAP_ParsePara:InvalidInput',...
41 'A1 is not a square matrix');
42end
43if (size(A2,1) ~= size(A2,2))
44 error('MATLAB:QBD_RAP_ParsePara:InvalidInput',...
45 'A2 is not a square matrix');
46end
47if (size(A0,1) ~= size(A1,1))
48 error('MATLAB:QBD_RAP_ParsePara:InvalidInput',...
49 'The matrices A0 and A1 do not have the same dimension');
50end
51if (size(A0,1) ~= size(A2,1))
52 error('MATLAB:QBD_RAP_ParsePara:InvalidInput',...
53 'The matrices A0 and A2 do not have the same dimension');
54end
55
56% check zero row sum
57if (max(sum(A0+A1+A2,2)) > 10^(-14)) || (min(sum(A0+A1+A2,2)) < -10^(-14))
58 error('MATLAB:QBD_RAP_ParsePara:InvalidInput',...
59 'The matrix A0+A1+A2 must have zero row sum');
60end
61
62%check dominant eigenvalue
63if (max(real(eig(A1))) > -10^(-14))
64 error('MATLAB:QBD_RAP_ParsePara:InvalidInput',...
65 'The dominant eigenvalue of the matrix A1 must have negative real part');
66end
67if (max(real(eig(A0+A1+A2))) > 10^(-14)) || (max(real(eig(A0+A1+A2))) < -10^(-14))
68 error('MATLAB:QBD_RAP_ParsePara:InvalidInput',...
69 'The dominant eigenvalue of the matrix A0+A1+A2 must have zero real part');
70end
71
72