## 3 System Model
### Cluster Head Election Phase  
The optimal probability of a node to become a CH is equivalent to the optimal construction of clusters. This clustering is optimal in the sense that energy consumption is well distributed over all sensors and the total energy consumption is minimal. Such optimal clustering highly depends on the energy model that we use. In EDACP-CS, the nodes with less energy than the others and the nodes with more distance from the BS than the others have the smallest chance to be selected as a CH for current round. Let us assume \(E_{0}\) is the initial energy of each normal sensor node, \(m\) is the fraction of advanced nodes among normal nodes which are equipped with \(\alpha\) times more energy than the normal nodes, and \(m_{0}\) is the fraction of super nodes among advanced nodes which are equipped with \(\beta\) times more energy than the normal nodes. Note a new heterogeneous setting has no affect on the spatial density of the network so the setting of \(p_{opt}\) does not change. On the other hand, due to heterogeneous nodes the net energy of the network is changed as the initial energy of each super node becomes \(E_{0}(1+\beta)\) and each advanced node becomes \(E_{0}(1+\alpha)\). Therefore, the total (initial) energy of the new heterogeneous setting is given by Equation (19):  
\[Total\ Energy\ =N*E_{0}(1+m(\alpha-m_{0}(\alpha-\beta))), \tag{19}\]Hence, the total energy of the system is increased by a factor of \(\upmu=(1+m(\upalpha-m_{0}(\upalpha-\upbeta)))\) In order to optimize the stable region of the system, the new epoch must become equal to \((\frac{1}{p_{opt}})\upmu\) because the system has \(m(\upalpha-m_{0}(\upalpha-\upbeta))\) times more energy. Virtually there are \(N\times\upmu\) nodes with energy equal to the initial energy of a normal node. In order to maintain the minimum energy consumption in each round within an epoch, the average number of CHs per round per epoch must be constant and equal to \(N\times p_{opt}\). In the heterogeneous scenario the average number of CHs per round per epoch is equal to \(\mu\times N\times p_{nrm}\) (because each virtual node has the initial energy of a normal node). Therefore, the weighed probabilities for normal, advanced and super nodes according to residual energy and the distance from the BS are, respectively:  
If distance \(D_{i}\leq D_{avg}\) we take:  
\[p_{nrm}=\frac{p_{opt}}{\upmu}\left(1-\frac{D_{i}}{D_{avg}}\right), \tag{20}\]  
\[p_{adv}=\frac{p_{opt}}{\upmu}\times(1+\upalpha)\left(1-\frac{D_{i}}{D_{avg}} \right), \tag{21}\]  
\[p_{sup}=\frac{p_{opt}}{\upmu}\times(1+\upbeta)\left(1-\frac{D_{i}}{D_{avg}} \right). \tag{22}\]  
Else we keep:  
\[p_{nrm}=\frac{p_{opt}}{\upmu}, \tag{23}\]  
\[p_{adv}=\frac{p_{opt}}{\upmu}\times(1+\upalpha), \tag{24}\]  
\[p_{sup}=\frac{p_{opt}}{\upmu}\times(1+\upbeta). \tag{25}\]  
In Equation (1), we replace \(p_{opt}\) by the weighted probabilities to obtain the threshold that is used to elect the CH in each round. We define \(Ts_{nrm}\) as the threshold for normal nodes, \(Ts_{adv}\) the threshold for advanced nodes and \(Ts_{sup}\) the threshold for super nodes. Thus, for normal nodes, we have:  
\[Ts_{nrm}= \begin{cases}\frac{p_{nrm}}{(1-p_{nrm}\times(r\ mod(1/p_{nrm})))}& \text{if }s_{nrm}\in G^{{}^{\prime}},\\ 0&otherwise,\end{cases}  \tag{26}\]  
where \(r\) is the current round, \(G^{{}^{\prime}}\) is the set of normal nodes that have not become CHs within the last \(1/p_{nrm}\) rounds of the epoch, and \(Ts_{nrm}\) is the threshold applied to a population of \(N(1-m)\) normal nodes. This guarantees that each normal node will become a CH exactly once every \((\frac{1}{p_{opt}})\upmu\) rounds per epoch, and that the average number of CHs that are normal nodes per round per epoch is equal to \(N(1-m)\times p_{nrm}\) Similarly, for advanced and super nodes, we have:  
\[Ts_{adv}= \begin{cases}\frac{p_{adv}}{(1-p_{adv}\times(r\ mod(1/p_{adv})))}& \text{if}s_{adv}\in G^{{}^{\prime\prime}},\\ 0&otherwise.\end{cases}  \tag{27}\]  
\[Ts_{sup}=