## 5 Simulation and Results Analysis  
In this section, we perform simulations in MATLAB to evaluate the performance of both EDCA-H and other protocols. There are 100 sensor nodes randomly distributed in the 100 m \(\times\) 100 m area. The base station is located at the top of the sensing area with the distance of 75 m. The base station and all the sensor nodes are assumed to be fixed. None of the sensor nodes are equipped with devices for detecting their own locations and their own location may be estimated with some localization algorithms. All the sensor nodes are homogeneous with limited energy. In the simulations of this section, let \(E_{ec}\) = 50 nJ/bit, \(E_{fs}\) = 10 pJ/bit/m\({}^{2}\), \(E_{mp}\) = 0.0013 pJ/bit/m\({}^{4}\), \(\theta\) = 0.75 and \(\eta\) = 2.5. In order to compare with other protocols, the impact of collisions and radio channels from signal interference caused by random factors is neglected. We will compare the performance of EDCA-H, LEACH-C [9], SEP [15], DCHS [23] and other protocols. As the parameter \(\rho\) increases, the gap of the initial energy among the different type of nodes is large, and it leads to sensors with a high level of energy being superior during the CH competition phase. After the formation of the clusters, a cluster head usually consumes much more energy than non-cluster nodes. Due to the energy divergence in heterogeneous wireless sensor networks, it is necessary to increase the number of clusters to balance the residual energy of different types of cluster head. Hence, this will prolong the network lifetime. Figure 1 shows the relationship between the number of clusters and the total energy consumption in each round. From the experimental results, we can observe that the cluster heads will all display high initial node energy with the growth of the parameter \(\alpha\). In Figure 1, the number of cluster heads will tend to the same value and the number of clusters of the optimization theory can be obtained as 11. This confirms that the optimal number of cluster heads can achieve the objective of minimizing network energy consumption in each round. For two-level heterogeneity, we evaluate the performance of the different protocols by varying the parameters \(\gamma\) and \(\rho\). Figure 2 shows the comparison of rounds until the first node died as \(\gamma\)  
Figure 1: The relationship between the number of CHs and average energy consumption in each round. increases from 0.2 to 0.8 and \(\rho\) increases from 0.5 to 5, respectively. As shown in the Figure 2, DCHS performs too smoothly indicating that DCHS does not make good use of the additional energy owing to the setting of parameters \(\rho\) and \(\gamma\). This performance demonstrates that it is not fit for heterogeneous environments, due to the fact it does not take into account the difference in energy and treats all nodes equally, regardless of whether their initial energy is the same or not. For the SEP protocol, we obtain the results that the stable period ratio is more than DCHS by about 25%. Although each node needs to know the residual energy of all nodes around the network for LEACH-E and this is not easy to achieve, \(t\) its performance is good in a heterogeneous network. Figure 3 shows that the stabilization period of LEACH-E exceeds that of SEP by about 10%. This is because LEACH-C takes into account the residual energy of the nodes during the selection of cluster heads in the set-up phase. EDCA-H is also a clustering protocol that considers of nodes' residual energy like LEACH-C, besides the coverage ratio of the nodes around the network, so it exhibits better performance than other protocols, and especially when \(\alpha\) changes, the stabilization period in EDCA-H is increased by nearly 20 percent compared to LEACH-C. Furthermore, we also examine the number of rounds until 10% of the nodes run out of energy. Before these nodes die, the data transmission to the base station can be of high quality and reliability. Figure 3 shows that EDCA-H can achieve a long stabilization period.