# Dynamic Spectrum Access for Internet of Things Service in Cognitive Radio-Enabled LPWANs
## 5 Numerical Analysis
### Analytic Model  
We consider the wireless network system serving two types of radio calls for both primary user (PU) and secondary cognitive user (CU), respectively. The entire spectrum consists of \(M\) sub-band units. Each PU uses its own band consisting of \(m\) sub-bands (\(m<M\)) and each CU uses only one sub-band, and all sub-band units assigned to PU connection are occupied and released together. We assume that PU type (type 1) and CU type (type 2) calls arrive according to a Poisson process with mean arrival rate \(\lambda_{k}\) for type \(k\) (\(k=1\), 2) calls, and that service time is exponentially distributed with a mean service time of \({\mu_{k}}^{-1}\) for type \(k\) calls. Then, the system can be modeled as a two-dimensional Markov process,  
Figure 4: Dynamic spectrum access model for two types of radio systems. characterized by \(\{n_{1}(t),\ n_{2}(t)\}\) where \(n_{1}(t)\) and \(n_{2}(t)\) are the numbers of PU and CU calls in the system at time \(t\), respectively, and the state space is represented by the set \(\{s(n_{1},n_{2})|\ 0\leq n_{1}\leq c_{1},\ n_{2}\ \geq 0\}\). Also, let the steady state probability that the system is in state \(s(n_{1}\,n_{2})\) be \(p(n_{1},n_{2})\). The steady state probability vector \(p\) (ordered lexicographically) is then partitioned as \(p=(p_{0},p_{1},\cdots)\) where \(p_{i}=(p(0,\ i),p(1,i),\cdots,p(c_{1},i))\), for \(i=0,\ 1,\ 2,\ \cdots\). The vector \(p\) is the solution of equations \(pQ=0\) and \(pe=1\), where \(e\) and \(0\) are vectors of all ones and zeros, respectively. We can obtain the transition rate matrix \(Q\) of the Markov process, which is of the block-partitioned form for the proposed model and can be formulated as quasi-birth-and-death processes (QBDs). In order to make analyses of the model, matrix-geometric solutions can be applied, which are also described in Appendix A[41; 42]. A state diagram of the system under the proposed strategy with \(M=13\), \(m=3\), \(c_{1}=4\), and \(r=7\) is shown in Figure 5, where \(k(n)=(M-n\cdot m)\). From this figure, we can obtain the following transition rate matrix \(Q\) of the Markov process for the general system under the proposed strategy:  
\[Q=\left[ \begin{array}{ccccc}A_{0}&D&&&&\\ B_{1}&A_{1}&D&&&\\ &\cdot&\cdot&\cdot&&&\\ &&\cdot&\cdot&\cdot&\\ &&B_{r-1}&A_{r-1}&D&&\\ &&&B_{r}&A_{r}&D&\\ &&&\cdot&\cdot&\cdot&\cdot\end{array} \right] \tag{1}\]  
where the sub-matrices are defined for \(i,j=0\), \(1\), \(\cdots\), \(c_{1}\) and \(l=0\), \(1\), \(\cdots\), \(r\) (\(m\cdot c_{1}+r\geq M\)) by  
\[\mathrm{A}_{l}(i,j)=\left\{ \begin{array}{c}\lambda_{1}\ \text{if}\ i=j-1\\ (j+1)\mu_{1}\ \text{if}\ i=j+1\\ \text{a}_{l}(i)\ \text{if}\ i=j\\ 0\ \text{otherwise}\end{array} \right. \tag{2}\]  
\[\mathrm{B}_{l}(i,j)=\left\{ \begin{array}{c}\min(l,\ M-i\cdot m)\mu_{2}\ \text{if}\ i=j\\ 0\ \text{otherwise}\end{array} \right. \tag{3}\]  
\[\mathrm{D}(i,j)=\left\{ \begin{array}{c}\lambda_{2}\ \text{if}\ i=j\\ 0\ \text{otherwise}\end{array} \right. \tag{4}\]  
where \(a_{l}(i)\) is the value that makes the sum of the row elements of \(Q\) to be equal to zero, and \(k(n)=(M-n\cdot m)\). To solve the equations \(pQ=0\) and \(pe=1\) with this transition rate matrix \(Q\), we also apply [PERSON]'s solution process [41] to the matrix \(Q\). Let us first consider the stability of the system. The system is stable when the process \(Q\) is positive recurrent, i.e., \(\pi B_{r}e>\pi De\), where \(\pi\) is the stationary probability vector of \(A_{r}+B_{r}+D=0\). Intuitively, the system is stable under the condition (\(\lambda_{2}<r\mu_{2}\)). Next, we determine the minimal non-negative matrix \(R\) of the matrix equation \(R^{2}B_{r}+RA_{r}+D=0\) by iteration. Iterations can be made directly until \(max_{(i,\ j)}\left[R_{i,j}(n+1)-R_{i,\ j}(n)\right]<\epsilon\) is satisfied, where \(R(n)\) is the \(n\)th iteration and \(\epsilon\) is the degree of accuracy required. This matrix \(R\) gives the relationship \(p_{k}=p_{k-1}R^{k-r+1}\), \(k\geq r\).