# Improvement of Perception Layer Routing Protocol with Static Nodes in IoT-Based Microgrids
## 3 System Models
### Algorithm Improvement under Static Nodes
#### 3.3.1 Cluster Radius Formula  
The cluster head connects to the nodes that communicate with the base station, with faster energy loss than that of the nodes within the cluster. The farther the cluster head is from the base station, the greater its energy consumption will be. Therefore, to reduce the overall energy consumption of the network, the number of those cluster heads in areas far away from the base station should be controlled as small as possible. At the same time, nodes need a larger cluster radius to select suitable cluster heads and send a joint request.  
Figure 3: Schematic diagram of energy model.  
On the contrary, the number of cluster heads in the area closer to the base station should be larger, and the cluster radius of the node should be smaller. First, based on the principle of the minimum average energy consumption in the cluster, a dynamic cluster radius formula is derived.  
The energy consumption in a cluster is chiefly composed of four aspects: \(E_{T_{0..BS}}\), the energy consumed by the cluster head for sending information to the base station, \(E_{T_{0..BS}};E_{A}\), the energy consumed for data fusion; \(E_{T_{0..Head}}\), the total energy consumed by each node in the cluster for transmitting information to the cluster head; \(E_{R}\), the energy consumed by the cluster head for receiving the information transmitted by each node.  
As a result, the energy consumed by the cluster head for sending information to the base station can be derived:  
\[E_{T_{0..BS}}=m\varepsilon D_{i}^{2}+mE_{PX}, \tag{3}\]  
where \(D_{i}\) denotes the distance from the node \(i\) to the base station, \(R_{i}\) denotes the cluster radius corresponding to the node \(i\), and \(m\) denotes the size of the data packet.  
The energy consumed by the cluster head for fusing \(m\) bits of data is:  
\[E_{A}=\pi\rho R_{i}^{2}mE_{DA}, \tag{4}\]  
where \(E_{DA}\) is the energy consumed by fusing a unit bit of data.  
\[E_{T_{0..Head}}=\int_{0}^{R_{i}}2\pi\tau\rho\left(mer^{2}+mE_{PX}\right) \mathrm{d}\tau=m\rho\pi\left(\frac{1}{2}\varepsilon R_{\mathrm{i}}^{4}+E_{PX} R_{\mathrm{i}}^{2}\right), \tag{5}\]  
where \(\rho\) represents the average density of nodes. In the proposed network model, the area where \(N\) nodes are distributed is a rectangle of \(M\times M\), and the average density \(\rho\) of randomly scattered nodes can be expressed as:  
\[\rho=\frac{N}{M\times M}. \tag{6}\]  
on the other hand, the energy consumed by the cluster head for receiving the information transmitted by each node is:  
\[E_{R}=\left(\tau\rho R_{i}^{2}-1\right)mE_{RX}. \tag{7}\]  
From the above, the total energy consumption \(E_{\mathrm{Cluster}}\) of the cluster is expressed as:  
\[\begin{split} E_{\mathrm{Cluster}}&=E_{T_{0..Head }}+E_{R}+E_{A}+E_{T_{0..BS}}\\ &=m\rho\pi R_{i}^{2}\\ &\left(\frac{1}{2}\varepsilon R_{\mathrm{i}}^{2}+E_{PX}+E_{RX}+ \frac{\varepsilon\mathrm{D}_{i}^{2}+E_{PX}-E_{RX}}{\pi\rho R_{\mathrm{C}}^{2}} +E_{DA}\right).\end{split} \tag{8}\]  
Therefore, the average energy consumption \(\overline{E_{\mathrm{Node}}}\) of nodes within the cluster can be obtained:  
\[\overline{E_{\mathrm{Node}}}=\frac{E_{\mathrm{Cluster}}}{\rho\pi R_{i}^{2}}=m \left(\frac{1}{2}\varepsilon R_{\mathrm{i}}^{2}+E_{PX}+E_{RX}+\frac{ \varepsilon\mathrm{D}_{i}^{2}+E_{PX}-E_{RX}}{\pi\rho R_{i}^{2}}+E_{DA}\right). \tag{9}\]  
According to Formula (9), the average energy consumption of the nodes within the cluster, if the average energy consumption of the nodes is to be minimized, the cluster radius should take the value:  
\[R_{i}=\sqrt{\frac{2\left(\varepsilon D_{i}^{2}+E_{PX}-E_{RX}\right)}{ \varepsilon\rho\pi}}. \tag{10}\]