# Optimal Routing for Time-Driven EH-WSN under Regular Energy Sources
## 2 Energy Consumption Model
### Approximate Energy Consumption Model  
In this subsection, the model just described is generalized to any implementation of LPL or LPP. To start with, Equation (1) can be simplified by removing several terms that are very specific to the implementation of LPL in TinyOS and do not have a significant contribution. Accordingly, the following approximate energy consumption model can be derived:  
\[\varepsilon[E_{round}(X)]\cong\sigma(X)\cdot E_{rxpkt}+(\sigma(X)+1)\left( \varepsilon[k]\cdot E_{txpkt}+E_{l}^{DAR}\right)+E_{l}\frac{T_{rnd}}{T_{l}} \frac{DC(X)}{100}. \tag{4}\]  
In this equation, it has also been assumed that the number of duty cycles per communication round is very large compared to the amount of such duty cycles that are entailed to transmit or receive. This assumption is in agreement with the large reporting periods that typically characterize time-driven applications, though again it does not compromise the generality of the main results of this paper. The term \(DC(X)\) denotes the duty cycle of node \(X\) (expressed in percentage). On the other hand, the term \(\varepsilon[k]\) depends on the duty cycle of the parent node of node \(X\), namely \(DC(p(X))\). In effect, as it can be noticed from Figure 2, it is the dynamics of node B that determines the number of tries required by node A. The specific relationship between \(\varepsilon[k]\) and \(DC(p(X))\) for TinyOS nodes can be found in [14], but it has been omitted here as it is not relevant to the analysis that follows. Figure 3 shows the relative error between the exact model, given by Equation (1), and the approximate model is given by Equation (4), in terms of \(DC(X)\), for different values of \(DC(p(X)\). The rest of the parameters are given in Table 1. As it can be noticed, the relative error decreases as both duty cycles increase. Particularly, for duty cycles equal to or larger than 40%, the relative error is around 2%. As stated in Section 1, large (and heterogeneous) duty cycles are very common in EH-WSN, and thus the approximate energy consumption model can replace the exact one for TinyOS EH-WSN. To proceed with the generalization, we can start by reformulating Equation (4) as follows:  
\[\varepsilon[E_{round}(X)]\cong\sigma(X)\cdot E_{rxpkt}+(\sigma(X)+1)\cdot E_{ txpkt}+E_{l}\frac{T_{rnd}}{T_{l}}\frac{DC(X)}{100}+(\sigma(X)+1)\cdot E_{trigger}(X). \tag{5}\]  
Here, \(E_{trigger}(X)\) represents the energy wasted by the transmitter (node \(X\)) to trigger the communication with its receiver (node \(p(X)\)). For TinyOS nodes, it can be expressed as follows, where \(\varepsilon[n]\) denotes the expected number of (unsuccessful) transmission tries before a correct data packet is received:  
\[E_{trigger}(X)=\varepsilon[n]E_{txpkt}+E_{l}^{DAR}. \tag{6}\]  
A detailed analysis of Equation (5) reveals that all terms except the last one characterize the main sources of energy consumption in any time-driven duty-cycled sensor network, regardless of the particular platform. At the same time, specific implementation details about the triggering method can be assumed to be embedded into the variable \(E_{trigger}(X)\). Accordingly, Equation (5) becomes appropriate to model a large variety of LPL and even LPP-based MAC protocols, and hence it can be used to formulate the condition for energy neutral operation in the next section. For the sake of completeness, we can attempt to infer a more explicit but still general formulation for \(E_{trigger}(X)\). In the case of LPL-based MAC protocols, the following expression can be postulated: \begin{table}
\begin{tabular}{c c} \hline \hline
**Magnitude** & **Value** \\ \hline Bandwidth & 250 Kbps \\ \(T_{pkt}\) & 1.312 ms \\ \(T_{adc}\) & 0.544 ms \\ \(T_{CCA}\) & 0.4 ms \\ \(W_{ack}\) & 1 ms \\ \(T_{l}\) & 5 ms \\ \(DAR\) & 100 ms \\ \(T_{rnd}\) & 60 s \\ Voltage & 3 V \\ Current draw in RX & 18.8 mA \\ Current draw in TX (at 0 dBm) & 17.4 mA \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Parameters used in the validation of the approximate energy consumption model for LPL TinyOS nodes.