# Analytical Model for the Duty Cycle in Solar-Based EH-WSN for Environmental Monitoring
## 5 Simulations
### Tree-Based Topologies Validation
Moreover, even if a topological change had taken place, this does not necessarily mean that the total number of descendants of a given node had changed as well. The other parameter that causes differences between nodes is \(k\), which is unpredictable and uncontrollable as it depends on the asynchrony between the nodes in every transmitter-receiver pair. However, again with no loss of generality, we forced the stabilization of the parameter \(k\) of each node within the interval \([1,20]\); for this purpose, we used the simulator options -random-seed and -random-start, which ensure reproducible simulation results and avoid artificial cycle-level synchronization, respectively. As expected, the energy consumption grows with \(DC\), since a larger \(DC\) means more radio activity. On the other hand, we can also observe that leaf nodes exhibit less energy consumption compared to forwarder (intermediate) nodes, fact that is due to the lesser value of \(\sigma\) of the former. Figure 11 shows the energy consumed per round by every node in the 10-node network, as provided by Avora and the analytical model. For the computation of the energy consumption from the analytical model, we took the specific value of \(k\) required by each node from the Avrora simulation (recall that \(k\) is an input parameter in our model). The obtained results show an average deviation of our model with regard to the Avrora simulator below 4.8% for \(DC=3\%\) and 0.5% for \(DC=10\%\). The reason why the lower duty-cycle gives rise to a larger deviation is the presence of beacon messages, which are included in the energetic balance provided by Avrora but not in the analytical model: a lower duty-cycle means less communication activity and thus more impact of beacon messages in the overall evaluation of energy consumption. Figure 10: Energy consumption after the simulation of the 10-node topology, with \(DC=3\%\) (**left**) and \(DC=10\%\) (**right**), for 1, 2, 3, 10, 20 and 30 rounds. The experiments done with the 20-node network produced a data-gathering tree after a longer transient period. This is because CTP requires more time to create a topology when the network size is increased. Accordingly, we set up a larger simulation time. Figure 12 shows the resulting topologies, again for \(DC=3\%\) (on the left) and \(DC=10\%\) (on the right). For these topologies, Figure 13 shows the energy consumption reported by Avrora for 2, 3, 4, 10, 20 and 30 communication rounds. Similarly to the results obtained for the 10-node network, we observe a linear increase of energy consumption in terms of number of rounds; however, some nodes, like node 5 in the case of \(DC=3\%\) and node 11 in the case of \(DC=10\%\), exhibit a large deviation above the linear trend for some number of rounds; this is due to the fact that \(k\) and/or \(\sigma\) experienced sporadic and unpredictable changes at some time instants. While this is possible with both CTP and BoX-MAC, it does not represent the normal behavior and thus we believe that such deviations do not compromise the validity of the proposed model. As in the 10-node network, leaf nodes consume less energy than forwarding nodes. In order to better illustrate the variation of energy consumption among nodes, Figure 14 compares, for each node, the results obtained with our model against the results of Avrora. They correspond to 2 rounds of communication and both \(DC=3\%\) (on the left) and \(DC=10\%\) (on the right). In this case, the average deviation obtained for the two duty-cycles was approximately the same, on the order of \(3\%\). This is because with 20 nodes there is more communication activity in the network (\(\sigma\) is generally larger), fact that, in turn, diminishes the impact of beacons. Figure 11: Avrora vs. energy model comparison for the 10-nodes network with \(DC=3\%\) (on the left) and \(DC=10\%\) (on the right). Figure 12: 20-node topologies after simulation with \(DC=3\%\) (**left**) and \(DC=10\%\) (**right**).