LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
CTMCSolve.m
1% pi = CTMCSolve(Q)
2%
3% Computes the stationary solution of a continuous time
4% Markov chain.
5%
6% Parameters
7% ----------
8% Q : matrix, shape (M,M)
9% The generator matrix of the Markov chain
10%
11% Returns
12% -------
13% pi : row vector, shape (1,M)
14% The vector that satisfies `\pi\, Q = 0, \sum_i \pi_i=1`
15%
16% Notes
17% -----
18% The procedure raises an exception if :code:`checkInput`
19% is set to :code:`true` and :func:`CheckGenerator` (Q) fails.
20
21function pi = CTMCSolve(Q)
22
23 global BuToolsCheckInput;
24 if isempty(BuToolsCheckInput)
25 BuToolsCheckInput = true;
26 end
27
28 if BuToolsCheckInput && ~CheckGenerator(Q, false)
29 error('CTMCSolve: The given matrix is not a valid generator. If you are sure you want this use CRPSolve instead of CTMCSolve.');
30 end
31
32 pi = CRPSolve (Q);
33end
34