# Modeling the Energy Performance of LoRaWAN
## 4 Modeling LoRaWAN End-Device Current Consumption
### Acknowledged Transmission
On the other hand, for non-zero BER, \(T_{act}\) can be calculated as shown next:  
\[T_{act}=\sum_{k=0}^{MAX\_RETR}E[T_{act\_k}]\cdot p_{k} \tag{26}\]  
where \(E[T_{act\_k}]\) can be determined by using the next equation:  
\[E[T_{act\_k}]=T_{OK}^{k}+\sum_{i=1}^{k}\left(\left(T_{ACK\_TO}-T_{rx2w}^{i} \right)+\frac{T_{A}^{i}\cdot p_{A}+T_{B}^{i}\cdot p_{B}+T_{C}^{i}\cdot p_{C}} {p_{A}+p_{B}+p_{C}}\right) \tag{27}\]  
Based on Equations (18)-(23), \(I_{avg\_ACK}\) can be obtained by considering the active interval and the sleep interval over the notification period, \(T_{Notify}\), as:  
\[I_{avg\_ACK}=\frac{I_{act}\cdot T_{act}+I_{sleep}\cdot\left(T_{notify}-T_{act} \right)}{T_{notify}} \tag{28}\]The previous equation can be used to calculate the theoretical lifetime (i.e., an upper bound on the actual lifetime) of a battery-operated end-device that performs acknowledged transmissions, denoted _Tlifetime_ACK_, on the basis of the battery capacity, \(C_{\textit{Untry}}\) (expressed in mA\(\cdot\)h), and \(I_{\textit{arg\_ACK}}\), as shown next:  
\[T_{lifetime\_ACK}=\ \frac{C_{\textit{battery}}}{I_{\textit{arg\_ACK}}} \tag{29}\]  
Finally, we model the energy cost of data delivery in acknowledged transmission, \(EC_{\textit{delivery\_ACK}}\), which provides the energy consumed by the end-device per each delivered bit of data payload in acknowledged transmission, as shown next:  
\[p_{A}=p_{coll}+(1-p_{coll})\cdot(1-(1-b)^{I_{Data}}) \tag{21}\]0  
where \(E[I_{\textit{delivery\_unACK}}]\) indicates the expected amount of data successfully delivered by the end-device per data frame transmitted in acknowledged transmission. In acknowledged transmission, the end-device will perform frame transmission retries, upon unsuccessful data frame transmission (either due to collisions or, if no collisions take place, due to bit errors). Therefore, \(E[I_{\textit{delivery\_ACK}}]\) is determined as the probability that the data message is successfully delivered in either the first transmission attempt, or one of the retransmissions for the data message:  
\[p_{A}=p_{coll}+(1-p_{coll})\cdot(1-(1-b)^{I_{Data}}) \tag{21}\]1  
It is worth adding that event \(A\), as defined above, captures the reasons that lead to absence of an acknowledgment in response to the data message sent by the end-device (i.e., collisions or bit errors). However, there is a further possible reason for absence of an acknowledgment requested by an uplink data message, which is duty-cycle limitations, since the gateway also needs to comply with regulations on this subject. Lack of an acknowledgment for this reason is likely when there is a sufficiently high amount of downlink traffic (which may comprise acknowledgments to uplink traffic from end-devices and actual downlink data messages to be sent to end-devices). Let \(p_{\textit{No\_AckDutyCycle}}\) denote the probability of absence of an acknowledgment due to duty-cycle limitations. Impact of \(p_{\textit{No\_AckDutyCycle}}\) on the end-device energy performance parameters considered in this paper can be modeled by replacing \(p_{\textit{coll}}\) by \(p_{\textit{No\_AckDutyCycle}}\) in Equations (21), (24) and (31). Therefore, the evaluation results on the impact of \(p_{\textit{coll}}\) on performance that are presented in the next section can serve to understand how energy performance of the end-device depends on \(p_{\textit{No\_AckDutyCycle}}\) as well.