# Analytical Model for the Duty Cycle in Solar-Based EH-WSN for Environmental Monitoring
## 4 Analytical Energy Consumption Model
### Analytical Model
#### 4.2.2 Packet Forwarding
Figure 5: Evolution of \(E_{fd}\) in terms of the transmitter-receiver asynchrony, for \(T_{slp}\geq\alpha T_{c}+T_{pkt}\). \[E_{1}=E_{l}\frac{W_{ack}+T_{CCA}}{T_{l}} \tag{7}\] \[E_{2}=E_{rx}^{pkt}\frac{T_{pkt}-(T_{slp}-\alpha T_{c})}{T_{pkt}}+E_{l} \frac{W_{ack}+T_{CCA}}{T_{l}}\] (8) \[E_{2}^{\prime}=E_{l}\frac{T_{c}-(T_{slp}-\alpha T_{c})}{T_{l}}\] (9) \[E_{3}=E_{rx}^{pkt}+E_{l}\frac{W_{ack}+T_{CCA}}{T_{l}}\] (10) \[E_{R}(\mathrm{B})=E_{fd}+E_{rx}^{pkt}+E_{tx}^{ack}(d_{b}(\mathrm{B})) \tag{5}\]0  
Note that it has been assumed that \(E_{4}>E_{3}\) in Figures 4 and 5. This is true if power consumption in idle listening is equal to the power consumption in packet reception. However, if this is not the case, it could happen that \(E_{4}<E_{3}\) for sufficiently larger values of the power consumption in packet reception with regard to that in idle listening. Next, based on the knowledge of \(E_{fd}\) as a function of the transmitter-receiver asynchrony, and the fact that this asynchrony is uniformly distributed between 0 and \(T_{l}+T_{slp}\), we can derive the cumulative distribution function of \(E_{fd}\) viewed as a compound random variable. Let this distribution be \(F(y)\), that is, \(F(y)=prob(E_{fd}\leq y)\). The result is as follows:  
* Case 1: \(T_{slp}\leq\alpha T_{c}+T_{pkt}\) \[F(y)= \begin{cases}(\alpha+1)\frac{y}{E_{l}}\frac{T_{l}}{T_{l}+T_{slp}}&\text{ if }0<y\leq E_{1}\\ F(E_{1})+\frac{y-E_{1}}{T_{l}+T_{slp}}(\alpha\frac{T_{pkt}}{E_{rx}^{pkt}}+\frac{T_{ l}}{E_{l}})&\text{ if }E_{1}<y\leq E_{2}\\ F(E_{2})+\frac{y-E_{2}}{T_{l}+T_{slp}}((\alpha+1)\frac{T_{pkt}}{E_{rx}^{pkt}}+ \frac{T_{l}}{E_{l}})&\text{ if }E_{2}<y\leq E_{3}\\ F(E_{3})+\frac{y-E_{2}}{T_{l}}\frac{T_{l}}{T_{l}+T_{slp}}&\text{ if }E_{3}<y\leq E_{4} \end{cases} \] (12) \begin{table}
\begin{tabular}{c c c} \hline \hline
**Time Intervals (var. t)** & **Subintervals (var. t)** & \(E_{fd}\) \\ \hline \([0,T_{CCA})\) & \(E_{l}\frac{T_{CQA}-l}{T_{l}}\) & \\ \hline \([T_{CCA},T_{CCA}+T_{c})\) & \([0^{+},T_{pkt})\) & \(E_{rx}^{pkt}\frac{T_{slp}-l^{\prime}}{T_{pkt}}+E_{l}\frac{W_{ack}+T_{CCA}}{T_{l}}\) \\  & \([T_{pkt},T_{c}^{-})\) & \(E_{l}\frac{T_{c}-l^{\prime}}{T_{l}}\) \\ \hline \([T_{CCA}+T_{c},T_{CCA}+2T_{c})\) & \([0^{+},T_{pkt})\) & \(E_{rx}^{pkt}\frac{T_{slp}-l^{\prime}}{T_{pkt}}+E_{l}\frac{W_{ack}+T_{CCA}}{T_{l}}\) \\  & \([T_{pkt},T_{c}^{-})\) & \(E_{l}\frac{T_{c}-l^{\prime}}{T_{l}}\) \\ \hline \([T_{CCA}+T_{c},T_{CCA}+2T_{c})\) & \([0^{+},T_{pkt})\) & \(E_{rx}^{pkt}\frac{T_{slp}-l^{\prime}}{T_{pkt}}+E_{l}\frac{W_{ack}+T_{CCA}}{T_{l}}\) \\  & \([T_{pkt},T_{c}^{-})\) & \(E_{l}\frac{T_{c}-l^{\prime}}{T_{l}}\) \\ \hline \([T_{CCA}+(\alpha-1)T_{c},T_{CCA}+\alpha T_{c})\) & \([0^{+},T_{pkt})\) & \(E_{rx}^{pkt}\frac{T_{slp}-l^{\prime}}{T_{pkt}}+E_{l}\frac{W_{ack}+T_{CCA}}{T_{l}}\) \\  & \([T_{pkt},T_{c}^{-})\) & \(E_{l}\frac{T_{c}-l^{\prime}}{T_{l}}\) \\ \hline \([T_{CCA}+T_{slp},T_{l}+T_{slp}]\) & \(E_{l}\frac{T_{l}+T_{slp}+T_{CCA}-l}{T_{l}}\) \\ \hline \end{tabular}
\end{table} 
Table 2: Characterization of \((E_{fd})\) in terms of the transmitter-receiver asynchrony. * Case 2: \(T_{slp}>\alpha T_{c}+T_{pkt}\) \[F(y)= \begin{cases}(\alpha+1)\frac{y}{E_{l}}\frac{T_{l}}{T_{l}+T_{slp}}&\text{ if }0<y\leq E_{2}^{\prime}\\ F(E_{2}^{\prime})+(\alpha+2)\frac{y-E_{2}^{\prime}}{E_{l}}\frac{T_{l}}{T_{l}+T_{ slp}}&\text{ if }E_{2}^{\prime}<y\leq E_{1}\\ F(E_{1})+\frac{y-E_{1}}{T_{l}+T_{slp}}((\alpha+1)\frac{T_{pkt}}{E_{rx}^{pkt}}+ \frac{T_{l}}{E_{l}^{\prime}})&\text{ if }E_{1}<y\leq E_{3}\\ F(E_{3})+\frac{y-E_{3}}{E_{l}}\frac{T_{l}}{T_{l}+T_{slp}}&\text{ if }E_{3}<y\leq E_{4} \end{cases} \] (13)  
Recalling again Figure 3, we can now set up the following equation for the total energy wasted by node B to forward a single packet from A (\(E_{F}(\text{B})\)):  
\[E_{F}(\text{B})=E_{R}(\text{B})+E_{T}(\text{B}) \tag{14}\]  
Here, \(E_{T}(\text{B})\) obeys Equation (2), but particularized for node B.